lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220111171424.862764-2-Jerome.Pouiller@silabs.com>
Date:   Tue, 11 Jan 2022 18:14:01 +0100
From:   Jerome Pouiller <Jerome.Pouiller@...abs.com>
To:     linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        Kalle Valo <kvalo@...eaurora.org>
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "David S . Miller" <davem@...emloft.net>,
        devicetree@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
        linux-mmc@...r.kernel.org,
        Pali Rohár <pali@...nel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Jérôme Pouiller 
        <jerome.pouiller@...abs.com>
Subject: [PATCH v9 01/24] mmc: sdio: add SDIO IDs for Silabs WF200 chip

From: Jérôme Pouiller <jerome.pouiller@...abs.com>

Note that the values used by Silabs are uncommon. A driver cannot fully
rely on the SDIO PnP. It should also check if the device is declared in
the DT.

So, to apply the quirks necessary for the Silabs WF200, we rely on the
DT rather than on the SDIO VID/PID.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
 drivers/mmc/core/quirks.h    | 5 +++++
 include/linux/mmc/sdio_ids.h | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index 20f568727277..f879dc63d936 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -149,6 +149,11 @@ static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = {
 static const struct mmc_fixup __maybe_unused sdio_card_init_methods[] = {
 	SDIO_FIXUP_COMPATIBLE("ti,wl1251", wl1251_quirk, 0),
 
+	SDIO_FIXUP_COMPATIBLE("silabs,wf200", add_quirk,
+			      MMC_QUIRK_BROKEN_BYTE_MODE_512 |
+			      MMC_QUIRK_LENIENT_FN0 |
+			      MMC_QUIRK_BLKSZ_FOR_BYTE_MODE),
+
 	END_FIXUP
 };
 
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index a85c9f0bd470..483692f3002a 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -25,6 +25,13 @@
  * Vendors and devices.  Sort key: vendor first, device next.
  */
 
+/*
+ * Silabs does not use a reliable vendor ID. To avoid conflicts, the driver
+ * won't probe the device if it is not also declared in the DT.
+ */
+#define SDIO_VENDOR_ID_SILABS			0x0000
+#define SDIO_DEVICE_ID_SILABS_WF200		0x1000
+
 #define SDIO_VENDOR_ID_STE			0x0020
 #define SDIO_DEVICE_ID_STE_CW1200		0x2280
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ