public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: ziniu.wang_1@nxp.com
Cc: 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,
	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
Date: Wed, 21 May 2025 11:56:25 -0400	[thread overview]
Message-ID: <aC33qfRFEvNbwSRn@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250521033134.112671-1-ziniu.wang_1@nxp.com>

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
>


  reply	other threads:[~2025-05-21 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aC33qfRFEvNbwSRn@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s32@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=ziniu.wang_1@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox