public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
@ 2025-05-21  3:31 ziniu.wang_1
  2025-05-21 15:56 ` Frank Li
  2025-06-09 14:24 ` Ulf Hansson
  0 siblings, 2 replies; 6+ messages in thread
From: ziniu.wang_1 @ 2025-05-21  3:31 UTC (permalink / raw)
  To: haibo.chen, adrian.hunter, ulf.hansson, linux-mmc
  Cc: shawnguo, s.hauer, kernel, festevam, imx, s32, linux-arm-kernel,
	linux-kernel

From: Haibo Chen <haibo.chen@nxp.com>

pinctrl sleep state may config the pin mux to certain function to save
power in system PM. But if usdhc is setting as wakeup source, like
the card interrupt(SDIO) or card insert interrupt, it depends on the
related pin mux configured to usdhc function pad.
e.g. To support card interrupt(SDIO interrupt), it need the pin is
config as usdhc DATA[1] function pin.

Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
can't wakeup system because the pinctrl sleep state config the DATA[1]
pin as GPIO function.

For this case, do not change the pinctrl state in suspend.

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

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 5f1c45b2bd5d..f206b562a6e3 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct device *dev)
 		ret = sdhci_enable_irq_wakeups(host);
 		if (!ret)
 			dev_warn(dev, "Failed to enable irq wakeup\n");
+	} else {
+		/*
+		 * For the device which works as wakeup source, no need
+		 * to change the pinctrl to sleep state.
+		 * e.g. For SDIO device, the interrupt share with data pin,
+		 * but the pinctrl sleep state may config the data pin to
+		 * other function like GPIO function to save power in PM,
+		 * which finally block the SDIO wakeup function.
+		 */
+		ret = pinctrl_pm_select_sleep_state(dev);
+		if (ret)
+			return ret;
 	}
 
-	ret = pinctrl_pm_select_sleep_state(dev);
-	if (ret)
-		return ret;
-
 	ret = mmc_gpio_set_cd_wake(host->mmc, true);
 
 	/*
-- 
2.34.1



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

* Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
  2025-05-21  3:31 [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source ziniu.wang_1
@ 2025-05-21 15:56 ` Frank Li
  2025-05-22  3:16   ` Bough Chen
  2025-06-09 14:24 ` Ulf Hansson
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Li @ 2025-05-21 15:56 UTC (permalink / raw)
  To: ziniu.wang_1
  Cc: haibo.chen, adrian.hunter, ulf.hansson, linux-mmc, shawnguo,
	s.hauer, kernel, festevam, imx, s32, linux-arm-kernel,
	linux-kernel

On Wed, May 21, 2025 at 11:31:34AM +0800, ziniu.wang_1@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
>
> pinctrl sleep state may config the pin mux to certain function to save
> power in system PM. But if usdhc is setting as wakeup source, like
> the card interrupt(SDIO) or card insert interrupt, it depends on the
> related pin mux configured to usdhc function pad.
> e.g. To support card interrupt(SDIO interrupt), it need the pin is
> config as usdhc DATA[1] function pin.

I think it should be dts settings wrong. Does one PAD set as function
impact power much?

Frank

>
> Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
> can't wakeup system because the pinctrl sleep state config the DATA[1]
> pin as GPIO function.
>
> For this case, do not change the pinctrl state in suspend.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 5f1c45b2bd5d..f206b562a6e3 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct device *dev)
>  		ret = sdhci_enable_irq_wakeups(host);
>  		if (!ret)
>  			dev_warn(dev, "Failed to enable irq wakeup\n");
> +	} else {
> +		/*
> +		 * For the device which works as wakeup source, no need
> +		 * to change the pinctrl to sleep state.
> +		 * e.g. For SDIO device, the interrupt share with data pin,
> +		 * but the pinctrl sleep state may config the data pin to
> +		 * other function like GPIO function to save power in PM,
> +		 * which finally block the SDIO wakeup function.
> +		 */
> +		ret = pinctrl_pm_select_sleep_state(dev);
> +		if (ret)
> +			return ret;
>  	}
>
> -	ret = pinctrl_pm_select_sleep_state(dev);
> -	if (ret)
> -		return ret;
> -
>  	ret = mmc_gpio_set_cd_wake(host->mmc, true);
>
>  	/*
> --
> 2.34.1
>


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

* RE: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
  2025-05-21 15:56 ` Frank Li
@ 2025-05-22  3:16   ` Bough Chen
  2025-05-22 18:29     ` Frank Li
  0 siblings, 1 reply; 6+ messages in thread
From: Bough Chen @ 2025-05-22  3:16 UTC (permalink / raw)
  To: Frank Li, Luke Wang
  Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com,
	imx@lists.linux.dev, dl-S32, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Frank Li <frank.li@nxp.com>
> Sent: 2025年5月21日 23:56
> To: Luke Wang <ziniu.wang_1@nxp.com>
> Cc: Bough Chen <haibo.chen@nxp.com>; adrian.hunter@intel.com;
> ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> imx@lists.linux.dev; dl-S32 <S32@nxp.com>;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in
> suspend if function irq is wakeup source
> 
> On Wed, May 21, 2025 at 11:31:34AM +0800, ziniu.wang_1@nxp.com wrote:
> > From: Haibo Chen <haibo.chen@nxp.com>
> >
> > pinctrl sleep state may config the pin mux to certain function to save
> > power in system PM. But if usdhc is setting as wakeup source, like the
> > card interrupt(SDIO) or card insert interrupt, it depends on the
> > related pin mux configured to usdhc function pad.
> > e.g. To support card interrupt(SDIO interrupt), it need the pin is
> > config as usdhc DATA[1] function pin.
> 
> I think it should be dts settings wrong. Does one PAD set as function impact
> power much?

Hi Frank,

I double check the power team, on imx93-11x11-evk board, For SD card on usdhc2, switch the PAD to gpio function will save about 3~4mw,
For SDIO wifi on usdhc3, switch the PAD to gpio function will save about 0.8~1mw. (without wakeup)

Regards
Haibo Chen
> 
> Frank
> 
> >
> > Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
> > can't wakeup system because the pinctrl sleep state config the DATA[1]
> > pin as GPIO function.
> >
> > For this case, do not change the pinctrl state in suspend.
> >
> > Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> > Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> > ---
> >  drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++----
> >  1 file changed, 12 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > index 5f1c45b2bd5d..f206b562a6e3 100644
> > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > @@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct device
> *dev)
> >  		ret = sdhci_enable_irq_wakeups(host);
> >  		if (!ret)
> >  			dev_warn(dev, "Failed to enable irq wakeup\n");
> > +	} else {
> > +		/*
> > +		 * For the device which works as wakeup source, no need
> > +		 * to change the pinctrl to sleep state.
> > +		 * e.g. For SDIO device, the interrupt share with data pin,
> > +		 * but the pinctrl sleep state may config the data pin to
> > +		 * other function like GPIO function to save power in PM,
> > +		 * which finally block the SDIO wakeup function.
> > +		 */
> > +		ret = pinctrl_pm_select_sleep_state(dev);
> > +		if (ret)
> > +			return ret;
> >  	}
> >
> > -	ret = pinctrl_pm_select_sleep_state(dev);
> > -	if (ret)
> > -		return ret;
> > -
> >  	ret = mmc_gpio_set_cd_wake(host->mmc, true);
> >
> >  	/*
> > --
> > 2.34.1
> >

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

* Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
  2025-05-22  3:16   ` Bough Chen
@ 2025-05-22 18:29     ` Frank Li
  2025-05-23  8:08       ` Luke Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Li @ 2025-05-22 18:29 UTC (permalink / raw)
  To: Bough Chen
  Cc: Luke Wang, adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com,
	imx@lists.linux.dev, dl-S32, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

On Thu, May 22, 2025 at 03:16:11AM +0000, Bough Chen wrote:
> > -----Original Message-----
> > From: Frank Li <frank.li@nxp.com>
> > Sent: 2025年5月21日 23:56
> > To: Luke Wang <ziniu.wang_1@nxp.com>
> > Cc: Bough Chen <haibo.chen@nxp.com>; adrian.hunter@intel.com;
> > ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; shawnguo@kernel.org;
> > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > imx@lists.linux.dev; dl-S32 <S32@nxp.com>;
> > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in
> > suspend if function irq is wakeup source
> >
> > On Wed, May 21, 2025 at 11:31:34AM +0800, ziniu.wang_1@nxp.com wrote:
> > > From: Haibo Chen <haibo.chen@nxp.com>
> > >
> > > pinctrl sleep state may config the pin mux to certain function to save
> > > power in system PM. But if usdhc is setting as wakeup source, like the
> > > card interrupt(SDIO) or card insert interrupt, it depends on the
> > > related pin mux configured to usdhc function pad.
> > > e.g. To support card interrupt(SDIO interrupt), it need the pin is
> > > config as usdhc DATA[1] function pin.
> >
> > I think it should be dts settings wrong. Does one PAD set as function impact
> > power much?
>
> Hi Frank,
>
> I double check the power team, on imx93-11x11-evk board, For SD card on usdhc2, switch the PAD to gpio function will save about 3~4mw,
> For SDIO wifi on usdhc3, switch the PAD to gpio function will save about 0.8~1mw. (without wakeup)

Okay, I think it should be add new pinctrl state ("wakeup"), only set DATA[0,2,3]
to GPIO and SET DATA[1] to sd function.

You can change pad setting to "wakeup" state if wake up enabled.

Frank

>
> Regards
> Haibo Chen
> >
> > Frank
> >
> > >
> > > Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
> > > can't wakeup system because the pinctrl sleep state config the DATA[1]
> > > pin as GPIO function.
> > >
> > > For this case, do not change the pinctrl state in suspend.
> > >
> > > Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> > > Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> > > ---
> > >  drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++----
> > >  1 file changed, 12 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > index 5f1c45b2bd5d..f206b562a6e3 100644
> > > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > @@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct device
> > *dev)
> > >  		ret = sdhci_enable_irq_wakeups(host);
> > >  		if (!ret)
> > >  			dev_warn(dev, "Failed to enable irq wakeup\n");
> > > +	} else {
> > > +		/*
> > > +		 * For the device which works as wakeup source, no need
> > > +		 * to change the pinctrl to sleep state.
> > > +		 * e.g. For SDIO device, the interrupt share with data pin,
> > > +		 * but the pinctrl sleep state may config the data pin to
> > > +		 * other function like GPIO function to save power in PM,
> > > +		 * which finally block the SDIO wakeup function.
> > > +		 */
> > > +		ret = pinctrl_pm_select_sleep_state(dev);
> > > +		if (ret)
> > > +			return ret;
> > >  	}
> > >
> > > -	ret = pinctrl_pm_select_sleep_state(dev);
> > > -	if (ret)
> > > -		return ret;
> > > -
> > >  	ret = mmc_gpio_set_cd_wake(host->mmc, true);
> > >
> > >  	/*
> > > --
> > > 2.34.1
> > >


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

* RE: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
  2025-05-22 18:29     ` Frank Li
@ 2025-05-23  8:08       ` Luke Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Luke Wang @ 2025-05-23  8:08 UTC (permalink / raw)
  To: Frank Li, Bough Chen
  Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com,
	imx@lists.linux.dev, dl-S32, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Frank Li <frank.li@nxp.com>
> Sent: Friday, May 23, 2025 2:29 AM
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: Luke Wang <ziniu.wang_1@nxp.com>; adrian.hunter@intel.com;
> ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> imx@lists.linux.dev; dl-S32 <S32@nxp.com>; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in
> suspend if function irq is wakeup source
> 
> On Thu, May 22, 2025 at 03:16:11AM +0000, Bough Chen wrote:
> > > -----Original Message-----
> > > From: Frank Li <frank.li@nxp.com>
> > > Sent: 2025年5月21日 23:56
> > > To: Luke Wang <ziniu.wang_1@nxp.com>
> > > Cc: Bough Chen <haibo.chen@nxp.com>; adrian.hunter@intel.com;
> > > ulf.hansson@linaro.org; linux-mmc@vger.kernel.org;
> shawnguo@kernel.org;
> > > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > > imx@lists.linux.dev; dl-S32 <S32@nxp.com>;
> > > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> > > Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in
> > > suspend if function irq is wakeup source
> > >
> > > On Wed, May 21, 2025 at 11:31:34AM +0800, ziniu.wang_1@nxp.com
> wrote:
> > > > From: Haibo Chen <haibo.chen@nxp.com>
> > > >
> > > > pinctrl sleep state may config the pin mux to certain function to save
> > > > power in system PM. But if usdhc is setting as wakeup source, like the
> > > > card interrupt(SDIO) or card insert interrupt, it depends on the
> > > > related pin mux configured to usdhc function pad.
> > > > e.g. To support card interrupt(SDIO interrupt), it need the pin is
> > > > config as usdhc DATA[1] function pin.
> > >
> > > I think it should be dts settings wrong. Does one PAD set as function
> impact
> > > power much?
> >
> > Hi Frank,
> >
> > I double check the power team, on imx93-11x11-evk board, For SD card on
> usdhc2, switch the PAD to gpio function will save about 3~4mw,
> > For SDIO wifi on usdhc3, switch the PAD to gpio function will save about
> 0.8~1mw. (without wakeup)
> 
> Okay, I think it should be add new pinctrl state ("wakeup"), only set
> DATA[0,2,3]
> to GPIO and SET DATA[1] to sd function.
> 
> You can change pad setting to "wakeup" state if wake up enabled.
> 

Hi Frank,

Adding new pinctrl state will bring both driver and dts changes.
What about we only change sleep pinctrl DATA[1] to sd function for SDIO?

Regards
Luke

> Frank
> 
> >
> > Regards
> > Haibo Chen
> > >
> > > Frank
> > >
> > > >
> > > > Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
> > > > can't wakeup system because the pinctrl sleep state config the DATA[1]
> > > > pin as GPIO function.
> > > >
> > > > For this case, do not change the pinctrl state in suspend.
> > > >
> > > > Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> > > > Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
> > > > ---
> > > >  drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++----
> > > >  1 file changed, 12 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > index 5f1c45b2bd5d..f206b562a6e3 100644
> > > > --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> > > > @@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct
> device
> > > *dev)
> > > >  		ret = sdhci_enable_irq_wakeups(host);
> > > >  		if (!ret)
> > > >  			dev_warn(dev, "Failed to enable irq wakeup\n");
> > > > +	} else {
> > > > +		/*
> > > > +		 * For the device which works as wakeup source, no need
> > > > +		 * to change the pinctrl to sleep state.
> > > > +		 * e.g. For SDIO device, the interrupt share with data pin,
> > > > +		 * but the pinctrl sleep state may config the data pin to
> > > > +		 * other function like GPIO function to save power in PM,
> > > > +		 * which finally block the SDIO wakeup function.
> > > > +		 */
> > > > +		ret = pinctrl_pm_select_sleep_state(dev);
> > > > +		if (ret)
> > > > +			return ret;
> > > >  	}
> > > >
> > > > -	ret = pinctrl_pm_select_sleep_state(dev);
> > > > -	if (ret)
> > > > -		return ret;
> > > > -
> > > >  	ret = mmc_gpio_set_cd_wake(host->mmc, true);
> > > >
> > > >  	/*
> > > > --
> > > > 2.34.1
> > > >

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

* Re: [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source
  2025-05-21  3:31 [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source ziniu.wang_1
  2025-05-21 15:56 ` Frank Li
@ 2025-06-09 14:24 ` Ulf Hansson
  1 sibling, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2025-06-09 14:24 UTC (permalink / raw)
  To: ziniu.wang_1
  Cc: haibo.chen, adrian.hunter, linux-mmc, shawnguo, s.hauer, kernel,
	festevam, imx, s32, linux-arm-kernel, linux-kernel, Frank Li

+ Frank

On Wed, 21 May 2025 at 05:30, <ziniu.wang_1@nxp.com> wrote:
>
> From: Haibo Chen <haibo.chen@nxp.com>
>
> pinctrl sleep state may config the pin mux to certain function to save
> power in system PM. But if usdhc is setting as wakeup source, like
> the card interrupt(SDIO) or card insert interrupt, it depends on the
> related pin mux configured to usdhc function pad.
> e.g. To support card interrupt(SDIO interrupt), it need the pin is
> config as usdhc DATA[1] function pin.
>
> Find the issue on imx93-11x11-evk board, SDIO WiFi in band interrupt
> can't wakeup system because the pinctrl sleep state config the DATA[1]
> pin as GPIO function.
>
> For this case, do not change the pinctrl state in suspend.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>

I have followed the discussion and I agree that there is room for
additional improvements (such as adding a new pinctrl state).

In any case, I still think $subject patch is the first step to take,
to fix the current problems. So, applied for next, thanks!

Note that, we may want this for stable kernels too, but perhaps easier
to manage that by manual backports as this depends on commit
676a83855614 ("mmc: host: sdhci-esdhc-imx: refactor the system PM
logic") too.

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 5f1c45b2bd5d..f206b562a6e3 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -2057,12 +2057,20 @@ static int sdhci_esdhc_suspend(struct device *dev)
>                 ret = sdhci_enable_irq_wakeups(host);
>                 if (!ret)
>                         dev_warn(dev, "Failed to enable irq wakeup\n");
> +       } else {
> +               /*
> +                * For the device which works as wakeup source, no need
> +                * to change the pinctrl to sleep state.
> +                * e.g. For SDIO device, the interrupt share with data pin,
> +                * but the pinctrl sleep state may config the data pin to
> +                * other function like GPIO function to save power in PM,
> +                * which finally block the SDIO wakeup function.
> +                */
> +               ret = pinctrl_pm_select_sleep_state(dev);
> +               if (ret)
> +                       return ret;
>         }
>
> -       ret = pinctrl_pm_select_sleep_state(dev);
> -       if (ret)
> -               return ret;
> -
>         ret = mmc_gpio_set_cd_wake(host->mmc, true);
>
>         /*
> --
> 2.34.1
>


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

end of thread, other threads:[~2025-06-09 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21  3:31 [PATCH] mmc: sdhci-esdhc-imx: do not change pinctrl state in suspend if function irq is wakeup source ziniu.wang_1
2025-05-21 15:56 ` Frank Li
2025-05-22  3:16   ` Bough Chen
2025-05-22 18:29     ` Frank Li
2025-05-23  8:08       ` Luke Wang
2025-06-09 14:24 ` Ulf Hansson

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