All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Apply trim broken quirk to R1J57L
@ 2021-01-18  4:27 Xiaolei Wang
  2021-01-20 13:40 ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Xiaolei Wang @ 2021-01-18  4:27 UTC (permalink / raw)
  To: ulf.hansson; +Cc: pali, lee.jones, linux-mmc, linux-kernel, xiaolei.wang

R1J57L mmc chip hw capibility indicates that it supports trim function,
but this function does not work properly, the SDIO bus does not respond,
and the IO has been waiting so set quirks to skip trim

Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
 drivers/mmc/core/quirks.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index d68e6e513a4f..63e02391c133 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
 		  MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
 	MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
 		  MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
+	MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
+		  MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
 
 	/*
 	 *  On Some Kingston eMMCs, performing trim can result in
@@ -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
 		  MMC_QUIRK_TRIM_BROKEN),
 	MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
 		  MMC_QUIRK_TRIM_BROKEN),
+	MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
+		  MMC_QUIRK_TRIM_BROKEN),
 
 	END_FIXUP
 };
-- 
2.25.1


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

* Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-18  4:27 [PATCH] mmc: core: Apply trim broken quirk to R1J57L Xiaolei Wang
@ 2021-01-20 13:40 ` Ulf Hansson
  2021-01-21  9:54   ` Wang, Xiaolei
  0 siblings, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2021-01-20 13:40 UTC (permalink / raw)
  To: Xiaolei Wang
  Cc: Pali Rohár, Lee Jones, linux-mmc, Linux Kernel Mailing List

On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com> wrote:
>
> R1J57L mmc chip hw capibility indicates that it supports trim function,
> but this function does not work properly, the SDIO bus does not respond,
> and the IO has been waiting so set quirks to skip trim

Are you sure this is an eMMC problem and not a mmc host driver issue?

Can you elaborate more what happens?

Kind regards
Uffe

>
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---
>  drivers/mmc/core/quirks.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> index d68e6e513a4f..63e02391c133 100644
> --- a/drivers/mmc/core/quirks.h
> +++ b/drivers/mmc/core/quirks.h
> @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
>                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
>         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
>                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
>
>         /*
>          *  On Some Kingston eMMCs, performing trim can result in
> @@ -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
>                   MMC_QUIRK_TRIM_BROKEN),
>         MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
>                   MMC_QUIRK_TRIM_BROKEN),
> +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> +                 MMC_QUIRK_TRIM_BROKEN),
>
>         END_FIXUP
>  };
> --
> 2.25.1
>

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

* RE: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-20 13:40 ` Ulf Hansson
@ 2021-01-21  9:54   ` Wang, Xiaolei
  2021-01-21 13:25     ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Wang, Xiaolei @ 2021-01-21  9:54 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Pali Rohár, Lee Jones, linux-mmc, Linux Kernel Mailing List

Hi

>Are you sure this is an eMMC problem and not a mmc host driver issue?

>Can you elaborate more what happens?

When I use the mkfs.f2fs tool to format the eMMC file system on the imx8qxp board, 
because mkfs.f2fs will use secdiscard first, when entering mmc_blk_issue_secdiscard_rq erase,
once the parameters are passed into MMC_SECURE_TRIM1_ARG, this function will take a long time to return .
The program has not ended, has been in TASK_UNINTERRUPTIBLE state.

I compared the mkfs.ext4 tool to format the file system. Because it directly uses mmc_blk_issue_discard_rq, 
this is a normal formatting phenomenon.

mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just different commands and parameters sent by the host as a bus.
 I did not see the description of trim in the data sheet. Could the host driver cause this problem?

Note:
The host driver I use is sdhci-esdhc-imx.c

Thanks
Xiaolei

-----Original Message-----
From: Ulf Hansson <ulf.hansson@linaro.org> 
Sent: Wednesday, January 20, 2021 9:41 PM
To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; linux-mmc@vger.kernel.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L

[Please note this e-mail is from an EXTERNAL e-mail address]

On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com> wrote:
>
> R1J57L mmc chip hw capibility indicates that it supports trim 
> function, but this function does not work properly, the SDIO bus does 
> not respond, and the IO has been waiting so set quirks to skip trim

Are you sure this is an eMMC problem and not a mmc host driver issue?

Can you elaborate more what happens?

Kind regards
Uffe

>
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---
>  drivers/mmc/core/quirks.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h 
> index d68e6e513a4f..63e02391c133 100644
> --- a/drivers/mmc/core/quirks.h
> +++ b/drivers/mmc/core/quirks.h
> @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
>                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
>         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
>                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
>
>         /*
>          *  On Some Kingston eMMCs, performing trim can result in @@ 
> -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
>                   MMC_QUIRK_TRIM_BROKEN),
>         MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
>                   MMC_QUIRK_TRIM_BROKEN),
> +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> +                 MMC_QUIRK_TRIM_BROKEN),
>
>         END_FIXUP
>  };
> --
> 2.25.1
>

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

* Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-21  9:54   ` Wang, Xiaolei
@ 2021-01-21 13:25     ` Ulf Hansson
  2021-01-25 10:46       ` Fabio Estevam
  2021-01-27  7:36       ` Bough Chen
  0 siblings, 2 replies; 8+ messages in thread
From: Ulf Hansson @ 2021-01-21 13:25 UTC (permalink / raw)
  To: Wang, Xiaolei, Fabio Estevam, Haibo Chen
  Cc: Pali Rohár, Lee Jones, linux-mmc, Linux Kernel Mailing List

+ Fabio, Haibo

On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei <Xiaolei.Wang@windriver.com> wrote:
>
> Hi
>
> >Are you sure this is an eMMC problem and not a mmc host driver issue?
>
> >Can you elaborate more what happens?
>
> When I use the mkfs.f2fs tool to format the eMMC file system on the imx8qxp board,
> because mkfs.f2fs will use secdiscard first, when entering mmc_blk_issue_secdiscard_rq erase,
> once the parameters are passed into MMC_SECURE_TRIM1_ARG, this function will take a long time to return .
> The program has not ended, has been in TASK_UNINTERRUPTIBLE state.
>
> I compared the mkfs.ext4 tool to format the file system. Because it directly uses mmc_blk_issue_discard_rq,
> this is a normal formatting phenomenon.
>
> mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just different commands and parameters sent by the host as a bus.
>  I did not see the description of trim in the data sheet. Could the host driver cause this problem?

Yes, it can - and we have had issues like these before. So before
adding a card quirk, I think we need to make sure this isn't the case.

When using MMC_SECURE_TRIM1_ARG, it's very likely that the request
takes longer to complete.

The mmc host is responsible for either dealing with busy detection
with the help of its HW/controller - or if that can't be supported,
the mmc core falls back to polling the card for busy with a CMD13.

See mmc_do_erase() in /drivers/mmc/core/core.c

>
> Note:
> The host driver I use is sdhci-esdhc-imx.c

Alright, I have looped in Fabio and Haibo that knows this driver,
let's see if they can help.

>
> Thanks
> Xiaolei

Kind regards
Uffe

>
> -----Original Message-----
> From: Ulf Hansson <ulf.hansson@linaro.org>
> Sent: Wednesday, January 20, 2021 9:41 PM
> To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; linux-mmc@vger.kernel.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
>
> [Please note this e-mail is from an EXTERNAL e-mail address]
>
> On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com> wrote:
> >
> > R1J57L mmc chip hw capibility indicates that it supports trim
> > function, but this function does not work properly, the SDIO bus does
> > not respond, and the IO has been waiting so set quirks to skip trim
>
> Are you sure this is an eMMC problem and not a mmc host driver issue?
>
> Can you elaborate more what happens?
>
> Kind regards
> Uffe
>
> >
> > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> > ---
> >  drivers/mmc/core/quirks.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> > index d68e6e513a4f..63e02391c133 100644
> > --- a/drivers/mmc/core/quirks.h
> > +++ b/drivers/mmc/core/quirks.h
> > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
> >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> >         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
> >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> > +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> >
> >         /*
> >          *  On Some Kingston eMMCs, performing trim can result in @@
> > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
> >                   MMC_QUIRK_TRIM_BROKEN),
> >         MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
> >                   MMC_QUIRK_TRIM_BROKEN),
> > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> > +                 MMC_QUIRK_TRIM_BROKEN),
> >
> >         END_FIXUP
> >  };
> > --
> > 2.25.1
> >

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

* Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-21 13:25     ` Ulf Hansson
@ 2021-01-25 10:46       ` Fabio Estevam
  2021-01-25 11:34         ` Bough Chen
  2021-01-27  7:36       ` Bough Chen
  1 sibling, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2021-01-25 10:46 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Wang, Xiaolei, Haibo Chen, Pali Rohár, Lee Jones, linux-mmc,
	Linux Kernel Mailing List

Hi Haibo,

Could you please take a look?

Thanks

On Thu, Jan 21, 2021 at 10:26 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> + Fabio, Haibo
>
> On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei <Xiaolei.Wang@windriver.com> wrote:
> >
> > Hi
> >
> > >Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > >Can you elaborate more what happens?
> >
> > When I use the mkfs.f2fs tool to format the eMMC file system on the imx8qxp board,
> > because mkfs.f2fs will use secdiscard first, when entering mmc_blk_issue_secdiscard_rq erase,
> > once the parameters are passed into MMC_SECURE_TRIM1_ARG, this function will take a long time to return .
> > The program has not ended, has been in TASK_UNINTERRUPTIBLE state.
> >
> > I compared the mkfs.ext4 tool to format the file system. Because it directly uses mmc_blk_issue_discard_rq,
> > this is a normal formatting phenomenon.
> >
> > mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just different commands and parameters sent by the host as a bus.
> >  I did not see the description of trim in the data sheet. Could the host driver cause this problem?
>
> Yes, it can - and we have had issues like these before. So before
> adding a card quirk, I think we need to make sure this isn't the case.
>
> When using MMC_SECURE_TRIM1_ARG, it's very likely that the request
> takes longer to complete.
>
> The mmc host is responsible for either dealing with busy detection
> with the help of its HW/controller - or if that can't be supported,
> the mmc core falls back to polling the card for busy with a CMD13.
>
> See mmc_do_erase() in /drivers/mmc/core/core.c
>
> >
> > Note:
> > The host driver I use is sdhci-esdhc-imx.c
>
> Alright, I have looped in Fabio and Haibo that knows this driver,
> let's see if they can help.
>
> >
> > Thanks
> > Xiaolei
>
> Kind regards
> Uffe
>
> >
> > -----Original Message-----
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> > Sent: Wednesday, January 20, 2021 9:41 PM
> > To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> > Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; linux-mmc@vger.kernel.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
> > Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> >
> > [Please note this e-mail is from an EXTERNAL e-mail address]
> >
> > On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com> wrote:
> > >
> > > R1J57L mmc chip hw capibility indicates that it supports trim
> > > function, but this function does not work properly, the SDIO bus does
> > > not respond, and the IO has been waiting so set quirks to skip trim
> >
> > Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > Can you elaborate more what happens?
> >
> > Kind regards
> > Uffe
> >
> > >
> > > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> > > ---
> > >  drivers/mmc/core/quirks.h | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> > > index d68e6e513a4f..63e02391c133 100644
> > > --- a/drivers/mmc/core/quirks.h
> > > +++ b/drivers/mmc/core/quirks.h
> > > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >
> > >         /*
> > >          *  On Some Kingston eMMCs, performing trim can result in @@
> > > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > >         MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_TRIM_BROKEN),
> > >
> > >         END_FIXUP
> > >  };
> > > --
> > > 2.25.1
> > >

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

* RE: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-25 10:46       ` Fabio Estevam
@ 2021-01-25 11:34         ` Bough Chen
  0 siblings, 0 replies; 8+ messages in thread
From: Bough Chen @ 2021-01-25 11:34 UTC (permalink / raw)
  To: Fabio Estevam, Ulf Hansson
  Cc: Wang, Xiaolei, Pali Rohár, Lee Jones, linux-mmc,
	Linux Kernel Mailing List

> -----Original Message-----
> From: Fabio Estevam [mailto:festevam@gmail.com]
> Sent: 2021年1月25日 18:47
> To: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Wang, Xiaolei <Xiaolei.Wang@windriver.com>; Bough Chen
> <haibo.chen@nxp.com>; Pali Rohár <pali@kernel.org>; Lee Jones
> <lee.jones@linaro.org>; linux-mmc@vger.kernel.org; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> 
> Hi Haibo,
> 
> Could you please take a look?

I will look into this issue this week.

Haibo Chen
> 
> Thanks
> 
> On Thu, Jan 21, 2021 at 10:26 AM Ulf Hansson <ulf.hansson@linaro.org>
> wrote:
> >
> > + Fabio, Haibo
> >
> > On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> wrote:
> > >
> > > Hi
> > >
> > > >Are you sure this is an eMMC problem and not a mmc host driver issue?
> > >
> > > >Can you elaborate more what happens?
> > >
> > > When I use the mkfs.f2fs tool to format the eMMC file system on the
> > > imx8qxp board, because mkfs.f2fs will use secdiscard first, when
> > > entering mmc_blk_issue_secdiscard_rq erase, once the parameters are
> passed into MMC_SECURE_TRIM1_ARG, this function will take a long time to
> return .
> > > The program has not ended, has been in TASK_UNINTERRUPTIBLE state.
> > >
> > > I compared the mkfs.ext4 tool to format the file system. Because it
> > > directly uses mmc_blk_issue_discard_rq, this is a normal formatting
> phenomenon.
> > >
> > > mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just
> different commands and parameters sent by the host as a bus.
> > >  I did not see the description of trim in the data sheet. Could the host
> driver cause this problem?
> >
> > Yes, it can - and we have had issues like these before. So before
> > adding a card quirk, I think we need to make sure this isn't the case.
> >
> > When using MMC_SECURE_TRIM1_ARG, it's very likely that the request
> > takes longer to complete.
> >
> > The mmc host is responsible for either dealing with busy detection
> > with the help of its HW/controller - or if that can't be supported,
> > the mmc core falls back to polling the card for busy with a CMD13.
> >
> > See mmc_do_erase() in /drivers/mmc/core/core.c
> >
> > >
> > > Note:
> > > The host driver I use is sdhci-esdhc-imx.c
> >
> > Alright, I have looped in Fabio and Haibo that knows this driver,
> > let's see if they can help.
> >
> > >
> > > Thanks
> > > Xiaolei
> >
> > Kind regards
> > Uffe
> >
> > >
> > > -----Original Message-----
> > > From: Ulf Hansson <ulf.hansson@linaro.org>
> > > Sent: Wednesday, January 20, 2021 9:41 PM
> > > To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> > > Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>;
> > > linux-mmc@vger.kernel.org; Linux Kernel Mailing List
> > > <linux-kernel@vger.kernel.org>
> > > Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> > >
> > > [Please note this e-mail is from an EXTERNAL e-mail address]
> > >
> > > On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com>
> wrote:
> > > >
> > > > R1J57L mmc chip hw capibility indicates that it supports trim
> > > > function, but this function does not work properly, the SDIO bus
> > > > does not respond, and the IO has been waiting so set quirks to
> > > > skip trim
> > >
> > > Are you sure this is an eMMC problem and not a mmc host driver issue?
> > >
> > > Can you elaborate more what happens?
> > >
> > > Kind regards
> > > Uffe
> > >
> > > >
> > > > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> > > > ---
> > > >  drivers/mmc/core/quirks.h | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> > > > index d68e6e513a4f..63e02391c133 100644
> > > > --- a/drivers/mmc/core/quirks.h
> > > > +++ b/drivers/mmc/core/quirks.h
> > > > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > >         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG,
> CID_OEMID_ANY, add_quirk_mmc,
> > > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > > +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > >
> > > >         /*
> > > >          *  On Some Kingston eMMCs, performing trim can result in
> > > > @@
> > > > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > > >                   MMC_QUIRK_TRIM_BROKEN),
> > > >         MMC_FIXUP("V10016", CID_MANFID_KINGSTON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > >                   MMC_QUIRK_TRIM_BROKEN),
> > > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > > +                 MMC_QUIRK_TRIM_BROKEN),
> > > >
> > > >         END_FIXUP
> > > >  };
> > > > --
> > > > 2.25.1
> > > >

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

* RE: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-21 13:25     ` Ulf Hansson
  2021-01-25 10:46       ` Fabio Estevam
@ 2021-01-27  7:36       ` Bough Chen
  2021-01-27  8:29         ` Wang, Xiaolei
  1 sibling, 1 reply; 8+ messages in thread
From: Bough Chen @ 2021-01-27  7:36 UTC (permalink / raw)
  To: Ulf Hansson, Wang, Xiaolei, Fabio Estevam
  Cc: Pali Rohár, Lee Jones, linux-mmc, Linux Kernel Mailing List

> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> Sent: 2021年1月21日 21:26
> To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>; Fabio Estevam
> <festevam@gmail.com>; Bough Chen <haibo.chen@nxp.com>
> Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>;
> linux-mmc@vger.kernel.org; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> 
> + Fabio, Haibo
> 
> On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> wrote:
> >
> > Hi
> >
> > >Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > >Can you elaborate more what happens?
> >
> > When I use the mkfs.f2fs tool to format the eMMC file system on the
> > imx8qxp board, because mkfs.f2fs will use secdiscard first, when
> > entering mmc_blk_issue_secdiscard_rq erase, once the parameters are
> passed into MMC_SECURE_TRIM1_ARG, this function will take a long time to
> return .
> > The program has not ended, has been in TASK_UNINTERRUPTIBLE state.
> >
> > I compared the mkfs.ext4 tool to format the file system. Because it
> > directly uses mmc_blk_issue_discard_rq, this is a normal formatting
> phenomenon.
> >
> > mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just
> different commands and parameters sent by the host as a bus.
> >  I did not see the description of trim in the data sheet. Could the host driver
> cause this problem?
> 
> Yes, it can - and we have had issues like these before. So before adding a card
> quirk, I think we need to make sure this isn't the case.
> 
> When using MMC_SECURE_TRIM1_ARG, it's very likely that the request takes
> longer to complete.
> 
> The mmc host is responsible for either dealing with busy detection with the
> help of its HW/controller - or if that can't be supported, the mmc core falls back
> to polling the card for busy with a CMD13.
> 
> See mmc_do_erase() in /drivers/mmc/core/core.c
> 
> >
> > Note:
> > The host driver I use is sdhci-esdhc-imx.c
> 
> Alright, I have looped in Fabio and Haibo that knows this driver, let's see if they
> can help.
> 

Hi Ulf and Xiaolei,

I use the mkfs.f2fs tool format a partition on one Sandisk eMMC chip on imx8 platform, do not meet issue.
I add some log, confirm mkfs.f2fs call the mmc_blk_issue_secdiscard_rq(), and the arg is MMC_SECURE_TRIM1_ARG.
For the busy detection, imx usdhc has one register bit represent the dat0 signal level. So for your mmc device, it should be the mmc device trim feature problem.

Best Regards
Haibo
> >
> > Thanks
> > Xiaolei
> 
> Kind regards
> Uffe
> 
> >
> > -----Original Message-----
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> > Sent: Wednesday, January 20, 2021 9:41 PM
> > To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> > Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>;
> > linux-mmc@vger.kernel.org; Linux Kernel Mailing List
> > <linux-kernel@vger.kernel.org>
> > Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> >
> > [Please note this e-mail is from an EXTERNAL e-mail address]
> >
> > On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang <xiaolei.wang@windriver.com>
> wrote:
> > >
> > > R1J57L mmc chip hw capibility indicates that it supports trim
> > > function, but this function does not work properly, the SDIO bus
> > > does not respond, and the IO has been waiting so set quirks to skip
> > > trim
> >
> > Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > Can you elaborate more what happens?
> >
> > Kind regards
> > Uffe
> >
> > >
> > > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> > > ---
> > >  drivers/mmc/core/quirks.h | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> > > index d68e6e513a4f..63e02391c133 100644
> > > --- a/drivers/mmc/core/quirks.h
> > > +++ b/drivers/mmc/core/quirks.h
> > > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG,
> CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >
> > >         /*
> > >          *  On Some Kingston eMMCs, performing trim can result in
> @@
> > > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > >         MMC_FIXUP("V10016", CID_MANFID_KINGSTON,
> CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_TRIM_BROKEN),
> > >
> > >         END_FIXUP
> > >  };
> > > --
> > > 2.25.1
> > >

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

* RE: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
  2021-01-27  7:36       ` Bough Chen
@ 2021-01-27  8:29         ` Wang, Xiaolei
  0 siblings, 0 replies; 8+ messages in thread
From: Wang, Xiaolei @ 2021-01-27  8:29 UTC (permalink / raw)
  To: Bough Chen, Ulf Hansson, Fabio Estevam
  Cc: Pali Rohár, Lee Jones, linux-mmc, Linux Kernel Mailing List



-----Original Message-----
From: Bough Chen <haibo.chen@nxp.com> 
Sent: Wednesday, January 27, 2021 3:36 PM
To: Ulf Hansson <ulf.hansson@linaro.org>; Wang, Xiaolei <Xiaolei.Wang@windriver.com>; Fabio Estevam <festevam@gmail.com>
Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; linux-mmc@vger.kernel.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] mmc: core: Apply trim broken quirk to R1J57L

[Please note this e-mail is from an EXTERNAL e-mail address]

> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> Sent: 2021年1月21日 21:26
> To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>; Fabio Estevam 
> <festevam@gmail.com>; Bough Chen <haibo.chen@nxp.com>
> Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; 
> linux-mmc@vger.kernel.org; Linux Kernel Mailing List 
> <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
>
> + Fabio, Haibo
>
> On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei 
> <Xiaolei.Wang@windriver.com>
> wrote:
> >
> > Hi
> >
> > >Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > >Can you elaborate more what happens?
> >
> > When I use the mkfs.f2fs tool to format the eMMC file system on the 
> > imx8qxp board, because mkfs.f2fs will use secdiscard first, when 
> > entering mmc_blk_issue_secdiscard_rq erase, once the parameters are
> passed into MMC_SECURE_TRIM1_ARG, this function will take a long time 
> to return .
> > The program has not ended, has been in TASK_UNINTERRUPTIBLE state.
> >
> > I compared the mkfs.ext4 tool to format the file system. Because it 
> > directly uses mmc_blk_issue_discard_rq, this is a normal formatting
> phenomenon.
> >
> > mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just
> different commands and parameters sent by the host as a bus.
> >  I did not see the description of trim in the data sheet. Could the 
> > host driver
> cause this problem?
>
> Yes, it can - and we have had issues like these before. So before 
> adding a card quirk, I think we need to make sure this isn't the case.
>
> When using MMC_SECURE_TRIM1_ARG, it's very likely that the request 
> takes longer to complete.
>
> The mmc host is responsible for either dealing with busy detection 
> with the help of its HW/controller - or if that can't be supported, 
> the mmc core falls back to polling the card for busy with a CMD13.
>
> See mmc_do_erase() in /drivers/mmc/core/core.c
>
> >
> > Note:
> > The host driver I use is sdhci-esdhc-imx.c
>
> Alright, I have looped in Fabio and Haibo that knows this driver, 
> let's see if they can help.
>

> Hi Ulf and Xiaolei,

> I use the mkfs.f2fs tool format a partition on one Sandisk eMMC chip on imx8 platform, do not meet issue.
> I add some log, confirm mkfs.f2fs call the mmc_blk_issue_secdiscard_rq(), and the arg is MMC_SECURE_TRIM1_ARG.
> For the busy detection, imx usdhc has one register bit represent the dat0 signal level. So for your mmc device, it should be the mmc device trim feature problem.

Hi UIf and haibo

I did the verification again and found that the kernel version I used before was v5.4. The latest kernel does not have this problem.
 This patch is not accurate. I will confirm later whether it is caused by the missing patch of v5.4.

Thanks
Xiaolei

> Best Regards
> Haibo
> >
> > Thanks
> > Xiaolei
>
> Kind regards
> Uffe
>
> >
> > -----Original Message-----
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> > Sent: Wednesday, January 20, 2021 9:41 PM
> > To: Wang, Xiaolei <Xiaolei.Wang@windriver.com>
> > Cc: Pali Rohár <pali@kernel.org>; Lee Jones <lee.jones@linaro.org>; 
> > linux-mmc@vger.kernel.org; Linux Kernel Mailing List 
> > <linux-kernel@vger.kernel.org>
> > Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L
> >
> > [Please note this e-mail is from an EXTERNAL e-mail address]
> >
> > On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang 
> > <xiaolei.wang@windriver.com>
> wrote:
> > >
> > > R1J57L mmc chip hw capibility indicates that it supports trim 
> > > function, but this function does not work properly, the SDIO bus 
> > > does not respond, and the IO has been waiting so set quirks to 
> > > skip trim
> >
> > Are you sure this is an eMMC problem and not a mmc host driver issue?
> >
> > Can you elaborate more what happens?
> >
> > Kind regards
> > Uffe
> >
> > >
> > > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> > > ---
> > >  drivers/mmc/core/quirks.h | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h 
> > > index d68e6e513a4f..63e02391c133 100644
> > > --- a/drivers/mmc/core/quirks.h
> > > +++ b/drivers/mmc/core/quirks.h
> > > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >         MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG,
> CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
> > >
> > >         /*
> > >          *  On Some Kingston eMMCs, performing trim can result in
> @@
> > > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused
> mmc_blk_fixups[] = {
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > >         MMC_FIXUP("V10016", CID_MANFID_KINGSTON,
> CID_OEMID_ANY, add_quirk_mmc,
> > >                   MMC_QUIRK_TRIM_BROKEN),
> > > +       MMC_FIXUP("R1J57L", CID_MANFID_MICRON,
> CID_OEMID_ANY, add_quirk_mmc,
> > > +                 MMC_QUIRK_TRIM_BROKEN),
> > >
> > >         END_FIXUP
> > >  };
> > > --
> > > 2.25.1
> > >

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

end of thread, other threads:[~2021-01-27  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  4:27 [PATCH] mmc: core: Apply trim broken quirk to R1J57L Xiaolei Wang
2021-01-20 13:40 ` Ulf Hansson
2021-01-21  9:54   ` Wang, Xiaolei
2021-01-21 13:25     ` Ulf Hansson
2021-01-25 10:46       ` Fabio Estevam
2021-01-25 11:34         ` Bough Chen
2021-01-27  7:36       ` Bough Chen
2021-01-27  8:29         ` Wang, Xiaolei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.