Re: [PATCH v5 1/5] mmc: core: Extend mmc_of_parse() to parse CQE bindings

From: Veerabhadrarao Badiganti
Date: Wed May 06 2020 - 09:01:04 EST



On 4/28/2020 5:26 AM, Chun-Hung Wu wrote:
Parse CQE bindings "supports-cqe" and "disable-cqe-dcmd"
in mmc_of_parse().

Signed-off-by: Chun-Hung Wu <chun-hung.wu@xxxxxxxxxxxx>
---
drivers/mmc/core/host.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index c876872..47521c6 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -302,6 +302,11 @@ 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;

This change is breaking emmc driver on qcom platforms where this dt property is defined.

[ÂÂÂ 1.543453]Â cqhci_deactivate+0xc/0x38
[ÂÂÂ 1.545627]Â sdhci_msm_reset+0x40/0x58
[ÂÂÂ 1.549447]Â sdhci_do_reset+0x48/0x7c
[ÂÂÂ 1.553180]Â __sdhci_read_caps+0x7c/0x214
[ÂÂÂ 1.556913]Â sdhci_setup_host+0x58/0xce8
[ÂÂÂ 1.560905]Â sdhci_msm_probe+0x588/0x8a4
[ÂÂÂ 1.564900]Â platform_drv_probe+0x4c/0xb0

So, we cant have this flag defined before sdhci_setup_host().

I will have to clear this cap and re-enable it in our initialization.

+ if (!device_property_read_bool(dev, "disable-cqe-dcmd")) {
+ host->caps2 |= MMC_CAP2_CQE_DCMD;
+ }
/* Must be after "non-removable" check */
if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) == 0) {