mbox series

[0/4] BCM2711's sdhci-iproc CMD timeouts

Message ID 20210322185816.27582-1-nsaenz@kernel.org
Headers show
Series BCM2711's sdhci-iproc CMD timeouts | expand

Message

nicolas saenz julienne March 22, 2021, 6:58 p.m. UTC
This series tries to address rather odd behavior from BCM2711's
integration of sdhci-iproc (Raspberry Pi 4's SoC). The controller will
timeout on SDHCI CMDs under the following conditions:

 - No SD card plugged in (the card polling thread is running, CD irq disabled).
 - BCM2711's VPU clock configured at 500MHz or more, lower clocks are OK.

There is no specific command that will time out, it seems random.

I found out that by bumping the controller's frequency to 150MHz the
issue disapears. So let's do that.

Regards,
Nicolas

---

Nicolas Saenz Julienne (4):
  dt-bindings: mmc: iproc-sdhci: Convert to json-schema
  dt-bindings: mmc: iproc-sdhci: Add clock-frequency support
  mmc: sdhci-iproc: Set clock frequency as per DT
  ARM: dts: Fix-up EMMC2 controller's frequency

 .../bindings/mmc/brcm,iproc-sdhci.yaml        | 64 +++++++++++++++++++
 .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 -----------
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts         |  6 ++
 drivers/mmc/host/sdhci-iproc.c                | 10 +++
 4 files changed, 80 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
 delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

Comments

Nicolas Saenz Julienne March 22, 2021, 7:16 p.m. UTC | #1
On Mon, 2021-03-22 at 12:11 -0700, Scott Branden wrote:
> On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:
> > Convert the brcm,iproc-sdhci binding to DT schema format using json-schema
> > 
> > Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
> > ---
> >  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++
> >  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------
> >  2 files changed, 58 insertions(+), 37 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> > new file mode 100644
> > index 000000000000..19d84f3ef9e6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> > @@ -0,0 +1,58 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Broadcom IPROC SDHCI controller
> > +
> > +maintainers:
> > +  - Nicolas Saenz Julienne <nsaenz@kernel.org>
> This is already covered in the MAINTAINERS section via "N:	iproc".
> M:	Ray Jui <ray.jui@broadcom.com>
> 
> M:	Scott Branden <scott.branden@broadcom.com>
> 
> M:	bcm-kernel-feedback-list@broadcom.com

Fair enough, I'll drop it.

Regards,
Nicolas
Rob Herring (Arm) March 23, 2021, 8:16 p.m. UTC | #2
On Mon, 22 Mar 2021 19:58:14 +0100, Nicolas Saenz Julienne wrote:
> Convert the brcm,iproc-sdhci binding to DT schema format using json-schema

> 

> Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>

> ---

>  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++

>  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------

>  2 files changed, 58 insertions(+), 37 deletions(-)

>  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

>  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

> 


My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.example.dts:22.25-26 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:349: Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.example.dt.yaml] Error 1
make: *** [Makefile:1380: dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1456815

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring (Arm) March 23, 2021, 9:08 p.m. UTC | #3
On Mon, Mar 22, 2021 at 12:11:29PM -0700, Scott Branden wrote:
> On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:
> > Convert the brcm,iproc-sdhci binding to DT schema format using json-schema
> > 
> > Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
> > ---
> >  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++
> >  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------
> >  2 files changed, 58 insertions(+), 37 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> > new file mode 100644
> > index 000000000000..19d84f3ef9e6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
> > @@ -0,0 +1,58 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Broadcom IPROC SDHCI controller
> > +
> > +maintainers:
> > +  - Nicolas Saenz Julienne <nsaenz@kernel.org>
> This is already covered in the MAINTAINERS section via "N:	iproc".
> M:	Ray Jui <ray.jui@broadcom.com>
> 
> M:	Scott Branden <scott.branden@broadcom.com>
> 
> M:	bcm-kernel-feedback-list@broadcom.com

Maybe so, but still required here. The problem is there is no 
MAINTAINERS file in the DT only tree[1].

Rob

[1] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/
Nicolas Saenz Julienne March 23, 2021, 9:24 p.m. UTC | #4
On Tue, 2021-03-23 at 15:08 -0600, Rob Herring wrote:
> On Mon, Mar 22, 2021 at 12:11:29PM -0700, Scott Branden wrote:

> > On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:

> > > Convert the brcm,iproc-sdhci binding to DT schema format using json-schema

> > > 

> > > Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>

> > > ---

> > >  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++

> > >  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------

> > >  2 files changed, 58 insertions(+), 37 deletions(-)

> > >  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > >  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

> > > 

> > > diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > > new file mode 100644

> > > index 000000000000..19d84f3ef9e6

> > > --- /dev/null

> > > +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > > @@ -0,0 +1,58 @@

> > > +# SPDX-License-Identifier: GPL-2.0

> > > +%YAML 1.2

> > > +---

> > > +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#

> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > +

> > > +title: Broadcom IPROC SDHCI controller

> > > +

> > > +maintainers:

> > > +  - Nicolas Saenz Julienne <nsaenz@kernel.org>

> > This is already covered in the MAINTAINERS section via "N:	iproc".

> > M:	Ray Jui <ray.jui@broadcom.com>

> > 

> > M:	Scott Branden <scott.branden@broadcom.com>

> > 

> > M:	bcm-kernel-feedback-list@broadcom.com

> 

> Maybe so, but still required here. The problem is there is no 

> MAINTAINERS file in the DT only tree[1].


Well in that case, if Scott and Ray are OK with it I'll add them.

Regards,
Nicolas
Scott Branden March 24, 2021, 4:27 p.m. UTC | #5
On 2021-03-23 2:24 p.m., Nicolas Saenz Julienne wrote:
> On Tue, 2021-03-23 at 15:08 -0600, Rob Herring wrote:

>> On Mon, Mar 22, 2021 at 12:11:29PM -0700, Scott Branden wrote:

>>> On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:

>>>> Convert the brcm,iproc-sdhci binding to DT schema format using json-schema

>>>>

>>>> Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>

>>>> ---

>>>>  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++

>>>>  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------

>>>>  2 files changed, 58 insertions(+), 37 deletions(-)

>>>>  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

>>>>  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

>>>>

>>>> diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

>>>> new file mode 100644

>>>> index 000000000000..19d84f3ef9e6

>>>> --- /dev/null

>>>> +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

>>>> @@ -0,0 +1,58 @@

>>>> +# SPDX-License-Identifier: GPL-2.0

>>>> +%YAML 1.2

>>>> +---

>>>> +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#

>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>>>> +

>>>> +title: Broadcom IPROC SDHCI controller

>>>> +

>>>> +maintainers:

>>>> +  - Nicolas Saenz Julienne <nsaenz@kernel.org>

>>> This is already covered in the MAINTAINERS section via "N:	iproc".

>>> M:	Ray Jui <ray.jui@broadcom.com>

>>>

>>> M:	Scott Branden <scott.branden@broadcom.com>

>>>

>>> M:	bcm-kernel-feedback-list@broadcom.com

>>

>> Maybe so, but still required here. The problem is there is no 

>> MAINTAINERS file in the DT only tree[1].

> 

> Well in that case, if Scott and Ray are OK with it I'll add them.

I do not know what the "maintainers" section in the yaml file is used to indicate.
If it is maintainer for the driver then please add the duplicate of what is already in the MAINTAINERS file.
If it is for maintainer of devicetrees that use this driver then no need to add us.
> 

> Regards,

> Nicolas

>
Nicolas Saenz Julienne March 24, 2021, 4:35 p.m. UTC | #6
On Wed, 2021-03-24 at 09:27 -0700, Scott Branden wrote:
> On 2021-03-23 2:24 p.m., Nicolas Saenz Julienne wrote:

> > On Tue, 2021-03-23 at 15:08 -0600, Rob Herring wrote:

> > > On Mon, Mar 22, 2021 at 12:11:29PM -0700, Scott Branden wrote:

> > > > On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:

> > > > > Convert the brcm,iproc-sdhci binding to DT schema format using json-schema

> > > > > 

> > > > > Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>

> > > > > ---

> > > > >  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++

> > > > >  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------

> > > > >  2 files changed, 58 insertions(+), 37 deletions(-)

> > > > >  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > > > >  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

> > > > > 

> > > > > diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > > > > new file mode 100644

> > > > > index 000000000000..19d84f3ef9e6

> > > > > --- /dev/null

> > > > > +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml

> > > > > @@ -0,0 +1,58 @@

> > > > > +# SPDX-License-Identifier: GPL-2.0

> > > > > +%YAML 1.2

> > > > > +---

> > > > > +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#

> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > > > +

> > > > > +title: Broadcom IPROC SDHCI controller

> > > > > +

> > > > > +maintainers:

> > > > > +  - Nicolas Saenz Julienne <nsaenz@kernel.org>

> > > > This is already covered in the MAINTAINERS section via "N:	iproc".

> > > > M:	Ray Jui <ray.jui@broadcom.com>

> > > > 

> > > > M:	Scott Branden <scott.branden@broadcom.com>

> > > > 

> > > > M:	bcm-kernel-feedback-list@broadcom.com

> > > 

> > > Maybe so, but still required here. The problem is there is no 

> > > MAINTAINERS file in the DT only tree[1].

> > 

> > Well in that case, if Scott and Ray are OK with it I'll add them.

> I do not know what the "maintainers" section in the yaml file is used to indicate.

> If it is maintainer for the driver then please add the duplicate of what is

> already in the MAINTAINERS file.  If it is for maintainer of devicetrees that

> use this driver then no need to add us.


From the dt bindings documentation:

maintainers
  A DT specific property. Contains a list of email address(es)
  for maintainers of this binding.

That's the maintainers for the bindings, not the devicetrees consuming them. I
belive it makes sense for you guys to maintain it as it has a strong
relationship to driver changes. But if you're not interested I'll do it myself.

Regards,
Nicolas
Scott Branden March 24, 2021, 4:43 p.m. UTC | #7
On 2021-03-24 9:35 a.m., Nicolas Saenz Julienne wrote:
> On Wed, 2021-03-24 at 09:27 -0700, Scott Branden wrote:
>> On 2021-03-23 2:24 p.m., Nicolas Saenz Julienne wrote:
>>> On Tue, 2021-03-23 at 15:08 -0600, Rob Herring wrote:
>>>> On Mon, Mar 22, 2021 at 12:11:29PM -0700, Scott Branden wrote:
>>>>> On 2021-03-22 11:58 a.m., Nicolas Saenz Julienne wrote:
>>>>>> Convert the brcm,iproc-sdhci binding to DT schema format using json-schema
>>>>>>
>>>>>> Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
>>>>>> ---
>>>>>>  .../bindings/mmc/brcm,iproc-sdhci.yaml        | 58 +++++++++++++++++++
>>>>>>  .../bindings/mmc/brcm,sdhci-iproc.txt         | 37 ------------
>>>>>>  2 files changed, 58 insertions(+), 37 deletions(-)
>>>>>>  create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
>>>>>>  delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
>>>>>> new file mode 100644
>>>>>> index 000000000000..19d84f3ef9e6
>>>>>> --- /dev/null
>>>>>> +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml
>>>>>> @@ -0,0 +1,58 @@
>>>>>> +# SPDX-License-Identifier: GPL-2.0
>>>>>> +%YAML 1.2
>>>>>> +---
>>>>>> +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml#
>>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>>> +
>>>>>> +title: Broadcom IPROC SDHCI controller
>>>>>> +
>>>>>> +maintainers:
>>>>>> +  - Nicolas Saenz Julienne <nsaenz@kernel.org>
>>>>> This is already covered in the MAINTAINERS section via "N:	iproc".
>>>>> M:	Ray Jui <ray.jui@broadcom.com>
>>>>>
>>>>> M:	Scott Branden <scott.branden@broadcom.com>
>>>>>
>>>>> M:	bcm-kernel-feedback-list@broadcom.com
>>>>
>>>> Maybe so, but still required here. The problem is there is no 
>>>> MAINTAINERS file in the DT only tree[1].
>>>
>>> Well in that case, if Scott and Ray are OK with it I'll add them.
>> I do not know what the "maintainers" section in the yaml file is used to indicate.
>> If it is maintainer for the driver then please add the duplicate of what is
>> already in the MAINTAINERS file.  If it is for maintainer of devicetrees that
>> use this driver then no need to add us.
> 
> From the dt bindings documentation:
> 
> maintainers
>   A DT specific property. Contains a list of email address(es)
>   for maintainers of this binding.
> 
> That's the maintainers for the bindings, not the devicetrees consuming them. I
> belive it makes sense for you guys to maintain it as it has a strong
> relationship to driver changes. But if you're not interested I'll do it myself.
Sure, you can add us as well.
> 
> Regards,
> Nicolas
>