public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support
@ 2026-03-03 10:50 ziniu.wang_1
  2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: ziniu.wang_1 @ 2026-03-03 10:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

From: Luke Wang <ziniu.wang_1@nxp.com>

This series adds 1-bit bus width support for sdhci-esdhc-imx driver.

Currently sdhci-esdhc-imx doesn't support 1-bit width because it
doesn't call sdhci_get_property() to parse "bus-width = <1>" and
set SDHCI_QUIRK_FORCE_1_BIT_DATA quirk.

After adding sdhci_get_property(), another issue is exposed:
mmc_select_hs200() returns 0 without switching when 1-bit bus is
used, causing mmc_select_timing() to skip mmc_select_hs(). This
leaves eMMC in legacy mode (26MHz) instead of High Speed (52MHz).

Fix by dropping incompatible UHS/DDR/HS200/HS400 caps in
sdhci_setup_host() for 1-bit width, and clean up duplicate code now
handled by common framework.

Luke Wang (4):
  mmc: sdhci: fix timing selection for 1-bit bus width
  mmc: sdhci-esdhc-imx: add 1-bit bus width support
  mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation
  mmc: sdhci-pltfm: remove duplicate DTS property parsing
---
Changes in v2:
- Moved fix from mmc_validate_host_caps() to sdhci_setup_host()
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 6 +-----
 drivers/mmc/host/sdhci-pltfm.c     | 7 -------
 drivers/mmc/host/sdhci.c           | 8 +++++++-
 3 files changed, 8 insertions(+), 13 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width
  2026-03-03 10:50 [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
@ 2026-03-03 10:50 ` ziniu.wang_1
  2026-03-03 21:00   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  2026-03-03 10:50 ` [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: ziniu.wang_1 @ 2026-03-03 10:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

From: Luke Wang <ziniu.wang_1@nxp.com>

When 1-bit bus width is used with HS200/HS400 capabilities set,
mmc_select_hs200() returns 0 without actually switching. This
causes mmc_select_timing() to skip mmc_select_hs(), leaving eMMC
in legacy mode (26MHz) instead of High Speed SDR (52MHz).

Per JEDEC eMMC spec section 5.3.2, 1-bit mode supports High Speed
SDR. Drop incompatible HS200/HS400/UHS/DDR caps early so timing
selection falls through to mmc_select_hs() correctly.

Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
---
 drivers/mmc/host/sdhci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index b1a3cd574c84..3e163f14a640 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -4539,8 +4539,14 @@ int sdhci_setup_host(struct sdhci_host *host)
 	 * their platform code before calling sdhci_add_host(), and we
 	 * won't assume 8-bit width for hosts without that CAP.
 	 */
-	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
+	if (host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA) {
+		host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
+				 SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_HS400);
+		mmc->caps2 &= ~(MMC_CAP2_HS200 | MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
+		mmc->caps &= ~(MMC_CAP_DDR | MMC_CAP_UHS);
+	} else {
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
+	}
 
 	if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
 		mmc->caps &= ~MMC_CAP_CMD23;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support
  2026-03-03 10:50 [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
  2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
@ 2026-03-03 10:50 ` ziniu.wang_1
  2026-03-03 21:00   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  2026-03-03 10:50 ` [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation ziniu.wang_1
  2026-03-03 10:50 ` [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing ziniu.wang_1
  3 siblings, 2 replies; 14+ messages in thread
From: ziniu.wang_1 @ 2026-03-03 10:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

From: Luke Wang <ziniu.wang_1@nxp.com>

Add sdhci_get_property() call to parse common SDHCI DT properties,
including "bus-width = <1>" which sets SDHCI_QUIRK_FORCE_1_BIT_DATA
quirk for 1-bit data bus width configuration.

Remove the duplicate "no-1-8-v" property parsing since
sdhci_get_property() already handles it.

Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 97461e20425d..b607d4ffc562 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1813,8 +1813,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 
 	of_property_read_u32(np, "fsl,strobe-dll-delay-target",
 				&boarddata->strobe_dll_delay_target);
-	if (of_property_read_bool(np, "no-1-8-v"))
-		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
 
 	if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
 		boarddata->delay_line = 0;
@@ -1833,6 +1831,8 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 	if (ret)
 		return ret;
 
+	sdhci_get_property(pdev);
+
 	/* HS400/HS400ES require 8 bit bus */
 	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
 		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation
  2026-03-03 10:50 [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
  2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
  2026-03-03 10:50 ` [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
@ 2026-03-03 10:50 ` ziniu.wang_1
  2026-03-03 21:01   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  2026-03-03 10:50 ` [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing ziniu.wang_1
  3 siblings, 2 replies; 14+ messages in thread
From: ziniu.wang_1 @ 2026-03-03 10:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

From: Luke Wang <ziniu.wang_1@nxp.com>

mmc_validate_host_caps() already validates that HS400/HS400ES requires
8-bit bus width. Remove the duplicate validation.

Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index b607d4ffc562..d49069986efc 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1833,10 +1833,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 
 	sdhci_get_property(pdev);
 
-	/* HS400/HS400ES require 8 bit bus */
-	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
-		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
-
 	if (mmc_gpio_get_cd(host->mmc) >= 0)
 		host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
  2026-03-03 10:50 [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
                   ` (2 preceding siblings ...)
  2026-03-03 10:50 ` [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation ziniu.wang_1
@ 2026-03-03 10:50 ` ziniu.wang_1
  2026-03-03 21:01   ` Frank Li
  2026-03-11  9:08   ` Adrian Hunter
  3 siblings, 2 replies; 14+ messages in thread
From: ziniu.wang_1 @ 2026-03-03 10:50 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

From: Luke Wang <ziniu.wang_1@nxp.com>

The "keep-power-in-suspend", "wakeup-source" and "enable-sdio-wakeup"
properties are already parsed in mmc_of_parse(). All sdhci drivers that
call sdhci_get_property() also call mmc_of_parse(). The only exception
is sdhci-of-hlwd, which does not call mmc_of_parse(), but its devicetree
does not use these properties anyway.

Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
---
 drivers/mmc/host/sdhci-pltfm.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index d4fb60c1ef69..933fafe0a0ef 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -95,13 +95,6 @@ void sdhci_get_property(struct platform_device *pdev)
 	sdhci_get_compatibility(pdev);
 
 	device_property_read_u32(dev, "clock-frequency", &pltfm_host->clock);
-
-	if (device_property_present(dev, "keep-power-in-suspend"))
-		host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
-
-	if (device_property_read_bool(dev, "wakeup-source") ||
-	    device_property_read_bool(dev, "enable-sdio-wakeup")) /* legacy */
-		host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
 }
 EXPORT_SYMBOL_GPL(sdhci_get_property);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width
  2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
@ 2026-03-03 21:00   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Frank Li @ 2026-03-03 21:00 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank Li, Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc,
	s32, linux-arm-kernel, linux-kernel

From: Frank Li (AI-BOT) <frank.li@nxp.com>

Subject: Re: [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width

> -	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
> +	if (host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA) {
> +		host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
> +				 SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_HS400);
> +		mmc->caps2 &= ~(MMC_CAP2_HS200 | MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
> +		mmc->caps &= ~(MMC_CAP_DDR | MMC_CAP_UHS);
> +	} else {
>  		mmc->caps |= MMC_CAP_4_BIT_DATA;
> +	}

The logic inversion here is correct and the fix addresses the root cause
per JEDEC spec. However, consider whether clearing MMC_CAP_UHS is
necessary—UHS modes require 4-bit width anyway, so this may be redundant
with the SDR104/SDR50/DDR50 clears. If intentional for belt-and-suspenders
safety, add a brief comment explaining why.

Also verify that mmc pointer is always valid at this point in
sdhci_setup_host(). If there's any path where mmc could be NULL, the
new code will crash.

AI bot review and may be useless.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support
  2026-03-03 10:50 ` [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
@ 2026-03-03 21:00   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Frank Li @ 2026-03-03 21:00 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank Li, Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc,
	s32, linux-arm-kernel, linux-kernel

From: Frank Li (AI-BOT) <frank.li@nxp.com>

> +	sdhci_get_property(pdev);
> +

Missing argument: sdhci_get_property() expects (struct sdhci_host *host)
as second parameter, not just pdev. Check function signature in
sdhci.h.

> -	if (of_property_read_bool(np, "no-1-8-v"))
> -		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Removal looks correct if sdhci_get_property() truly handles "no-1-8-v"
internally. Verify this is documented in the commit message or code
comment to avoid future confusion.

> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> index 97461e20425d..b607d4ffc562 100644

Line length at hunk context appears OK (under 80 chars).

---

AI bot review and may be useless.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation
  2026-03-03 10:50 ` [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation ziniu.wang_1
@ 2026-03-03 21:01   ` Frank Li
  2026-03-11  9:05   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Frank Li @ 2026-03-03 21:01 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank Li, Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc,
	s32, linux-arm-kernel, linux-kernel

From: Frank Li (AI-BOT) <frank.li@nxp.com>

AI bot review and may be useless.

The patch looks correct. The removal of duplicate validation is justified by
the commit message stating that mmc_validate_host_caps() already performs
this check.

A few observations:

> -	/* HS400/HS400ES require 8 bit bus */
> -	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
> -		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
> -

Consider verifying in a follow-up that mmc_validate_host_caps() is indeed
called after sdhci_get_property() in the probe flow, to ensure no window
exists where invalid caps could be exposed to userspace or other subsystems.

The code removal itself is clean with no resource leaks or locking issues in
the deleted section.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
  2026-03-03 10:50 ` [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing ziniu.wang_1
@ 2026-03-03 21:01   ` Frank Li
  2026-03-11  9:08   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Frank Li @ 2026-03-03 21:01 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, haibo.chen
  Cc: Frank Li, Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc,
	s32, linux-arm-kernel, linux-kernel

From: Frank Li (AI-BOT) <frank.li@nxp.com>

AI bot review and may be useless.

The patch looks reasonable. The commit message correctly identifies that
mmc_of_parse() already handles these three properties, and the analysis
that all callers of sdhci_get_property() also invoke mmc_of_parse()
(except sdhci-of-hlwd, which doesn't use them) is sound.

However, the commit message should explicitly state *where* these
properties are parsed in mmc_of_parse(). A reader should be able to
verify the claim by grepping drivers/mmc/core/host.c without guessing.

Also, the claim about sdhci-of-hlwd deserves a quick verification: does
its devicetree binding documentation confirm these properties are unused?
If so, mention the file path in the commit message for future
maintainers.

The code deletion itself is correct—no resource leaks or logic errors.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width
  2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
  2026-03-03 21:00   ` Frank Li
@ 2026-03-11  9:05   ` Adrian Hunter
  2026-03-11  9:19     ` [EXT] " Luke Wang
  1 sibling, 1 reply; 14+ messages in thread
From: Adrian Hunter @ 2026-03-11  9:05 UTC (permalink / raw)
  To: ziniu.wang_1, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> From: Luke Wang <ziniu.wang_1@nxp.com>
> 
> When 1-bit bus width is used with HS200/HS400 capabilities set,
> mmc_select_hs200() returns 0 without actually switching. This
> causes mmc_select_timing() to skip mmc_select_hs(), leaving eMMC
> in legacy mode (26MHz) instead of High Speed SDR (52MHz).
> 
> Per JEDEC eMMC spec section 5.3.2, 1-bit mode supports High Speed
> SDR. Drop incompatible HS200/HS400/UHS/DDR caps early so timing
> selection falls through to mmc_select_hs() correctly.
> 

Fixes: f2119df6b7646 ("mmc: sd: add support for signal voltage switch procedure")

> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> ---
>  drivers/mmc/host/sdhci.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index b1a3cd574c84..3e163f14a640 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -4539,8 +4539,14 @@ int sdhci_setup_host(struct sdhci_host *host)
>  	 * their platform code before calling sdhci_add_host(), and we
>  	 * won't assume 8-bit width for hosts without that CAP.
>  	 */
> -	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
> +	if (host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA) {
> +		host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
> +				 SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_HS400);

SDHCI_SUPPORT_HS400 is non-standard.  Hence the check for
SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 is needed:

		host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50);
		if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400)
			host->caps1 &= ~SDHCI_SUPPORT_HS400;

> +		mmc->caps2 &= ~(MMC_CAP2_HS200 | MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
> +		mmc->caps &= ~(MMC_CAP_DDR | MMC_CAP_UHS);
> +	} else {
>  		mmc->caps |= MMC_CAP_4_BIT_DATA;
> +	}
>  
>  	if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
>  		mmc->caps &= ~MMC_CAP_CMD23;



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support
  2026-03-03 10:50 ` [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
  2026-03-03 21:00   ` Frank Li
@ 2026-03-11  9:05   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Adrian Hunter @ 2026-03-11  9:05 UTC (permalink / raw)
  To: ziniu.wang_1, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> From: Luke Wang <ziniu.wang_1@nxp.com>
> 
> Add sdhci_get_property() call to parse common SDHCI DT properties,
> including "bus-width = <1>" which sets SDHCI_QUIRK_FORCE_1_BIT_DATA
> quirk for 1-bit data bus width configuration.
> 
> Remove the duplicate "no-1-8-v" property parsing since
> sdhci_get_property() already handles it.
> 
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 97461e20425d..b607d4ffc562 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1813,8 +1813,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>  
>  	of_property_read_u32(np, "fsl,strobe-dll-delay-target",
>  				&boarddata->strobe_dll_delay_target);
> -	if (of_property_read_bool(np, "no-1-8-v"))
> -		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
>  
>  	if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
>  		boarddata->delay_line = 0;
> @@ -1833,6 +1831,8 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>  	if (ret)
>  		return ret;
>  
> +	sdhci_get_property(pdev);
> +
>  	/* HS400/HS400ES require 8 bit bus */
>  	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
>  		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation
  2026-03-03 10:50 ` [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation ziniu.wang_1
  2026-03-03 21:01   ` Frank Li
@ 2026-03-11  9:05   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Adrian Hunter @ 2026-03-11  9:05 UTC (permalink / raw)
  To: ziniu.wang_1, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> From: Luke Wang <ziniu.wang_1@nxp.com>
> 
> mmc_validate_host_caps() already validates that HS400/HS400ES requires
> 8-bit bus width. Remove the duplicate validation.
> 
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index b607d4ffc562..d49069986efc 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1833,10 +1833,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>  
>  	sdhci_get_property(pdev);
>  
> -	/* HS400/HS400ES require 8 bit bus */
> -	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
> -		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
> -
>  	if (mmc_gpio_get_cd(host->mmc) >= 0)
>  		host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
>  



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
  2026-03-03 10:50 ` [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing ziniu.wang_1
  2026-03-03 21:01   ` Frank Li
@ 2026-03-11  9:08   ` Adrian Hunter
  1 sibling, 0 replies; 14+ messages in thread
From: Adrian Hunter @ 2026-03-11  9:08 UTC (permalink / raw)
  To: ziniu.wang_1, ulf.hansson, haibo.chen
  Cc: Frank.Li, s.hauer, kernel, festevam, imx, linux-mmc, s32,
	linux-arm-kernel, linux-kernel

On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> From: Luke Wang <ziniu.wang_1@nxp.com>
> 
> The "keep-power-in-suspend", "wakeup-source" and "enable-sdio-wakeup"
> properties are already parsed in mmc_of_parse(). All sdhci drivers that
> call sdhci_get_property() also call mmc_of_parse(). The only exception
> is sdhci-of-hlwd, which does not call mmc_of_parse(), but its devicetree
> does not use these properties anyway.
> 
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-pltfm.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index d4fb60c1ef69..933fafe0a0ef 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -95,13 +95,6 @@ void sdhci_get_property(struct platform_device *pdev)
>  	sdhci_get_compatibility(pdev);
>  
>  	device_property_read_u32(dev, "clock-frequency", &pltfm_host->clock);
> -
> -	if (device_property_present(dev, "keep-power-in-suspend"))
> -		host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
> -
> -	if (device_property_read_bool(dev, "wakeup-source") ||
> -	    device_property_read_bool(dev, "enable-sdio-wakeup")) /* legacy */
> -		host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
>  }
>  EXPORT_SYMBOL_GPL(sdhci_get_property);
>  



^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [EXT] Re: [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width
  2026-03-11  9:05   ` Adrian Hunter
@ 2026-03-11  9:19     ` Luke Wang
  0 siblings, 0 replies; 14+ messages in thread
From: Luke Wang @ 2026-03-11  9:19 UTC (permalink / raw)
  To: Adrian Hunter, ulf.hansson@linaro.org, Bough Chen
  Cc: Frank Li, s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, imx@lists.linux.dev,
	linux-mmc@vger.kernel.org, dl-S32,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Adrian Hunter <adrian.hunter@intel.com>
> Sent: Wednesday, March 11, 2026 5:05 PM
> To: Luke Wang <ziniu.wang_1@nxp.com>; ulf.hansson@linaro.org; Bough
> Chen <haibo.chen@nxp.com>
> Cc: Frank Li <frank.li@nxp.com>; s.hauer@pengutronix.de;
> kernel@pengutronix.de; festevam@gmail.com; imx@lists.linux.dev; linux-
> mmc@vger.kernel.org; dl-S32 <S32@nxp.com>; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: [EXT] Re: [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit
> bus width
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> > From: Luke Wang <ziniu.wang_1@nxp.com>
> >
> > When 1-bit bus width is used with HS200/HS400 capabilities set,
> > mmc_select_hs200() returns 0 without actually switching. This
> > causes mmc_select_timing() to skip mmc_select_hs(), leaving eMMC
> > in legacy mode (26MHz) instead of High Speed SDR (52MHz).
> >
> > Per JEDEC eMMC spec section 5.3.2, 1-bit mode supports High Speed
> > SDR. Drop incompatible HS200/HS400/UHS/DDR caps early so timing
> > selection falls through to mmc_select_hs() correctly.
> >
> 
> Fixes: f2119df6b7646 ("mmc: sd: add support for signal voltage switch
> procedure")
> 
> > Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> > ---
> >  drivers/mmc/host/sdhci.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index b1a3cd574c84..3e163f14a640 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -4539,8 +4539,14 @@ int sdhci_setup_host(struct sdhci_host *host)
> >        * their platform code before calling sdhci_add_host(), and we
> >        * won't assume 8-bit width for hosts without that CAP.
> >        */
> > -     if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
> > +     if (host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA) {
> > +             host->caps1 &= ~(SDHCI_SUPPORT_SDR104 |
> SDHCI_SUPPORT_SDR50 |
> > +                              SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_HS400);
> 
> SDHCI_SUPPORT_HS400 is non-standard.  Hence the check for
> SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 is needed:

Got it, thanks for the explanation. I'll keep the check in v3.

> 
>                 host->caps1 &= ~(SDHCI_SUPPORT_SDR104 |
> SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50);
>                 if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400)
>                         host->caps1 &= ~SDHCI_SUPPORT_HS400;
> 
> > +             mmc->caps2 &= ~(MMC_CAP2_HS200 | MMC_CAP2_HS400 |
> MMC_CAP2_HS400_ES);
> > +             mmc->caps &= ~(MMC_CAP_DDR | MMC_CAP_UHS);
> > +     } else {
> >               mmc->caps |= MMC_CAP_4_BIT_DATA;
> > +     }
> >
> >       if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
> >               mmc->caps &= ~MMC_CAP_CMD23;


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-03-11  9:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 10:50 [PATCH v2 0/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
2026-03-03 10:50 ` [PATCH v2 1/4] mmc: sdhci: fix timing selection for 1-bit bus width ziniu.wang_1
2026-03-03 21:00   ` Frank Li
2026-03-11  9:05   ` Adrian Hunter
2026-03-11  9:19     ` [EXT] " Luke Wang
2026-03-03 10:50 ` [PATCH v2 2/4] mmc: sdhci-esdhc-imx: add 1-bit bus width support ziniu.wang_1
2026-03-03 21:00   ` Frank Li
2026-03-11  9:05   ` Adrian Hunter
2026-03-03 10:50 ` [PATCH v2 3/4] mmc: sdhci-esdhc-imx: remove duplicate HS400 bus width validation ziniu.wang_1
2026-03-03 21:01   ` Frank Li
2026-03-11  9:05   ` Adrian Hunter
2026-03-03 10:50 ` [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing ziniu.wang_1
2026-03-03 21:01   ` Frank Li
2026-03-11  9:08   ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox