Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] mmc: sdhci-at550: non-real identity in Signed-off-by trailer
- [Low] mmc: sdhci-at550: duplicated sdhci-pltfm helpers and premature
caps check
--
commit 9cd2cf298aedb4fdaa50a3e4221492eb7dc0dfa9
Author: yy-Local-LLM [off-list ref]
mmc: sdhci: add SiRF AT550 programmed-I/O support
Add a platform SDHCI host with PIO because CPU-to-controller DMA address
translation has not been validated. Reject unsupported
capability/version combinations and use the current managed host
allocation API. Board discovery and frequency restrictions are described
by the DT, rather than forcing removable-SD policy in the controller
driver.
Signed-off-by: yy-Local-LLM <redacted>
[Severity: High]
The Author header and Signed-off-by trailer use "yy-Local-LLM", which is a
handle or LLM identifier rather than a real person's full name as required
by the Developer's Certificate of Origin in
Documentation/process/submitting-patches.rst.
quoted hunk ↗ jump to hunk
diff --git a/drivers/mmc/host/sdhci-at550.c b/drivers/mmc/host/sdhci-at550.c
new file mode 100644
index 0000000000000..100a0fdb2b106
--- /dev/null
+++ b/drivers/mmc/host/sdhci-at550.c
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Standard SDHCI PIO only: do not assume CPU/PCI DMA address equivalence. */
+#include <linux/module.h>
+#include <linux/mmc/host.h>
+#include <linux/platform_device.h>
+#include "sdhci-pltfm.h"
+static const struct sdhci_ops at550_sdhci_ops = {
+ .set_clock = sdhci_set_clock,
+ .set_bus_width = sdhci_set_bus_width,
+ .reset = sdhci_reset,
+ .set_uhs_signaling = sdhci_set_uhs_signaling,
+};
+static const struct sdhci_pltfm_data at550_sdhci_data = {
+ .ops = &at550_sdhci_ops,
+ .quirks = SDHCI_QUIRK_BROKEN_DMA | SDHCI_QUIRK_BROKEN_ADMA,
+ .quirks2 = SDHCI_QUIRK2_NO_1_8_V,
+};
+static int at550_sdhci_probe(struct platform_device *pdev)
+{
+ struct sdhci_host *host;
+ u32 caps;
+ int ret;
+
+ host = sdhci_pltfm_init(pdev, &at550_sdhci_data, 0);
+ if (IS_ERR(host))
+ return PTR_ERR(host);
+ caps = sdhci_readl(host, SDHCI_CAPABILITIES);
+ if ((sdhci_readw(host, SDHCI_HOST_VERSION) & SDHCI_SPEC_VER_MASK) >
+ SDHCI_SPEC_200 || !(caps & SDHCI_CLOCK_BASE_MASK)) {
+ ret = -ENODEV;
+ return ret;
+ }
+ ret = mmc_of_parse(host->mmc);
+ if (ret)
+ return ret;
+ sdhci_get_property(pdev);
+ ret = sdhci_add_host(host);
+ if (!ret)
+ return 0;
+ return ret;
+}
+static void at550_sdhci_remove(struct platform_device *pdev)
+{
+ sdhci_pltfm_remove(pdev);
+}
[Severity: Low]
Does at550_sdhci_probe() need to read SDHCI_CAPABILITIES and
SDHCI_HOST_VERSION here? This runs before sdhci_add_host() ->
sdhci_setup_host() -> __sdhci_read_caps() resets the controller and applies
the sdhci-caps-mask and sdhci-caps device tree overrides, and
sdhci_setup_host() already rejects a zero base clock when
SDHCI_CLOCK_BASE_MASK is clear.
Also, at550_sdhci_ops is identical to sdhci_pltfm_ops, which
sdhci_pltfm_init() sets automatically when pdata->ops is NULL, and
sdhci_pltfm_remove can be assigned directly to at550_sdhci_driver.remove
without the at550_sdhci_remove() wrapper.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117-at550-rfc-v1-v1-0-5879573cb825@gmail.com?part=5