[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFrUyEfSsEdjfXGLX5NJuWaGNBZg1D+kCR=EikG42_eL0w@mail.gmail.com>
Date: Wed, 14 Aug 2024 15:00:52 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
festevam@...il.com, imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Peng Fan <peng.fan@....com>, Stable@...r.kernel.org, Jacky Bai <ping.bai@....com>
Subject: Re: [PATCH V2] pmdomain: imx: wait SSAR when i.MX93 power domain on
On Wed, 14 Aug 2024 at 14:38, Peng Fan (OSS) <peng.fan@....nxp.com> wrote:
>
> From: Peng Fan <peng.fan@....com>
>
> With "quiet" set in bootargs, there is power domain failure:
> "imx93_power_domain 44462400.power-domain: pd_off timeout: name:
> 44462400.power-domain, stat: 4"
>
> The current power on opertation takes ISO state as power on finished
> flag, but it is wrong. Before powering on operation really finishes,
> powering off comes and powering off will never finish because the last
> powering on still not finishes, so the following powering off actually
> not trigger hardware state machine to run. SSAR is the last step when
> powering on a domain, so need to wait SSAR done when powering on.
>
> Since EdgeLock Enclave(ELE) handshake is involved in the flow, enlarge
> the waiting time to 10ms for both on and off to avoid timeout.
>
> Cc: <Stable@...r.kernel.org>
> Fixes: 0a0f7cc25d4a ("soc: imx: add i.MX93 SRC power domain driver")
> Reviewed-by: Jacky Bai <ping.bai@....com>
> Signed-off-by: Peng Fan <peng.fan@....com>
Applied for fixes, thanks!
Kind regards
Uffe
> ---
>
> V2:
> Add Fixes tag and Cc stable (Per Ulf's comment)
>
> drivers/pmdomain/imx/imx93-pd.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c
> index 1e94b499c19b..d750a7dc58d2 100644
> --- a/drivers/pmdomain/imx/imx93-pd.c
> +++ b/drivers/pmdomain/imx/imx93-pd.c
> @@ -20,6 +20,7 @@
> #define FUNC_STAT_PSW_STAT_MASK BIT(0)
> #define FUNC_STAT_RST_STAT_MASK BIT(2)
> #define FUNC_STAT_ISO_STAT_MASK BIT(4)
> +#define FUNC_STAT_SSAR_STAT_MASK BIT(8)
>
> struct imx93_power_domain {
> struct generic_pm_domain genpd;
> @@ -50,7 +51,7 @@ static int imx93_pd_on(struct generic_pm_domain *genpd)
> writel(val, addr + MIX_SLICE_SW_CTRL_OFF);
>
> ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val,
> - !(val & FUNC_STAT_ISO_STAT_MASK), 1, 10000);
> + !(val & FUNC_STAT_SSAR_STAT_MASK), 1, 10000);
> if (ret) {
> dev_err(domain->dev, "pd_on timeout: name: %s, stat: %x\n", genpd->name, val);
> return ret;
> @@ -72,7 +73,7 @@ static int imx93_pd_off(struct generic_pm_domain *genpd)
> writel(val, addr + MIX_SLICE_SW_CTRL_OFF);
>
> ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val,
> - val & FUNC_STAT_PSW_STAT_MASK, 1, 1000);
> + val & FUNC_STAT_PSW_STAT_MASK, 1, 10000);
> if (ret) {
> dev_err(domain->dev, "pd_off timeout: name: %s, stat: %x\n", genpd->name, val);
> return ret;
> --
> 2.37.1
>
Powered by blists - more mailing lists