Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH RESEND V2 0/2] Adjust some error messages for SD UHS-II initialization process
@ 2025-05-23 11:01 Victor Shih
  2025-05-23 11:01 ` [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards Victor Shih
  2025-05-23 11:01 ` [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card Victor Shih
  0 siblings, 2 replies; 6+ messages in thread
From: Victor Shih @ 2025-05-23 11:01 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: linux-mmc, linux-kernel, benchuanggli, HL.Liu, Greg.tu,
	Ben.Chuang, Victor Shih

From: Victor Shih <victor.shih@genesyslogic.com.tw>

Summary
=======
It is normal that errors will occur when using non-UHS-II card to enter
the UHS-II card initialization process. We should not be producing error
messages and register dumps. Therefore, switch the error messages to debug
mode and register dumps to dynamic debug mode.

Patch structure
===============
patch#1: for core
patch#2: for sdhci

Changes in v2 (May. 23, 2025)
* Rebase on latest mmc/next.
* Patch#1: Drop the use of DBG macro and use pr_debug() instead.
* Patch#2: Drop the use of DBG macro in some function
           and use pr_debug() instead.

----------------- original cover letter from v1 -----------------
Summary
=======
It is normal that errors will occur when using non-UHS-II card to enter
the UHS-II card initialization process. We should not be producing error
messages and register dumps. Therefore, switch the error messages to debug
mode and register dumps to dynamic debug mode.

Patch structure
===============
patch#1: for core
patch#2: for sdhci

Changes in v1 (May. 16, 2025)
* Rebase on latest mmc/next.
* Patch#1: Adjust some error messages for SD UHS-II cards.
* Patch#2: Adjust some error messages and register dump for SD UHS-II card

Victor Shih (2):
  mmc: core: Adjust some error messages for SD UHS-II cards
  mmc: sdhci-uhs2: Adjust some error messages and register dump for SD
    UHS-II card

 drivers/mmc/core/sd_uhs2.c    |  4 ++--
 drivers/mmc/host/sdhci-uhs2.c | 20 ++++++++++----------
 drivers/mmc/host/sdhci.h      | 16 ++++++++++++++++
 3 files changed, 28 insertions(+), 12 deletions(-)

-- 
2.43.0


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

* [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards
  2025-05-23 11:01 [PATCH RESEND V2 0/2] Adjust some error messages for SD UHS-II initialization process Victor Shih
@ 2025-05-23 11:01 ` Victor Shih
  2025-05-28 11:58   ` Adrian Hunter
  2025-05-23 11:01 ` [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card Victor Shih
  1 sibling, 1 reply; 6+ messages in thread
From: Victor Shih @ 2025-05-23 11:01 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: linux-mmc, linux-kernel, benchuanggli, HL.Liu, Greg.tu,
	Ben.Chuang, Victor Shih, Victor Shih

From: Victor Shih <victor.shih@genesyslogic.com.tw>

Adjust some error messages to debug mode to avoid causing
misunderstanding it is an error.

Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
---
 drivers/mmc/core/sd_uhs2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/sd_uhs2.c b/drivers/mmc/core/sd_uhs2.c
index 1c31d0dfa961..de17d1611290 100644
--- a/drivers/mmc/core/sd_uhs2.c
+++ b/drivers/mmc/core/sd_uhs2.c
@@ -91,8 +91,8 @@ static int sd_uhs2_phy_init(struct mmc_host *host)
 
 	err = host->ops->uhs2_control(host, UHS2_PHY_INIT);
 	if (err) {
-		pr_err("%s: failed to initial phy for UHS-II!\n",
-		       mmc_hostname(host));
+		pr_debug("%s: failed to initial phy for UHS-II!\n",
+			 mmc_hostname(host));
 	}
 
 	return err;
-- 
2.43.0


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

* [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card
  2025-05-23 11:01 [PATCH RESEND V2 0/2] Adjust some error messages for SD UHS-II initialization process Victor Shih
  2025-05-23 11:01 ` [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards Victor Shih
@ 2025-05-23 11:01 ` Victor Shih
  2025-05-28 12:09   ` Adrian Hunter
  1 sibling, 1 reply; 6+ messages in thread
From: Victor Shih @ 2025-05-23 11:01 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: linux-mmc, linux-kernel, benchuanggli, HL.Liu, Greg.tu,
	Ben.Chuang, Victor Shih, Victor Shih

From: Victor Shih <victor.shih@genesyslogic.com.tw>

Adjust some error messages to debug mode and register dump to dynamic
debug mode to avoid causing misunderstanding it is an error.

Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
---
 drivers/mmc/host/sdhci-uhs2.c | 20 ++++++++++----------
 drivers/mmc/host/sdhci.h      | 16 ++++++++++++++++
 2 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
index c53b64d50c0d..0efeb9d0c376 100644
--- a/drivers/mmc/host/sdhci-uhs2.c
+++ b/drivers/mmc/host/sdhci-uhs2.c
@@ -99,8 +99,8 @@ void sdhci_uhs2_reset(struct sdhci_host *host, u16 mask)
 	/* hw clears the bit when it's done */
 	if (read_poll_timeout_atomic(sdhci_readw, val, !(val & mask), 10,
 				     UHS2_RESET_TIMEOUT_100MS, true, host, SDHCI_UHS2_SW_RESET)) {
-		pr_warn("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
-			mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
+		pr_debug("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
+			 mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
 		sdhci_writeb(host, 0, SDHCI_UHS2_SW_RESET);
 		return;
 	}
@@ -335,8 +335,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
 	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IF_DETECT),
 			      100, UHS2_INTERFACE_DETECT_TIMEOUT_100MS, true,
 			      host, SDHCI_PRESENT_STATE)) {
-		pr_warn("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
-		sdhci_dumpregs(host);
+		pr_debug("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
+		sdhci_dbg_dumpregs(host, "UHS2 interface detect timeout in 100ms");
 		return -EIO;
 	}
 
@@ -345,8 +345,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
 
 	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_LANE_SYNC),
 			      100, UHS2_LANE_SYNC_TIMEOUT_150MS, true, host, SDHCI_PRESENT_STATE)) {
-		pr_warn("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
-		sdhci_dumpregs(host);
+		pr_debug("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
+		sdhci_dbg_dumpregs(host, "UHS2 Lane sync fail in 150ms");
 		return -EIO;
 	}
 
@@ -417,12 +417,12 @@ static int sdhci_uhs2_do_detect_init(struct mmc_host *mmc)
 		host->ops->uhs2_pre_detect_init(host);
 
 	if (sdhci_uhs2_interface_detect(host)) {
-		pr_warn("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
+		pr_debug("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
 		return -EIO;
 	}
 
 	if (sdhci_uhs2_init(host)) {
-		pr_warn("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
+		pr_debug("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
 		return -EIO;
 	}
 
@@ -504,8 +504,8 @@ static int sdhci_uhs2_check_dormant(struct sdhci_host *host)
 	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IN_DORMANT_STATE),
 			      100, UHS2_CHECK_DORMANT_TIMEOUT_100MS, true, host,
 			      SDHCI_PRESENT_STATE)) {
-		pr_warn("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
-		sdhci_dumpregs(host);
+		pr_debug("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
+		sdhci_dbg_dumpregs(host, "UHS2 IN_DORMANT fail in 100ms");
 		return -EIO;
 	}
 	return 0;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index f9d65dd0f2b2..70ada1857a4c 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -900,4 +900,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
 void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
 void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
 
+#if defined(CONFIG_DYNAMIC_DEBUG) || \
+	(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
+#define SDHCI_DBG_ANYWAY 0
+#elif defined(DEBUG)
+#define SDHCI_DBG_ANYWAY 1
+#else
+#define SDHCI_DBG_ANYWAY 0
+#endif
+
+#define sdhci_dbg_dumpregs(host, fmt)					\
+do {									\
+	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
+	if (DYNAMIC_DEBUG_BRANCH(descriptor) ||	SDHCI_DBG_ANYWAY)	\
+		sdhci_dumpregs(host);					\
+} while (0)
+
 #endif /* __SDHCI_HW_H */
-- 
2.43.0


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

* Re: [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards
  2025-05-23 11:01 ` [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards Victor Shih
@ 2025-05-28 11:58   ` Adrian Hunter
  0 siblings, 0 replies; 6+ messages in thread
From: Adrian Hunter @ 2025-05-28 11:58 UTC (permalink / raw)
  To: Victor Shih, ulf.hansson
  Cc: linux-mmc, linux-kernel, benchuanggli, HL.Liu, Greg.tu,
	Ben.Chuang, Victor Shih

On 23/05/2025 14:01, Victor Shih wrote:
> From: Victor Shih <victor.shih@genesyslogic.com.tw>
> 
> Adjust some error messages to debug mode to avoid causing
> misunderstanding it is an error.
> 
> Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>

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

> ---
>  drivers/mmc/core/sd_uhs2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/sd_uhs2.c b/drivers/mmc/core/sd_uhs2.c
> index 1c31d0dfa961..de17d1611290 100644
> --- a/drivers/mmc/core/sd_uhs2.c
> +++ b/drivers/mmc/core/sd_uhs2.c
> @@ -91,8 +91,8 @@ static int sd_uhs2_phy_init(struct mmc_host *host)
>  
>  	err = host->ops->uhs2_control(host, UHS2_PHY_INIT);
>  	if (err) {
> -		pr_err("%s: failed to initial phy for UHS-II!\n",
> -		       mmc_hostname(host));
> +		pr_debug("%s: failed to initial phy for UHS-II!\n",
> +			 mmc_hostname(host));
>  	}
>  
>  	return err;


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

* Re: [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card
  2025-05-23 11:01 ` [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card Victor Shih
@ 2025-05-28 12:09   ` Adrian Hunter
  2025-06-06 10:32     ` Victor Shih
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2025-05-28 12:09 UTC (permalink / raw)
  To: Victor Shih, ulf.hansson
  Cc: linux-mmc, linux-kernel, benchuanggli, HL.Liu, Greg.tu,
	Ben.Chuang, Victor Shih

On 23/05/2025 14:01, Victor Shih wrote:
> From: Victor Shih <victor.shih@genesyslogic.com.tw>
> 
> Adjust some error messages to debug mode and register dump to dynamic
> debug mode to avoid causing misunderstanding it is an error.
> 
> Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>

I think Ulf asked for the drivers/mmc/host/sdhci.h change to be
a separate patch.

In any case:

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

> ---
>  drivers/mmc/host/sdhci-uhs2.c | 20 ++++++++++----------
>  drivers/mmc/host/sdhci.h      | 16 ++++++++++++++++
>  2 files changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
> index c53b64d50c0d..0efeb9d0c376 100644
> --- a/drivers/mmc/host/sdhci-uhs2.c
> +++ b/drivers/mmc/host/sdhci-uhs2.c
> @@ -99,8 +99,8 @@ void sdhci_uhs2_reset(struct sdhci_host *host, u16 mask)
>  	/* hw clears the bit when it's done */
>  	if (read_poll_timeout_atomic(sdhci_readw, val, !(val & mask), 10,
>  				     UHS2_RESET_TIMEOUT_100MS, true, host, SDHCI_UHS2_SW_RESET)) {
> -		pr_warn("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
> -			mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
> +		pr_debug("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
> +			 mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
>  		sdhci_writeb(host, 0, SDHCI_UHS2_SW_RESET);
>  		return;
>  	}
> @@ -335,8 +335,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
>  	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IF_DETECT),
>  			      100, UHS2_INTERFACE_DETECT_TIMEOUT_100MS, true,
>  			      host, SDHCI_PRESENT_STATE)) {
> -		pr_warn("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
> -		sdhci_dumpregs(host);
> +		pr_debug("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
> +		sdhci_dbg_dumpregs(host, "UHS2 interface detect timeout in 100ms");
>  		return -EIO;
>  	}
>  
> @@ -345,8 +345,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
>  
>  	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_LANE_SYNC),
>  			      100, UHS2_LANE_SYNC_TIMEOUT_150MS, true, host, SDHCI_PRESENT_STATE)) {
> -		pr_warn("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
> -		sdhci_dumpregs(host);
> +		pr_debug("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
> +		sdhci_dbg_dumpregs(host, "UHS2 Lane sync fail in 150ms");
>  		return -EIO;
>  	}
>  
> @@ -417,12 +417,12 @@ static int sdhci_uhs2_do_detect_init(struct mmc_host *mmc)
>  		host->ops->uhs2_pre_detect_init(host);
>  
>  	if (sdhci_uhs2_interface_detect(host)) {
> -		pr_warn("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
> +		pr_debug("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
>  		return -EIO;
>  	}
>  
>  	if (sdhci_uhs2_init(host)) {
> -		pr_warn("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
> +		pr_debug("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
>  		return -EIO;
>  	}
>  
> @@ -504,8 +504,8 @@ static int sdhci_uhs2_check_dormant(struct sdhci_host *host)
>  	if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IN_DORMANT_STATE),
>  			      100, UHS2_CHECK_DORMANT_TIMEOUT_100MS, true, host,
>  			      SDHCI_PRESENT_STATE)) {
> -		pr_warn("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
> -		sdhci_dumpregs(host);
> +		pr_debug("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
> +		sdhci_dbg_dumpregs(host, "UHS2 IN_DORMANT fail in 100ms");
>  		return -EIO;
>  	}
>  	return 0;
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index f9d65dd0f2b2..70ada1857a4c 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -900,4 +900,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
>  void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
>  void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
>  
> +#if defined(CONFIG_DYNAMIC_DEBUG) || \
> +	(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
> +#define SDHCI_DBG_ANYWAY 0
> +#elif defined(DEBUG)
> +#define SDHCI_DBG_ANYWAY 1
> +#else
> +#define SDHCI_DBG_ANYWAY 0
> +#endif
> +
> +#define sdhci_dbg_dumpregs(host, fmt)					\
> +do {									\
> +	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
> +	if (DYNAMIC_DEBUG_BRANCH(descriptor) ||	SDHCI_DBG_ANYWAY)	\
> +		sdhci_dumpregs(host);					\
> +} while (0)
> +
>  #endif /* __SDHCI_HW_H */


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

* Re: [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card
  2025-05-28 12:09   ` Adrian Hunter
@ 2025-06-06 10:32     ` Victor Shih
  0 siblings, 0 replies; 6+ messages in thread
From: Victor Shih @ 2025-06-06 10:32 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: ulf.hansson, linux-mmc, linux-kernel, benchuanggli, HL.Liu,
	Greg.tu, Ben.Chuang, Victor Shih

On Wed, May 28, 2025 at 8:10 PM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> On 23/05/2025 14:01, Victor Shih wrote:
> > From: Victor Shih <victor.shih@genesyslogic.com.tw>
> >
> > Adjust some error messages to debug mode and register dump to dynamic
> > debug mode to avoid causing misunderstanding it is an error.
> >
> > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
>
> I think Ulf asked for the drivers/mmc/host/sdhci.h change to be
> a separate patch.
>
> In any case:
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>

Hi, Adrian

I left this part out, I'll resend the patch for the new series to
match this thing,
and I will also keep your acked tag.

Thanks, Victor Shih

> > ---
> >  drivers/mmc/host/sdhci-uhs2.c | 20 ++++++++++----------
> >  drivers/mmc/host/sdhci.h      | 16 ++++++++++++++++
> >  2 files changed, 26 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
> > index c53b64d50c0d..0efeb9d0c376 100644
> > --- a/drivers/mmc/host/sdhci-uhs2.c
> > +++ b/drivers/mmc/host/sdhci-uhs2.c
> > @@ -99,8 +99,8 @@ void sdhci_uhs2_reset(struct sdhci_host *host, u16 mask)
> >       /* hw clears the bit when it's done */
> >       if (read_poll_timeout_atomic(sdhci_readw, val, !(val & mask), 10,
> >                                    UHS2_RESET_TIMEOUT_100MS, true, host, SDHCI_UHS2_SW_RESET)) {
> > -             pr_warn("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
> > -                     mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
> > +             pr_debug("%s: %s: Reset 0x%x never completed. %s: clean reset bit.\n", __func__,
> > +                      mmc_hostname(host->mmc), (int)mask, mmc_hostname(host->mmc));
> >               sdhci_writeb(host, 0, SDHCI_UHS2_SW_RESET);
> >               return;
> >       }
> > @@ -335,8 +335,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
> >       if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IF_DETECT),
> >                             100, UHS2_INTERFACE_DETECT_TIMEOUT_100MS, true,
> >                             host, SDHCI_PRESENT_STATE)) {
> > -             pr_warn("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
> > -             sdhci_dumpregs(host);
> > +             pr_debug("%s: not detect UHS2 interface in 100ms.\n", mmc_hostname(host->mmc));
> > +             sdhci_dbg_dumpregs(host, "UHS2 interface detect timeout in 100ms");
> >               return -EIO;
> >       }
> >
> > @@ -345,8 +345,8 @@ static int sdhci_uhs2_interface_detect(struct sdhci_host *host)
> >
> >       if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_LANE_SYNC),
> >                             100, UHS2_LANE_SYNC_TIMEOUT_150MS, true, host, SDHCI_PRESENT_STATE)) {
> > -             pr_warn("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
> > -             sdhci_dumpregs(host);
> > +             pr_debug("%s: UHS2 Lane sync fail in 150ms.\n", mmc_hostname(host->mmc));
> > +             sdhci_dbg_dumpregs(host, "UHS2 Lane sync fail in 150ms");
> >               return -EIO;
> >       }
> >
> > @@ -417,12 +417,12 @@ static int sdhci_uhs2_do_detect_init(struct mmc_host *mmc)
> >               host->ops->uhs2_pre_detect_init(host);
> >
> >       if (sdhci_uhs2_interface_detect(host)) {
> > -             pr_warn("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
> > +             pr_debug("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc));
> >               return -EIO;
> >       }
> >
> >       if (sdhci_uhs2_init(host)) {
> > -             pr_warn("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
> > +             pr_debug("%s: UHS2 init fail.\n", mmc_hostname(host->mmc));
> >               return -EIO;
> >       }
> >
> > @@ -504,8 +504,8 @@ static int sdhci_uhs2_check_dormant(struct sdhci_host *host)
> >       if (read_poll_timeout(sdhci_readl, val, (val & SDHCI_UHS2_IN_DORMANT_STATE),
> >                             100, UHS2_CHECK_DORMANT_TIMEOUT_100MS, true, host,
> >                             SDHCI_PRESENT_STATE)) {
> > -             pr_warn("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
> > -             sdhci_dumpregs(host);
> > +             pr_debug("%s: UHS2 IN_DORMANT fail in 100ms.\n", mmc_hostname(host->mmc));
> > +             sdhci_dbg_dumpregs(host, "UHS2 IN_DORMANT fail in 100ms");
> >               return -EIO;
> >       }
> >       return 0;
> > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> > index f9d65dd0f2b2..70ada1857a4c 100644
> > --- a/drivers/mmc/host/sdhci.h
> > +++ b/drivers/mmc/host/sdhci.h
> > @@ -900,4 +900,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
> >  void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
> >  void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
> >
> > +#if defined(CONFIG_DYNAMIC_DEBUG) || \
> > +     (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
> > +#define SDHCI_DBG_ANYWAY 0
> > +#elif defined(DEBUG)
> > +#define SDHCI_DBG_ANYWAY 1
> > +#else
> > +#define SDHCI_DBG_ANYWAY 0
> > +#endif
> > +
> > +#define sdhci_dbg_dumpregs(host, fmt)                                        \
> > +do {                                                                 \
> > +     DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);                 \
> > +     if (DYNAMIC_DEBUG_BRANCH(descriptor) || SDHCI_DBG_ANYWAY)       \
> > +             sdhci_dumpregs(host);                                   \
> > +} while (0)
> > +
> >  #endif /* __SDHCI_HW_H */
>

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

end of thread, other threads:[~2025-06-06 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 11:01 [PATCH RESEND V2 0/2] Adjust some error messages for SD UHS-II initialization process Victor Shih
2025-05-23 11:01 ` [PATCH RESEND V2 1/2] mmc: core: Adjust some error messages for SD UHS-II cards Victor Shih
2025-05-28 11:58   ` Adrian Hunter
2025-05-23 11:01 ` [PATCH RESEND V2 2/2] mmc: sdhci-uhs2: Adjust some error messages and register dump for SD UHS-II card Victor Shih
2025-05-28 12:09   ` Adrian Hunter
2025-06-06 10:32     ` Victor Shih

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