public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards"
@ 2023-11-03  0:42 Dominique Martinet
  2023-11-03  6:40 ` Avri Altman
  2023-11-03 11:16 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Dominique Martinet @ 2023-11-03  0:42 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, linux-kernel, Dominique Martinet, stable, Avri Altman,
	Alex Fetters

From: Dominique Martinet <dominique.martinet@atmark-techno.com>

This reverts commit 84ee19bffc9306128cd0f1c650e89767079efeff.

The commit above made quirks with an OEMID fail to be applied, as they
were checking card->cid.oemid for the full 16 bits defined in MMC_FIXUP
macros but the field would only contain the bottom 8 bits.

eMMC v5.1A might have bogus values in OEMID's higher bits so another fix
will be made, but it has been decided to revert this until that is ready.

Fixes: 84ee19bffc93 ("mmc: core: Capture correct oemid-bits for eMMC cards")
Link: https://lkml.kernel.org/r/ZToJsSLHr8RnuTHz@codewreck.org
Link: https://lkml.kernel.org/r/CAPDyKFqkKibcXnwjnhc3+W1iJBHLeqQ9BpcZrSwhW2u9K2oUtg@mail.gmail.com
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Cc: stable@vger.kernel.org
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Alex Fetters <Alex.Fetters@garmin.com>
---
Here's the revert as discussed in "mmc: truncate quirks' oemid to 8
bits"' patch thread.
Feel free to ignore if you already have something, I just checked your
-next branch quickly and might have missed it.

 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 4a4bab9aa726..89cd48fcec79 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -104,7 +104,7 @@ static int mmc_decode_cid(struct mmc_card *card)
 	case 3: /* MMC v3.1 - v3.3 */
 	case 4: /* MMC v4 */
 		card->cid.manfid	= UNSTUFF_BITS(resp, 120, 8);
-		card->cid.oemid		= UNSTUFF_BITS(resp, 104, 8);
+		card->cid.oemid		= UNSTUFF_BITS(resp, 104, 16);
 		card->cid.prod_name[0]	= UNSTUFF_BITS(resp, 96, 8);
 		card->cid.prod_name[1]	= UNSTUFF_BITS(resp, 88, 8);
 		card->cid.prod_name[2]	= UNSTUFF_BITS(resp, 80, 8);
-- 
2.41.0


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

* RE: [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards"
  2023-11-03  0:42 [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards" Dominique Martinet
@ 2023-11-03  6:40 ` Avri Altman
  2023-11-03 11:16 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2023-11-03  6:40 UTC (permalink / raw)
  To: Dominique Martinet, Ulf Hansson
  Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dominique Martinet, stable@vger.kernel.org, Alex Fetters

> From: Dominique Martinet <dominique.martinet@atmark-techno.com>
> 
> This reverts commit 84ee19bffc9306128cd0f1c650e89767079efeff.
> 
> The commit above made quirks with an OEMID fail to be applied, as they
> were checking card->cid.oemid for the full 16 bits defined in MMC_FIXUP
> macros but the field would only contain the bottom 8 bits.
> 
> eMMC v5.1A might have bogus values in OEMID's higher bits so another fix
> will be made, but it has been decided to revert this until that is ready.
> 
> Fixes: 84ee19bffc93 ("mmc: core: Capture correct oemid-bits for eMMC
> cards")
> Link: https://lkml.kernel.org/r/ZToJsSLHr8RnuTHz@codewreck.org
> Link:
> https://lkml.kernel.org/r/CAPDyKFqkKibcXnwjnhc3+W1iJBHLeqQ9BpcZrSwh
> W2u9K2oUtg@mail.gmail.com
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-
> techno.com>
> Cc: stable@vger.kernel.org
> Cc: Avri Altman <avri.altman@wdc.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Alex Fetters <Alex.Fetters@garmin.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
> Here's the revert as discussed in "mmc: truncate quirks' oemid to 8 bits"'
> patch thread.
> Feel free to ignore if you already have something, I just checked your -next
> branch quickly and might have missed it.
> 
>  drivers/mmc/core/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> 4a4bab9aa726..89cd48fcec79 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -104,7 +104,7 @@ static int mmc_decode_cid(struct mmc_card *card)
>         case 3: /* MMC v3.1 - v3.3 */
>         case 4: /* MMC v4 */
>                 card->cid.manfid        = UNSTUFF_BITS(resp, 120, 8);
> -               card->cid.oemid         = UNSTUFF_BITS(resp, 104, 8);
> +               card->cid.oemid         = UNSTUFF_BITS(resp, 104, 16);
>                 card->cid.prod_name[0]  = UNSTUFF_BITS(resp, 96, 8);
>                 card->cid.prod_name[1]  = UNSTUFF_BITS(resp, 88, 8);
>                 card->cid.prod_name[2]  = UNSTUFF_BITS(resp, 80, 8);
> --
> 2.41.0


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

* Re: [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards"
  2023-11-03  0:42 [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards" Dominique Martinet
  2023-11-03  6:40 ` Avri Altman
@ 2023-11-03 11:16 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2023-11-03 11:16 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: linux-mmc, linux-kernel, Dominique Martinet, stable, Avri Altman,
	Alex Fetters

On Fri, 3 Nov 2023 at 01:42, Dominique Martinet <asmadeus@codewreck.org> wrote:
>
> From: Dominique Martinet <dominique.martinet@atmark-techno.com>
>
> This reverts commit 84ee19bffc9306128cd0f1c650e89767079efeff.
>
> The commit above made quirks with an OEMID fail to be applied, as they
> were checking card->cid.oemid for the full 16 bits defined in MMC_FIXUP
> macros but the field would only contain the bottom 8 bits.
>
> eMMC v5.1A might have bogus values in OEMID's higher bits so another fix
> will be made, but it has been decided to revert this until that is ready.
>
> Fixes: 84ee19bffc93 ("mmc: core: Capture correct oemid-bits for eMMC cards")
> Link: https://lkml.kernel.org/r/ZToJsSLHr8RnuTHz@codewreck.org
> Link: https://lkml.kernel.org/r/CAPDyKFqkKibcXnwjnhc3+W1iJBHLeqQ9BpcZrSwhW2u9K2oUtg@mail.gmail.com
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> Cc: stable@vger.kernel.org
> Cc: Avri Altman <avri.altman@wdc.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Alex Fetters <Alex.Fetters@garmin.com>

Applied for fixes, thanks!

Kind regards
Uffe


> ---
> Here's the revert as discussed in "mmc: truncate quirks' oemid to 8
> bits"' patch thread.
> Feel free to ignore if you already have something, I just checked your
> -next branch quickly and might have missed it.
>
>  drivers/mmc/core/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 4a4bab9aa726..89cd48fcec79 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -104,7 +104,7 @@ static int mmc_decode_cid(struct mmc_card *card)
>         case 3: /* MMC v3.1 - v3.3 */
>         case 4: /* MMC v4 */
>                 card->cid.manfid        = UNSTUFF_BITS(resp, 120, 8);
> -               card->cid.oemid         = UNSTUFF_BITS(resp, 104, 8);
> +               card->cid.oemid         = UNSTUFF_BITS(resp, 104, 16);
>                 card->cid.prod_name[0]  = UNSTUFF_BITS(resp, 96, 8);
>                 card->cid.prod_name[1]  = UNSTUFF_BITS(resp, 88, 8);
>                 card->cid.prod_name[2]  = UNSTUFF_BITS(resp, 80, 8);
> --
> 2.41.0
>

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

end of thread, other threads:[~2023-11-03 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03  0:42 [PATCH] Revert "mmc: core: Capture correct oemid-bits for eMMC cards" Dominique Martinet
2023-11-03  6:40 ` Avri Altman
2023-11-03 11:16 ` Ulf Hansson

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