lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <39ea3a66-a874-4266-9788-50e87b9160e5@oss.nxp.com>
Date: Mon, 8 Jul 2024 14:42:26 +0300
From: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
To: Bough Chen <haibo.chen@....com>, Adrian Hunter <adrian.hunter@...el.com>,
 Ulf Hansson <ulf.hansson@...aro.org>, Shawn Guo <shawnguo@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
 "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
 "linux-arm-kernel@...ts.infradead.org"
 <linux-arm-kernel@...ts.infradead.org>, dl-S32 <S32@....com>
Subject: Re: [PATCH 3/4] mmc: sdhci-esdhc-imx: add option to not change
 pinctrl state in suspend

On 7/8/2024 5:33 AM, Bough Chen wrote:
>> -----Original Message-----
>> From: Ciprian Marian Costea (OSS) <ciprianmarian.costea@....nxp.com>
>> Sent: 2024年7月5日 21:47
>> To: Bough Chen <haibo.chen@....com>; Adrian Hunter
>> <adrian.hunter@...el.com>; Ulf Hansson <ulf.hansson@...aro.org>; Shawn Guo
>> <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>;
>> Pengutronix Kernel Team <kernel@...gutronix.de>; Fabio Estevam
>> <festevam@...il.com>
>> Cc: linux-kernel@...r.kernel.org; linux-mmc@...r.kernel.org;
>> imx@...ts.linux.dev; linux-arm-kernel@...ts.infradead.org; dl-S32
>> <S32@....com>; Ciprian Marian Costea (OSS)
>> <ciprianmarian.costea@....nxp.com>
>> Subject: [PATCH 3/4] mmc: sdhci-esdhc-imx: add option to not change pinctrl
>> state in suspend
>>
>> On some boards such as S32G based, changing the pinctrl state in suspend
>> routine may not be supported.
> 
> If so, why not dop the "sleep" pinctrl in device tree file?
> 
> Best Regards
> Haibo Chen

Thanks for this suggestion. I verified and pinctrl node is not yet 
upstream'ed for S32G2/S32G3 SoC.
Indeed, 'pinctrl_pm_select_sleep_state' would not report any errors in 
case 'sleep' pinctrl is not defined in the device tree file.
I will drop this commit in version 2 of this patchset.

Best Regards,
Ciprian

>>
>> For this scenario the newly introduced flag 'ESDHC_FLAG_SKIP_PINCTRL_SLEEP'
>> is used.
>>
>> Signed-off-by: Ciprian Costea <ciprianmarian.costea@....nxp.com>
>> ---
>>   drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++++----
>>   1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
>> b/drivers/mmc/host/sdhci-esdhc-imx.c
>> index 8f0bc6dca2b0..c3ff7fccd051 100644
>> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
>> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
>> @@ -204,6 +204,9 @@
>>   /* The IP does not have GPIO CD wake capabilities */
>>   #define ESDHC_FLAG_SKIP_CD_WAKE		BIT(18)
>>
>> +/* The IP does not support transition to pinctrl sleep state */ #define
>> +ESDHC_FLAG_SKIP_PINCTRL_SLEEP  BIT(19)
>> +
>>   enum wp_types {
>>   	ESDHC_WP_NONE,		/* no WP, neither controller nor gpio */
>>   	ESDHC_WP_CONTROLLER,	/* mmc controller internal WP */
>> @@ -301,7 +304,8 @@ static struct esdhc_soc_data usdhc_s32g2_data = {
>>   	.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
>>   			| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
>>   			| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
>> -			| ESDHC_FLAG_SKIP_ERR004536 |
>> ESDHC_FLAG_SKIP_CD_WAKE,
>> +			| ESDHC_FLAG_SKIP_ERR004536 |
>> ESDHC_FLAG_SKIP_CD_WAKE
>> +			| ESDHC_FLAG_SKIP_PINCTRL_SLEEP,
>>   };
>>
>>   static struct esdhc_soc_data usdhc_imx7ulp_data = { @@ -1884,9 +1888,11
>> @@ static int sdhci_esdhc_suspend(struct device *dev)
>>   	if (ret)
>>   		return ret;
>>
>> -	ret = pinctrl_pm_select_sleep_state(dev);
>> -	if (ret)
>> -		return ret;
>> +	if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_PINCTRL_SLEEP)) {
>> +		ret = pinctrl_pm_select_sleep_state(dev);
>> +		if (ret)
>> +			return ret;
>> +	}
>>
>>   	ret = mmc_gpio_set_cd_wake(host->mmc, true);
>>
>> --
>> 2.45.2
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ