Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel
@ 2025-09-05 11:14 Emanuele Ghidoli
  2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Emanuele Ghidoli @ 2025-09-05 11:14 UTC (permalink / raw)
  To: stable
  Cc: Emanuele Ghidoli, Greg Kroah-Hartman, Jonathan Bell, Keita Aihara,
	Dragan Simic, Avri Altman, Ulf Hansson

From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

Hello,

I noticed that commit 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier") 
introduces a regression because since it depends on the backport of 
commit 5c4f3e1f0a2a ("mmc: core: apply SD quirks earlier during probe").
Without this patch the quirk is not applied at all.

I backported the latter commit to 5.15 stable kernel to fix the regression.

Best regards,
Emanuele Ghidoli

Jonathan Bell (1):
  mmc: core: apply SD quirks earlier during probe

 drivers/mmc/core/sd.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.43.0


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

* [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe
  2025-09-05 11:14 [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Emanuele Ghidoli
@ 2025-09-05 11:14 ` Emanuele Ghidoli
  2025-09-06  5:31   ` Avri Altman
  2025-09-07  8:02   ` Greg Kroah-Hartman
  2025-09-06  5:28 ` [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Avri Altman
  2025-09-07  8:12 ` Greg Kroah-Hartman
  2 siblings, 2 replies; 8+ messages in thread
From: Emanuele Ghidoli @ 2025-09-05 11:14 UTC (permalink / raw)
  To: stable
  Cc: Jonathan Bell, Greg Kroah-Hartman, Keita Aihara, Dragan Simic,
	Avri Altman, Ulf Hansson, Emanuele Ghidoli

From: Jonathan Bell <jonathan@raspberrypi.com>

Applying MMC_QUIRK_BROKEN_SD_CACHE is broken, as the card's SD quirks are
referenced in sd_parse_ext_reg_perf() prior to the quirks being initialized
in mmc_blk_probe().

To fix this problem, let's split out an SD-specific list of quirks and
apply in mmc_sd_init_card() instead. In this way, sd_read_ext_regs() to has
the available information for not assigning the SD_EXT_PERF_CACHE as one of
the (un)supported features, which in turn allows mmc_sd_init_card() to
properly skip execution of sd_enable_cache().

Fixes: 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier")
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Co-developed-by: Keita Aihara <keita.aihara@sony.com>
Signed-off-by: Keita Aihara <keita.aihara@sony.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240820230631.GA436523@sony.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
---
 drivers/mmc/core/sd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 592166e53dce..7b375cebc671 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -23,6 +23,7 @@
 #include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
+#include "quirks.h"
 #include "sd.h"
 #include "sd_ops.h"
 
@@ -1468,6 +1469,9 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
 			goto free_card;
 	}
 
+	/* Apply quirks prior to card setup */
+	mmc_fixup_device(card, mmc_sd_fixups);
+
 	err = mmc_sd_setup_card(host, card, oldcard != NULL);
 	if (err)
 		goto free_card;
-- 
2.43.0


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

* RE: [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel
  2025-09-05 11:14 [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Emanuele Ghidoli
  2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
@ 2025-09-06  5:28 ` Avri Altman
  2025-09-07  8:12 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 8+ messages in thread
From: Avri Altman @ 2025-09-06  5:28 UTC (permalink / raw)
  To: Emanuele Ghidoli, stable@vger.kernel.org
  Cc: Emanuele Ghidoli, Greg Kroah-Hartman, Jonathan Bell, Keita Aihara,
	Dragan Simic, Avri Altman, Ulf Hansson

> 
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> 
> Hello,
> 
> I noticed that commit 1728e17762b9 ("mmc: core: sd: Apply
> BROKEN_SD_DISCARD quirk earlier") introduces a regression because since it
> depends on the backport of commit 5c4f3e1f0a2a ("mmc: core: apply SD quirks
> earlier during probe").
> Without this patch the quirk is not applied at all.
> 
> I backported the latter commit to 5.15 stable kernel to fix the regression.
Thanks for fixing this.

Thanks,
Avri

> 
> Best regards,
> Emanuele Ghidoli
> 
> Jonathan Bell (1):
>   mmc: core: apply SD quirks earlier during probe
> 
>  drivers/mmc/core/sd.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> --
> 2.43.0


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

* RE: [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe
  2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
@ 2025-09-06  5:31   ` Avri Altman
  2025-09-07  8:02   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 8+ messages in thread
From: Avri Altman @ 2025-09-06  5:31 UTC (permalink / raw)
  To: Emanuele Ghidoli, stable@vger.kernel.org
  Cc: Jonathan Bell, Greg Kroah-Hartman, Keita Aihara, Dragan Simic,
	Avri Altman, Ulf Hansson, Emanuele Ghidoli

> From: Jonathan Bell <jonathan@raspberrypi.com>
> 
> Applying MMC_QUIRK_BROKEN_SD_CACHE is broken, as the card's SD quirks
> are referenced in sd_parse_ext_reg_perf() prior to the quirks being initialized in
> mmc_blk_probe().
> 
> To fix this problem, let's split out an SD-specific list of quirks and apply in
> mmc_sd_init_card() instead. In this way, sd_read_ext_regs() to has the available
> information for not assigning the SD_EXT_PERF_CACHE as one of the
> (un)supported features, which in turn allows mmc_sd_init_card() to properly
> skip execution of sd_enable_cache().
> 
> Fixes: 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk
> earlier")
> Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
> Co-developed-by: Keita Aihara <keita.aihara@sony.com>
> Signed-off-by: Keita Aihara <keita.aihara@sony.com>
> Reviewed-by: Dragan Simic <dsimic@manjaro.org>
> Reviewed-by: Avri Altman <avri.altman@wdc.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/20240820230631.GA436523@sony.com
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> ---
>  drivers/mmc/core/sd.c | 4 ++++
>  1 file changed, 4 insertions(+)
Looks like your backport is missing some parts of that patch.
Please see in: https://lore.kernel.org/all/20240820230631.GA436523@sony.com/

Thanks,
Avri



> 
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index
> 592166e53dce..7b375cebc671 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -23,6 +23,7 @@
>  #include "host.h"
>  #include "bus.h"
>  #include "mmc_ops.h"
> +#include "quirks.h"
>  #include "sd.h"
>  #include "sd_ops.h"
> 
> @@ -1468,6 +1469,9 @@ static int mmc_sd_init_card(struct mmc_host *host,
> u32 ocr,
>                         goto free_card;
>         }
> 
> +       /* Apply quirks prior to card setup */
> +       mmc_fixup_device(card, mmc_sd_fixups);
> +
>         err = mmc_sd_setup_card(host, card, oldcard != NULL);
>         if (err)
>                 goto free_card;
> --
> 2.43.0


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

* Re: [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe
  2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
  2025-09-06  5:31   ` Avri Altman
@ 2025-09-07  8:02   ` Greg Kroah-Hartman
  2025-09-07 10:04     ` Avri Altman
  1 sibling, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-07  8:02 UTC (permalink / raw)
  To: Emanuele Ghidoli
  Cc: stable, Jonathan Bell, Keita Aihara, Dragan Simic, Avri Altman,
	Ulf Hansson, Emanuele Ghidoli

On Fri, Sep 05, 2025 at 01:14:29PM +0200, Emanuele Ghidoli wrote:
> From: Jonathan Bell <jonathan@raspberrypi.com>
> 
> Applying MMC_QUIRK_BROKEN_SD_CACHE is broken, as the card's SD quirks are
> referenced in sd_parse_ext_reg_perf() prior to the quirks being initialized
> in mmc_blk_probe().
> 
> To fix this problem, let's split out an SD-specific list of quirks and
> apply in mmc_sd_init_card() instead. In this way, sd_read_ext_regs() to has
> the available information for not assigning the SD_EXT_PERF_CACHE as one of
> the (un)supported features, which in turn allows mmc_sd_init_card() to
> properly skip execution of sd_enable_cache().
> 
> Fixes: 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier")
> Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
> Co-developed-by: Keita Aihara <keita.aihara@sony.com>
> Signed-off-by: Keita Aihara <keita.aihara@sony.com>
> Reviewed-by: Dragan Simic <dsimic@manjaro.org>
> Reviewed-by: Avri Altman <avri.altman@wdc.com>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/20240820230631.GA436523@sony.com
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> ---
>  drivers/mmc/core/sd.c | 4 ++++
>  1 file changed, 4 insertions(+)

What is the git id of this commit in Linus's tree?

thanks,

greg k-h

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

* Re: [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel
  2025-09-05 11:14 [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Emanuele Ghidoli
  2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
  2025-09-06  5:28 ` [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Avri Altman
@ 2025-09-07  8:12 ` Greg Kroah-Hartman
  2025-09-07 10:10   ` Avri Altman
  2 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-07  8:12 UTC (permalink / raw)
  To: Emanuele Ghidoli
  Cc: stable, Emanuele Ghidoli, Jonathan Bell, Keita Aihara,
	Dragan Simic, Avri Altman, Ulf Hansson

On Fri, Sep 05, 2025 at 01:14:28PM +0200, Emanuele Ghidoli wrote:
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> 
> Hello,
> 
> I noticed that commit 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier") 
> introduces a regression because since it depends on the backport of 
> commit 5c4f3e1f0a2a ("mmc: core: apply SD quirks earlier during probe").
> Without this patch the quirk is not applied at all.

That commit id is not a valid one in any tree I can find :(

confused,

greg k-h

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

* RE: [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe
  2025-09-07  8:02   ` Greg Kroah-Hartman
@ 2025-09-07 10:04     ` Avri Altman
  0 siblings, 0 replies; 8+ messages in thread
From: Avri Altman @ 2025-09-07 10:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Emanuele Ghidoli
  Cc: stable@vger.kernel.org, Jonathan Bell, Keita Aihara, Dragan Simic,
	Avri Altman, Ulf Hansson, Emanuele Ghidoli

> On Fri, Sep 05, 2025 at 01:14:29PM +0200, Emanuele Ghidoli wrote:
> > From: Jonathan Bell <jonathan@raspberrypi.com>
> >
> > Applying MMC_QUIRK_BROKEN_SD_CACHE is broken, as the card's SD
> quirks
> > are referenced in sd_parse_ext_reg_perf() prior to the quirks being
> > initialized in mmc_blk_probe().
> >
> > To fix this problem, let's split out an SD-specific list of quirks and
> > apply in mmc_sd_init_card() instead. In this way, sd_read_ext_regs()
> > to has the available information for not assigning the
> > SD_EXT_PERF_CACHE as one of the (un)supported features, which in turn
> > allows mmc_sd_init_card() to properly skip execution of sd_enable_cache().
> >
> > Fixes: 1728e17762b9 ("mmc: core: sd: Apply BROKEN_SD_DISCARD quirk
> > earlier")
> > Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
> > Co-developed-by: Keita Aihara <keita.aihara@sony.com>
> > Signed-off-by: Keita Aihara <keita.aihara@sony.com>
> > Reviewed-by: Dragan Simic <dsimic@manjaro.org>
> > Reviewed-by: Avri Altman <avri.altman@wdc.com>
> > Cc: stable@vger.kernel.org
> > Link: https://lore.kernel.org/r/20240820230631.GA436523@sony.com
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> > ---
> >  drivers/mmc/core/sd.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> 
> What is the git id of this commit in Linus's tree?
469e5e471398 mmc: core: apply SD quirks earlier during probe

Thanks,
Avri

> 
> thanks,
> 
> greg k-h

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

* RE: [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel
  2025-09-07  8:12 ` Greg Kroah-Hartman
@ 2025-09-07 10:10   ` Avri Altman
  0 siblings, 0 replies; 8+ messages in thread
From: Avri Altman @ 2025-09-07 10:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Emanuele Ghidoli
  Cc: stable@vger.kernel.org, Emanuele Ghidoli, Jonathan Bell,
	Keita Aihara, Dragan Simic, Avri Altman, Ulf Hansson

> 
> On Fri, Sep 05, 2025 at 01:14:28PM +0200, Emanuele Ghidoli wrote:
> > From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> >
> > Hello,
> >
> > I noticed that commit 1728e17762b9 ("mmc: core: sd: Apply
> > BROKEN_SD_DISCARD quirk earlier") introduces a regression because
> > since it depends on the backport of commit 5c4f3e1f0a2a ("mmc: core:
> apply SD quirks earlier during probe").
> > Without this patch the quirk is not applied at all.
> 
> That commit id is not a valid one in any tree I can find :(
Strangely enough, looks like that commit already exist in stable:
469e5e471398 mmc: core: apply SD quirks earlier during probe

So what exactly is the issue?

Thanks,
Avri

> 
> confused,
> 
> greg k-h

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

end of thread, other threads:[~2025-09-07 10:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:14 [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Emanuele Ghidoli
2025-09-05 11:14 ` [PATCH v1 1/1] mmc: core: apply SD quirks earlier during probe Emanuele Ghidoli
2025-09-06  5:31   ` Avri Altman
2025-09-07  8:02   ` Greg Kroah-Hartman
2025-09-07 10:04     ` Avri Altman
2025-09-06  5:28 ` [PATCH v1 0/1] mmc: core: apply SD quirks earlier during probe on 5.15 stable kernel Avri Altman
2025-09-07  8:12 ` Greg Kroah-Hartman
2025-09-07 10:10   ` Avri Altman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox