linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe
@ 2022-12-01  9:11 Wenchao Chen
  2022-12-01 10:32 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Wenchao Chen @ 2022-12-01  9:11 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

The prefer asynchronous probe affects the order of device probes.

Fixes: d86472ae8b20 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4")
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
---
 drivers/mmc/host/sdhci-sprd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index b92a408f138d..bf8df727e95e 100644
--- a/drivers/mmc/host/sdhci-sprd.c
+++ b/drivers/mmc/host/sdhci-sprd.c
@@ -801,7 +801,6 @@ static struct platform_driver sdhci_sprd_driver = {
 	.remove = sdhci_sprd_remove,
 	.driver = {
 		.name = "sdhci_sprd_r11",
-		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.of_match_table = sdhci_sprd_of_match,
 		.pm = &sdhci_sprd_pm_ops,
 	},
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe
  2022-12-01  9:11 [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe Wenchao Chen
@ 2022-12-01 10:32 ` Ulf Hansson
  2022-12-02  2:41   ` Wenchao Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2022-12-01 10:32 UTC (permalink / raw)
  To: Wenchao Chen
  Cc: adrian.hunter, orsonzhai, baolin.wang, zhang.lyra, linux-mmc,
	linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On Thu, 1 Dec 2022 at 10:12, Wenchao Chen <wenchao.chen@unisoc.com> wrote:
>
> The prefer asynchronous probe affects the order of device probes.

Is there a problem with this? If so, can you elaborate on what kind of problems?

>
> Fixes: d86472ae8b20 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4")
> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-sprd.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index b92a408f138d..bf8df727e95e 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -801,7 +801,6 @@ static struct platform_driver sdhci_sprd_driver = {
>         .remove = sdhci_sprd_remove,
>         .driver = {
>                 .name = "sdhci_sprd_r11",
> -               .probe_type = PROBE_PREFER_ASYNCHRONOUS,
>                 .of_match_table = sdhci_sprd_of_match,
>                 .pm = &sdhci_sprd_pm_ops,
>         },
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe
  2022-12-01 10:32 ` Ulf Hansson
@ 2022-12-02  2:41   ` Wenchao Chen
  2022-12-07 12:50     ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Wenchao Chen @ 2022-12-02  2:41 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Wenchao Chen, adrian.hunter, orsonzhai, baolin.wang, zhang.lyra,
	linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On Thu, Dec 1, 2022 at 6:41 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Thu, 1 Dec 2022 at 10:12, Wenchao Chen <wenchao.chen@unisoc.com> wrote:
> >
> > The prefer asynchronous probe affects the order of device probes.
>
> Is there a problem with this? If so, can you elaborate on what kind of problems?
>

Hi Uffe
dts:
sdio0: sdio@71100000 {
...
bus-width = <4>;
no-sdio;
no-mmc;
...
}; // SD Host(Device: SD CARD)

sdio3: sdio@71400000 {
...
bus-width = <8>;
non-removable;
no-sdio;
no-sd;
...
}; // eMMC Host(Device: eMMC)

According to the order of DTS: sdio0: sdio@71100000 is MMC0, sdio3:
sdio@71400000 is MMC1.
Log:
[    1.714617][   T11] mmc1: SDHCI controller on 71400000.sdio
[71400000.sdio] using ADMA 64-bit
[    1.715276][    T9] mmc0: SDHCI controller on 71100000.sdio
[71100000.sdio] using ADMA 64-bit
[    1.884525][   T75] mmc1: Host Software Queue enabled
[    1.890965][   T75] mmc1: new HS400 Enhanced strobe MMC card at address 0001

But set prefer_asynchronous_probe, sometimes there will be sdio0:
sdio@71100000 is MMC1, sdio3: sdio@71400000 is MMC0.
Log:
[    1.619888][   T68] mmc0: SDHCI controller on 71400000.sdio
[71400000.sdio] using ADMA 64-bit
[    1.620534][    T9] mmc1: SDHCI controller on 71100000.sdio
[71100000.sdio] using ADMA 64-bit
[    1.792570][   T77] mmc0: Host Software Queue enabled
[    1.799532][   T77] mmc0: new HS400 Enhanced strobe MMC card at address 0001

We use emmc as rootfs (without ramfs or initfs), but with SD card
inserted and not inserted, the partition name of emmc is different, we
need to fix this partition name.

> >
> > Fixes: d86472ae8b20 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4")
> > Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
>
> Kind regards
> Uffe
>
> > ---
> >  drivers/mmc/host/sdhci-sprd.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> > index b92a408f138d..bf8df727e95e 100644
> > --- a/drivers/mmc/host/sdhci-sprd.c
> > +++ b/drivers/mmc/host/sdhci-sprd.c
> > @@ -801,7 +801,6 @@ static struct platform_driver sdhci_sprd_driver = {
> >         .remove = sdhci_sprd_remove,
> >         .driver = {
> >                 .name = "sdhci_sprd_r11",
> > -               .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> >                 .of_match_table = sdhci_sprd_of_match,
> >                 .pm = &sdhci_sprd_pm_ops,
> >         },
> > --
> > 2.17.1
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe
  2022-12-02  2:41   ` Wenchao Chen
@ 2022-12-07 12:50     ` Ulf Hansson
  2022-12-09  6:37       ` Wenchao Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2022-12-07 12:50 UTC (permalink / raw)
  To: Wenchao Chen
  Cc: Wenchao Chen, adrian.hunter, orsonzhai, baolin.wang, zhang.lyra,
	linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On Fri, 2 Dec 2022 at 03:41, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
>
> On Thu, Dec 1, 2022 at 6:41 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >
> > On Thu, 1 Dec 2022 at 10:12, Wenchao Chen <wenchao.chen@unisoc.com> wrote:
> > >
> > > The prefer asynchronous probe affects the order of device probes.
> >
> > Is there a problem with this? If so, can you elaborate on what kind of problems?
> >
>
> Hi Uffe
> dts:
> sdio0: sdio@71100000 {
> ...
> bus-width = <4>;
> no-sdio;
> no-mmc;
> ...
> }; // SD Host(Device: SD CARD)
>
> sdio3: sdio@71400000 {
> ...
> bus-width = <8>;
> non-removable;
> no-sdio;
> no-sd;
> ...
> }; // eMMC Host(Device: eMMC)
>
> According to the order of DTS: sdio0: sdio@71100000 is MMC0, sdio3:
> sdio@71400000 is MMC1.
> Log:
> [    1.714617][   T11] mmc1: SDHCI controller on 71400000.sdio
> [71400000.sdio] using ADMA 64-bit
> [    1.715276][    T9] mmc0: SDHCI controller on 71100000.sdio
> [71100000.sdio] using ADMA 64-bit
> [    1.884525][   T75] mmc1: Host Software Queue enabled
> [    1.890965][   T75] mmc1: new HS400 Enhanced strobe MMC card at address 0001
>
> But set prefer_asynchronous_probe, sometimes there will be sdio0:
> sdio@71100000 is MMC1, sdio3: sdio@71400000 is MMC0.
> Log:
> [    1.619888][   T68] mmc0: SDHCI controller on 71400000.sdio
> [71400000.sdio] using ADMA 64-bit
> [    1.620534][    T9] mmc1: SDHCI controller on 71100000.sdio
> [71100000.sdio] using ADMA 64-bit
> [    1.792570][   T77] mmc0: Host Software Queue enabled
> [    1.799532][   T77] mmc0: new HS400 Enhanced strobe MMC card at address 0001

Neither the order of the nodes in DT or dropping
PROBE_PREFER_ASYNCHRONOUS provides the guarantees that you suggest
above. In fact, that has never been the case for eMMC/SD cards.

>
> We use emmc as rootfs (without ramfs or initfs), but with SD card
> inserted and not inserted, the partition name of emmc is different, we
> need to fix this partition name.

If you can't use PARTUUID/UUID, which is certainly the preferred
solution - you may also assign a fixed index mmcN to an MMC host
controller and its corresponding mmcblk[n] devices, by defining an
alias in the /aliases device tree node.

[...]

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe
  2022-12-07 12:50     ` Ulf Hansson
@ 2022-12-09  6:37       ` Wenchao Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Wenchao Chen @ 2022-12-09  6:37 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Wenchao Chen, adrian.hunter, orsonzhai, baolin.wang, zhang.lyra,
	linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On Wed, Dec 7, 2022 at 8:50 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Fri, 2 Dec 2022 at 03:41, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
> >
> > On Thu, Dec 1, 2022 at 6:41 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > >
> > > On Thu, 1 Dec 2022 at 10:12, Wenchao Chen <wenchao.chen@unisoc.com> wrote:
> > > >
> > > > The prefer asynchronous probe affects the order of device probes.
> > >
> > > Is there a problem with this? If so, can you elaborate on what kind of problems?
> > >
> >
> > Hi Uffe
> > dts:
> > sdio0: sdio@71100000 {
> > ...
> > bus-width = <4>;
> > no-sdio;
> > no-mmc;
> > ...
> > }; // SD Host(Device: SD CARD)
> >
> > sdio3: sdio@71400000 {
> > ...
> > bus-width = <8>;
> > non-removable;
> > no-sdio;
> > no-sd;
> > ...
> > }; // eMMC Host(Device: eMMC)
> >
> > According to the order of DTS: sdio0: sdio@71100000 is MMC0, sdio3:
> > sdio@71400000 is MMC1.
> > Log:
> > [    1.714617][   T11] mmc1: SDHCI controller on 71400000.sdio
> > [71400000.sdio] using ADMA 64-bit
> > [    1.715276][    T9] mmc0: SDHCI controller on 71100000.sdio
> > [71100000.sdio] using ADMA 64-bit
> > [    1.884525][   T75] mmc1: Host Software Queue enabled
> > [    1.890965][   T75] mmc1: new HS400 Enhanced strobe MMC card at address 0001
> >
> > But set prefer_asynchronous_probe, sometimes there will be sdio0:
> > sdio@71100000 is MMC1, sdio3: sdio@71400000 is MMC0.
> > Log:
> > [    1.619888][   T68] mmc0: SDHCI controller on 71400000.sdio
> > [71400000.sdio] using ADMA 64-bit
> > [    1.620534][    T9] mmc1: SDHCI controller on 71100000.sdio
> > [71100000.sdio] using ADMA 64-bit
> > [    1.792570][   T77] mmc0: Host Software Queue enabled
> > [    1.799532][   T77] mmc0: new HS400 Enhanced strobe MMC card at address 0001
>
> Neither the order of the nodes in DT or dropping
> PROBE_PREFER_ASYNCHRONOUS provides the guarantees that you suggest
> above. In fact, that has never been the case for eMMC/SD cards.
>
> >
> > We use emmc as rootfs (without ramfs or initfs), but with SD card
> > inserted and not inserted, the partition name of emmc is different, we
> > need to fix this partition name.
>
> If you can't use PARTUUID/UUID, which is certainly the preferred
> solution - you may also assign a fixed index mmcN to an MMC host
> controller and its corresponding mmcblk[n] devices, by defining an
> alias in the /aliases device tree node.
>

You're right.

        aliases {
...
               mmc0 = &sdio3;
               mmc1 = &sdio0;
...
        };

Thank you very much.

> [...]
>
> Kind regards
> Uffe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-09  6:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  9:11 [PATCH] mmc: sdhci-sprd: remove prefer asynchronous probe Wenchao Chen
2022-12-01 10:32 ` Ulf Hansson
2022-12-02  2:41   ` Wenchao Chen
2022-12-07 12:50     ` Ulf Hansson
2022-12-09  6:37       ` Wenchao Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).