Thread (7 messages) 7 messages, 2 authors, 2020-03-09

Re: [PATCH 1/4] [1/4] mmc: core: expose MMC_CAP2_CQE* to dt

From: Linus Walleij <hidden>
Date: 2020-02-21 14:34:14
Also in: linux-devicetree, linux-mediatek, linux-mmc, lkml

On Mon, Feb 17, 2020 at 7:32 AM Chun-Hung Wu [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Expose MMC_CAP2_CQE and MMC_CAP2_CQE_DCMD
to host->caps2 if
1. "supports-cqe" is defined in dt and
2. "disable-cqe-dcmd" is not defined in dt.

---
 drivers/mmc/core/host.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 105b7a7..efb0dbe 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -319,6 +319,14 @@ int mmc_of_parse(struct mmc_host *host)
                host->caps2 |= MMC_CAP2_NO_SD;
        if (device_property_read_bool(dev, "no-mmc"))
                host->caps2 |= MMC_CAP2_NO_MMC;
+       if (device_property_read_bool(dev, "supports-cqe"))
+               host->caps2 |= MMC_CAP2_CQE;
I don't understand why this is even a DT property as it should
be clear from the hosts compatible whether it supports CQE or
not. But it's too late to do anything about that I suppose, and
I just assume there is something I don't understand here.
+       /* Must be after "supports-cqe" check */
+       if (!device_property_read_bool(dev, "disable-cqe-dcmd")) {
+               if (host->caps2 & MMC_CAP2_CQE)
+                       host->caps2 |= MMC_CAP2_CQE_DCMD;
+       }
This is the right place to do this I suppose. Disabling CQE
selectively is something you might wanna do for debugging.
Acked-by: Linus Walleij <redacted>

I see that some drivers are already parsing this DT property
on their own, should we follow up with patches so that these:

$ git grep 'supports-cqe'
drivers/mmc/host/sdhci-brcmstb.c:       if
(device_property_read_bool(&pdev->dev, "supports-cqe")) {
drivers/mmc/host/sdhci-msm.c:   if (of_property_read_bool(node, "supports-cqe"))
drivers/mmc/host/sdhci-tegra.c: if
(device_property_read_bool(host->mmc->parent, "supports-cqe"))

Make use of the central parsing instead?

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help