2020-01-20 04:34:40

by Stephen Brennan

[permalink] [raw]
Subject: [PATCH] ARM: dts: bcm2711: Use bcm2711 compatible for sdhci

When booting Raspberry Pi 4B using a micro SDHC UHS class 1 card, the SD
card partitions never appear in /dev. According to the device tree
bindings for Broadcom IPROC SDHCI controller, we should use
"brcm,bcm2711-emmc2" compatible string on BCM2711. Set this compatible
string, which allows these cards to be mounted.

Signed-off-by: Stephen Brennan <[email protected]>
---
arch/arm/boot/dts/bcm2711.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index b64865ad5a41..48e3b0162bda 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -853,6 +853,7 @@ &mailbox {
};

&sdhci {
+ compatible = "brcm,bcm2711-emmc2";
interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
};

--
2.24.0




2020-01-20 09:02:03

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: bcm2711: Use bcm2711 compatible for sdhci



On 20/01/2020 05:17, Stephen Brennan wrote:
> When booting Raspberry Pi 4B using a micro SDHC UHS class 1 card, the SD
> card partitions never appear in /dev. According to the device tree
> bindings for Broadcom IPROC SDHCI controller, we should use
> "brcm,bcm2711-emmc2" compatible string on BCM2711. Set this compatible
> string, which allows these cards to be mounted.
>
> Signed-off-by: Stephen Brennan <[email protected]>
> ---
> arch/arm/boot/dts/bcm2711.dtsi | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
> index b64865ad5a41..48e3b0162bda 100644
> --- a/arch/arm/boot/dts/bcm2711.dtsi
> +++ b/arch/arm/boot/dts/bcm2711.dtsi
> @@ -853,6 +853,7 @@ &mailbox {
> };
>
> &sdhci {
> + compatible = "brcm,bcm2711-emmc2";
> interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
> };
>
>

hm, sdhci is used to drive the wifi chip:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/bcm2711-rpi-4-b.dts?h=v5.5-rc7#n79

Are you sure you use the upstream devicetree?

Regards,
Matthias

2020-01-20 11:06:38

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: bcm2711: Use bcm2711 compatible for sdhci

Hi Stephen,

On Sun, 2020-01-19 at 20:17 -0800, Stephen Brennan wrote:
> When booting Raspberry Pi 4B using a micro SDHC UHS class 1 card, the SD
> card partitions never appear in /dev. According to the device tree
> bindings for Broadcom IPROC SDHCI controller, we should use
> "brcm,bcm2711-emmc2" compatible string on BCM2711. Set this compatible
> string, which allows these cards to be mounted.
>
> Signed-off-by: Stephen Brennan <[email protected]>

Your UHS class 1 card should work out of the box using the current kernel
version. Note that the device node is defined here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/bcm2711.dtsi?h=v5.5-rc7#n255

and enabled here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/bcm2711-rpi-4-b.dts?h=v5.5-rc7#n98

Regards,
Nicolas


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part

2020-01-20 20:00:36

by Stephen Brennan

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: bcm2711: Use bcm2711 compatible for sdhci

Hi Nicolas,

You're right, this patch doesn't work (it doesn't even touch the correct
device tree node). My bad.

> Your UHS class 1 card should work out of the box using the current
> kernel version.

I've been debugging an issue (reproduced on today's linux-next) in which my
UHS class 1 card's partitions don't show up in `/dev`. For example, if I do
`ls /dev | grep mmc`, I get just one result, "mmcblk1". I thought my patch
fixed the issue, but it turns out that the issue is sporadic: on some
boots, the issue manifests. On others, the partitions appear in /dev as
normal. When I tested this patch, the issue had sporadically disappeared,
leading me to believe the patch was effective.

Sorry for the noise! If you have any suggestions on debugging this, I'd
appreciate it. As far as I know it could be anything - the particular card,
the particular Pi, etc.

Thanks,
Stephen

2020-01-21 10:03:50

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] ARM: dts: bcm2711: Use bcm2711 compatible for sdhci

Hi Stephen,

On Mon Jan 20, 2020 at 11:59 AM, Stephen Brennan wrote:
> Hi Nicolas,
>
> You're right, this patch doesn't work (it doesn't even touch the correct
> device tree node). My bad.
>
> > Your UHS class 1 card should work out of the box using the current
> > kernel version.
>
> I've been debugging an issue (reproduced on today's linux-next) in which
> my
> UHS class 1 card's partitions don't show up in `/dev`. For example, if I
> do
> `ls /dev | grep mmc`, I get just one result, "mmcblk1". I thought my
> patch
> fixed the issue, but it turns out that the issue is sporadic: on some
> boots, the issue manifests. On others, the partitions appear in /dev as
> normal. When I tested this patch, the issue had sporadically
> disappeared,
> leading me to believe the patch was effective.

Have you been playing with different device-trees? notably with the
Raspberry Pi foundation ones. Your mmc numbers could change, which might
be confusing.

If 100% sure it's failing, i.e. nothing happens for the mmc device after
seeing:

mmc1: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA

I suggest enabling some extra debug options. Build the kernel with
DYNAMIC_DEBUG enabled and add dyndbg="module sdhci +mfp; module mmc_core
+mfp" to your kernel command line. It'll be extremely verbose for the
working case, but we can compare both and try to find something fishy.

Note that I use two UHS class 1 cards myself without issue.

> Sorry for the noise!

On the contrary, the more we are the better :)

Regards,
Nicolas