linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
@ 2019-12-04  2:18 BOUGH CHEN
  0 siblings, 0 replies; 6+ messages in thread
From: BOUGH CHEN @ 2019-12-04  2:18 UTC (permalink / raw)
  To: ulf.hansson, robh+dt, mark.rutland, shawnguo, s.hauer
  Cc: kernel, festevam, dl-linux-imx, linux-mmc

Add sdhci,auto-cmd23-broken binding.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 89b986a2f9d5..7ea8e0f14e5f 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -46,6 +46,14 @@ Optional properties:
   property allows user to change the delay target for the strobe input read clock.
   If not use this property, driver default set the delay target to value 7.
   Only eMMC HS400 mode need to take care of this property.
+- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
+  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use ADMA mode. Because
+  for these SoC, it do not support the ACMD23 completely, only take the 16 bit block
+  count from the 0x4 register (BLK_ATT) as argument for the ACMD23, the upper 16 bit
+  of the CMD23's argument is ignored. This will impact the reliable write operation
+  and the RPMB block write operation, because these operations need to set the bit 31
+  of the CMD23's argument. SDMA mode will default disable the ACMD23 mode. SD card do
+  not has this limitation on these SoCs.
 
 Examples:
 
-- 
2.17.1


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

* Re: [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
  2020-02-10  3:08       ` BOUGH CHEN
@ 2020-02-10 13:30         ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-02-10 13:30 UTC (permalink / raw)
  To: BOUGH CHEN
  Cc: ulf.hansson, adrian.hunter, shawnguo, kernel, dl-linux-imx, linux-mmc

On Mon, Feb 10, 2020 at 4:08 AM BOUGH CHEN <haibo.chen@nxp.com> wrote:
> > On Wed, Dec 11, 2019 at 12:32 AM Linus Walleij <linus.walleij@linaro.org>
> > wrote:
> > > On Tue, Dec 3, 2019 at 1:54 PM BOUGH CHEN <haibo.chen@nxp.com>
> > wrote:
> > >
> > > > +- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
> > > > +  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use
> > > > +ADMA mode. Because
> > > > +  for these SoC, it do not support the ACMD23 completely, only take
> > > > +the 16 bit block
> > > > +  count from the 0x4 register (BLK_ATT) as argument for the ACMD23,
> > > > +the upper 16 bit
> > > > +  of the CMD23's argument is ignored. This will impact the reliable
> > > > +write operation
> > > > +  and the RPMB block write operation, because these operations need
> > > > +to set the bit 31
> > > > +  of the CMD23's argument. SDMA mode will default disable the
> > > > +ACMD23 mode. SD card do
> > > > +  not has this limitation on these SoCs.
> > >
> > > This looks weird.
> > >
> > > Is the bug in the *host controller* or in *the card*?
> > >
> > > It looks like the card.
> >
> > After looking at the next patch it looks like the host controller.
> >
> > In that case the compatible-string should indicate what version of the IP you
> > are using and if it has this bug.
> >
> > No special flags needed for that.
>
> Hi Linus,
>
> Yes, this is host IP limitation. I did consider the method as you suggested,
>  use compatible-string to distinguish. But then I notice that this host limitation
> only impact the eMMC device for RPMB reliable write, for SD card, it do not
> support this mode, so this hardware limitation do not impact for sd card.
> This is why I use "sdhci,auto-cmd23-broken" in devicetree, only the emmc
> device need to contain this in dts file.
>
> I double check this issue, since this auto-cmd23 will not impact the sd
> performance, and it is the host IP limitation, I will chose to accept your
> suggestion, will send a new patch.

Should be fine, the code in the MMC core knows if what you are using
is an eMMC or an SD card so you can just handle the quirk only in the
eMMC case.

Yours,
Linus Walleij

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

* RE: [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
  2019-12-10 23:39     ` Linus Walleij
@ 2020-02-10  3:08       ` BOUGH CHEN
  2020-02-10 13:30         ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: BOUGH CHEN @ 2020-02-10  3:08 UTC (permalink / raw)
  To: Linus Walleij
  Cc: ulf.hansson, adrian.hunter, shawnguo, kernel, dl-linux-imx, linux-mmc

> -----Original Message-----
> From: Linus Walleij <linus.walleij@linaro.org>
> Sent: 2019年12月11日 7:40
> To: BOUGH CHEN <haibo.chen@nxp.com>
> Cc: ulf.hansson@linaro.org; adrian.hunter@intel.com;
> shawnguo@kernel.org; kernel@pengutronix.de; dl-linux-imx
> <linux-imx@nxp.com>; linux-mmc@vger.kernel.org
> Subject: Re: [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add
> auto-cmd23-broken binding
> 
> On Wed, Dec 11, 2019 at 12:32 AM Linus Walleij <linus.walleij@linaro.org>
> wrote:
> > On Tue, Dec 3, 2019 at 1:54 PM BOUGH CHEN <haibo.chen@nxp.com>
> wrote:
> >
> > > +- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
> > > +  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use
> > > +ADMA mode. Because
> > > +  for these SoC, it do not support the ACMD23 completely, only take
> > > +the 16 bit block
> > > +  count from the 0x4 register (BLK_ATT) as argument for the ACMD23,
> > > +the upper 16 bit
> > > +  of the CMD23's argument is ignored. This will impact the reliable
> > > +write operation
> > > +  and the RPMB block write operation, because these operations need
> > > +to set the bit 31
> > > +  of the CMD23's argument. SDMA mode will default disable the
> > > +ACMD23 mode. SD card do
> > > +  not has this limitation on these SoCs.
> >
> > This looks weird.
> >
> > Is the bug in the *host controller* or in *the card*?
> >
> > It looks like the card.
> 
> After looking at the next patch it looks like the host controller.
> 
> In that case the compatible-string should indicate what version of the IP you
> are using and if it has this bug.
> 
> No special flags needed for that.

Hi Linus,

Yes, this is host IP limitation. I did consider the method as you suggested, use compatible-string to distinguish. But then I notice that this host limitation only impact the eMMC device for RPMB reliable write, for SD card, it do not support this mode, so this hardware limitation do not impact for sd card.
This is why I use "sdhci,auto-cmd23-broken" in devicetree, only the emmc device need to contain this in dts file.

I double check this issue, since this auto-cmd23 will not impact the sd performance, and it is the host IP limitation, I will chose to accept your suggestion, will send a new patch.

Thanks,

Bough Chen


> 
> Yours,
> Linus Walleij

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

* Re: [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
  2019-12-10 23:32   ` Linus Walleij
@ 2019-12-10 23:39     ` Linus Walleij
  2020-02-10  3:08       ` BOUGH CHEN
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2019-12-10 23:39 UTC (permalink / raw)
  To: BOUGH CHEN
  Cc: ulf.hansson, adrian.hunter, shawnguo, kernel, dl-linux-imx, linux-mmc

On Wed, Dec 11, 2019 at 12:32 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Dec 3, 2019 at 1:54 PM BOUGH CHEN <haibo.chen@nxp.com> wrote:
>
> > +- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
> > +  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use ADMA mode. Because
> > +  for these SoC, it do not support the ACMD23 completely, only take the 16 bit block
> > +  count from the 0x4 register (BLK_ATT) as argument for the ACMD23, the upper 16 bit
> > +  of the CMD23's argument is ignored. This will impact the reliable write operation
> > +  and the RPMB block write operation, because these operations need to set the bit 31
> > +  of the CMD23's argument. SDMA mode will default disable the ACMD23 mode. SD card do
> > +  not has this limitation on these SoCs.
>
> This looks weird.
>
> Is the bug in the *host controller* or in *the card*?
>
> It looks like the card.

After looking at the next patch it looks like the host controller.

In that case the compatible-string should indicate what version of
the IP you are using and if it has this bug.

No special flags needed for that.

Yours,
Linus Walleij

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

* Re: [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
  2019-12-03 12:54 ` [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding BOUGH CHEN
@ 2019-12-10 23:32   ` Linus Walleij
  2019-12-10 23:39     ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2019-12-10 23:32 UTC (permalink / raw)
  To: BOUGH CHEN
  Cc: ulf.hansson, adrian.hunter, shawnguo, kernel, dl-linux-imx, linux-mmc

On Tue, Dec 3, 2019 at 1:54 PM BOUGH CHEN <haibo.chen@nxp.com> wrote:

> +- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
> +  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use ADMA mode. Because
> +  for these SoC, it do not support the ACMD23 completely, only take the 16 bit block
> +  count from the 0x4 register (BLK_ATT) as argument for the ACMD23, the upper 16 bit
> +  of the CMD23's argument is ignored. This will impact the reliable write operation
> +  and the RPMB block write operation, because these operations need to set the bit 31
> +  of the CMD23's argument. SDMA mode will default disable the ACMD23 mode. SD card do
> +  not has this limitation on these SoCs.

This looks weird.

Is the bug in the *host controller* or in *the card*?

It looks like the card.

And then it should just be a quirk for this eMMC card in
drivers/mmc/core/quirks.h plus corresponding code in
the core.

Otherwise everyone using this eMMC card has to add this
property in their device tree and that is wrong if we can already
detect it from the card ID and apply it for that card, anywhere.

This is not the first time I see card quirks as DT properties,
it seems like a bit over-reliance on DT.

Yours,
Linus Walleij

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

* [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding
  2019-12-03 12:54 [PATCH v2 00/14] few fix for sdhci-esdhc-imx BOUGH CHEN
@ 2019-12-03 12:54 ` BOUGH CHEN
  2019-12-10 23:32   ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: BOUGH CHEN @ 2019-12-03 12:54 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: shawnguo, kernel, dl-linux-imx, BOUGH CHEN, linus.walleij, linux-mmc

Add sdhci,auto-cmd23-broken binding.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 89b986a2f9d5..7ea8e0f14e5f 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -46,6 +46,14 @@ Optional properties:
   property allows user to change the delay target for the strobe input read clock.
   If not use this property, driver default set the delay target to value 7.
   Only eMMC HS400 mode need to take care of this property.
+- sdhci,auto-cmd23-broken: disable the ACMD23 function of USDHC.
+  This is required for eMMC on imx6qpdl/imx6sx/imx7d when it use ADMA mode. Because
+  for these SoC, it do not support the ACMD23 completely, only take the 16 bit block
+  count from the 0x4 register (BLK_ATT) as argument for the ACMD23, the upper 16 bit
+  of the CMD23's argument is ignored. This will impact the reliable write operation
+  and the RPMB block write operation, because these operations need to set the bit 31
+  of the CMD23's argument. SDMA mode will default disable the ACMD23 mode. SD card do
+  not has this limitation on these SoCs.
 
 Examples:
 
-- 
2.17.1


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

end of thread, other threads:[~2020-02-10 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04  2:18 [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding BOUGH CHEN
  -- strict thread matches above, loose matches on Subject: below --
2019-12-03 12:54 [PATCH v2 00/14] few fix for sdhci-esdhc-imx BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding BOUGH CHEN
2019-12-10 23:32   ` Linus Walleij
2019-12-10 23:39     ` Linus Walleij
2020-02-10  3:08       ` BOUGH CHEN
2020-02-10 13:30         ` Linus Walleij

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).