mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards
@ 2026-09-01  0:38 Rosen Penev
  2026-09-09  7:15 ` Adrian Hunter
  2026-09-11 15:40 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-09-01  0:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: Adrian Hunter, Ulf Hansson, open list

The SDIO3 Configuration register branch of pxav3_set_uhs_signaling()
only clears the clock-inversion and feedback-clock bits for
MMC_TIMING_MMC_HS.  As a result, MMC_TIMING_SD_HS (ordinary SD High
Speed) falls through to the default case, which sets SDIO3_CONF_CLK_INV
and leaves the feedback clock cleared.

According to erratum FE-2946959, clock inversion is only needed for
slow frequencies when the card hold-time requirement is high and is not
required nor desirable for high-speed modes.  SD High Speed runs at 50
MHz, so the same timing argument that applies to MMC High Speed holds.
Treat MMC_TIMING_SD_HS the same as MMC_TIMING_MMC_HS and clear the
clock-inversion and feedback-clock bits for both.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/mmc/host/sdhci-pxav3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index db9dfa92cb57..9e6703e005e2 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
 		    uhs == MMC_TIMING_UHS_DDR50) {
 			reg_val &= ~SDIO3_CONF_CLK_INV;
 			reg_val |= SDIO3_CONF_SD_FB_CLK;
-		} else if (uhs == MMC_TIMING_MMC_HS) {
+		} else if (uhs == MMC_TIMING_MMC_HS ||
+			   uhs == MMC_TIMING_SD_HS) {
 			reg_val &= ~SDIO3_CONF_CLK_INV;
 			reg_val &= ~SDIO3_CONF_SD_FB_CLK;
 		} else {
-- 
2.55.0


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

* Re: [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards
  2026-09-01  0:38 [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards Rosen Penev
@ 2026-09-09  7:15 ` Adrian Hunter
  2026-09-11 15:40 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2026-09-09  7:15 UTC (permalink / raw)
  To: Rosen Penev, linux-mmc
  Cc: Ulf Hansson, open list, Karel Balej, Duje Mihanović

On 01/09/2026 03:38, Rosen Penev wrote:
> The SDIO3 Configuration register branch of pxav3_set_uhs_signaling()
> only clears the clock-inversion and feedback-clock bits for
> MMC_TIMING_MMC_HS.  As a result, MMC_TIMING_SD_HS (ordinary SD High
> Speed) falls through to the default case, which sets SDIO3_CONF_CLK_INV
> and leaves the feedback clock cleared.
> 
> According to erratum FE-2946959, clock inversion is only needed for
> slow frequencies when the card hold-time requirement is high and is not
> required nor desirable for high-speed modes.  SD High Speed runs at 50
> MHz, so the same timing argument that applies to MMC High Speed holds.
> Treat MMC_TIMING_SD_HS the same as MMC_TIMING_MMC_HS and clear the
> clock-inversion and feedback-clock bits for both.
> 
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

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

> ---
>  drivers/mmc/host/sdhci-pxav3.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index db9dfa92cb57..9e6703e005e2 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
>  		    uhs == MMC_TIMING_UHS_DDR50) {
>  			reg_val &= ~SDIO3_CONF_CLK_INV;
>  			reg_val |= SDIO3_CONF_SD_FB_CLK;
> -		} else if (uhs == MMC_TIMING_MMC_HS) {
> +		} else if (uhs == MMC_TIMING_MMC_HS ||
> +			   uhs == MMC_TIMING_SD_HS) {
>  			reg_val &= ~SDIO3_CONF_CLK_INV;
>  			reg_val &= ~SDIO3_CONF_SD_FB_CLK;
>  		} else {


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

* Re: [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards
  2026-09-01  0:38 [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards Rosen Penev
  2026-09-09  7:15 ` Adrian Hunter
@ 2026-09-11 15:40 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2026-09-11 15:40 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-mmc, Adrian Hunter, Ulf Hansson, open list

On Tue, Sep 1, 2026 at 2:38 AM Rosen Penev <rosenp@gmail.com> wrote:
>
> The SDIO3 Configuration register branch of pxav3_set_uhs_signaling()
> only clears the clock-inversion and feedback-clock bits for
> MMC_TIMING_MMC_HS.  As a result, MMC_TIMING_SD_HS (ordinary SD High
> Speed) falls through to the default case, which sets SDIO3_CONF_CLK_INV
> and leaves the feedback clock cleared.
>
> According to erratum FE-2946959, clock inversion is only needed for
> slow frequencies when the card hold-time requirement is high and is not
> required nor desirable for high-speed modes.  SD High Speed runs at 50
> MHz, so the same timing argument that applies to MMC High Speed holds.
> Treat MMC_TIMING_SD_HS the same as MMC_TIMING_MMC_HS and clear the
> clock-inversion and feedback-clock bits for both.
>
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-pxav3.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index db9dfa92cb57..9e6703e005e2 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
>                     uhs == MMC_TIMING_UHS_DDR50) {
>                         reg_val &= ~SDIO3_CONF_CLK_INV;
>                         reg_val |= SDIO3_CONF_SD_FB_CLK;
> -               } else if (uhs == MMC_TIMING_MMC_HS) {
> +               } else if (uhs == MMC_TIMING_MMC_HS ||
> +                          uhs == MMC_TIMING_SD_HS) {
>                         reg_val &= ~SDIO3_CONF_CLK_INV;
>                         reg_val &= ~SDIO3_CONF_SD_FB_CLK;
>                 } else {
> --
> 2.55.0
>

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

end of thread, other threads:[~2026-09-11 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01  0:38 [PATCH] mmc: sdhci-pxav3: disable clock inversion for SD HS cards Rosen Penev
2026-09-09  7:15 ` Adrian Hunter
2026-09-11 15:40 ` Ulf Hansson

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

all inboxes | Powered by JetHome®