Re: [PATCH v2] mmc: Capture correct oemid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux