public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Avri Altman <avri.altman@wdc.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org, Alex Fetters <Alex.Fetters@garmin.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] mmc: Capture correct oemid
Date: Thu, 26 Oct 2023 15:39:45 +0900	[thread overview]
Message-ID: <ZToJsSLHr8RnuTHz@codewreck.org> (raw)
In-Reply-To: <20230927071500.1791882-1-avri.altman@wdc.com>

[note this has been applied to all -stable branches as well -- sorry for
noticing this after explicitly testing the 5.10.199-rc1...]

Avri Altman wrote on Wed, Sep 27, 2023 at 10:15:00AM +0300:
> It is important to fix it because we are using it as one of our quirk's
> token, as well as other tools, e.g. the LVFS
> (https://github.com/fwupd/fwupd/)

On the other hand there are many quirks in drivers/mmc/core/quirks.h
that relied on the value being a short -- I noticed because our MMC
started to show some hangs that were worked around in a quirk that is
apparently no longer applied.

Unfortunately almost none of these are using defines so it's stray 0x100
0x5048 0x200 .. in MMC_FIXUP (3rd arg is oemid), so it'll be difficult
to fix -- especially as embedded downstreams often add their own quirks
and you can't fix that for them.

I'd suggest something like this instead:
-------
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index 1e14cc69e0ab..892a5bba36ec 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -189,7 +189,7 @@ static inline void mmc_fixup_device(struct mmc_card *card,
 		if ((f->manfid == CID_MANFID_ANY ||
 		     f->manfid == card->cid.manfid) &&
 		    (f->oemid == CID_OEMID_ANY ||
-		     f->oemid == card->cid.oemid) &&
+		     (f->oemid & 0xff) == (card->cid.oemid & 0xff)) &&
 		    (f->name == CID_NAME_ANY ||
 		     !strncmp(f->name, card->cid.prod_name,
 			      sizeof(card->cid.prod_name))) &&
-------
(whether to mask cid.oemid or not is up for debate, but that leaves less
room for error)

I'm testing this right now for our board, will submit as a proper patch
later today if it works -- but feel free to comment first.
Missing quirks on certain sd/mmc can cause some trouble so might want to
revert this patch on stable kernels unless there's immediate agreement
on this patch

Thanks,
-- 
Dominique Martinet | Asmadeus

      parent reply	other threads:[~2023-10-26  6:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  7:15 [PATCH v2] mmc: Capture correct oemid Avri Altman
2023-09-27 10:40 ` Ulf Hansson
2023-10-26  6:39 ` Dominique Martinet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZToJsSLHr8RnuTHz@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=Alex.Fetters@garmin.com \
    --cc=avri.altman@wdc.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox