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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3679d0b1171a9c097e496cb325c8898d6c6e5902.camel@pengutronix.de>
Date:   Mon, 02 May 2022 12:11:28 +0200
From:   Lucas Stach <l.stach@...gutronix.de>
To:     Viraj Shah <viraj.shah@...utronix.de>, shawnguo@...nel.org,
        s.hauer@...gutronix.de
Cc:     Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Peng Fan <peng.fan@....com>,
        Frieder Schrempf <frieder.schrempf@...tron.de>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/4] soc: imx8mm: gpcv2: Power sequence for DISP

Hi Viraj,

Am Montag, dem 02.05.2022 um 12:02 +0200 schrieb Viraj Shah:
> As per the imx8mm reference manual, read bit 25(GPC_DISPMIX_
> PWRDNACKN) of the power handshake register and wait for ack during
> power on/off.
> 
> Signed-off-by: Viraj Shah <viraj.shah@...utronix.de>
> ---
>  drivers/soc/imx/gpcv2.c | 36 +++++++++++++++++++++++++++++++-----
>  1 file changed, 31 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
> index 3cb123016b3e..8ee70c30964f 100644
> --- a/drivers/soc/imx/gpcv2.c
> +++ b/drivers/soc/imx/gpcv2.c
> @@ -254,11 +254,24 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
>  		/*
>  		 * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait
>  		 * for PUP_REQ/PDN_REQ bit to be cleared
> +		 *
> +		 * As per "5.2.9.5 Example Code 5" in i.MX-8MMini-yhsc.pdf
> +		 * Display power on section checks for bit 25 of
> +		 * Power handshake register to be cleared.
>  		 */
> -		ret = regmap_read_poll_timeout(domain->regmap,
> -					       GPC_PU_PGC_SW_PUP_REQ, reg_val,
> -					       !(reg_val & domain->bits.pxx),
> -					       0, USEC_PER_MSEC);
> +		if (domain->bits.pxx == IMX8MM_DISPMIX_SW_Pxx_REQ) {
> +			regmap_update_bits(domain->regmap, GPC_PU_PWRHSK,
> +				   BIT(7), BIT(7));
> +			ret = regmap_read_poll_timeout(domain->regmap,
> +						GPC_PU_PWRHSK, reg_val,
> +						!(reg_val & IMX8MM_DISPMIX_HSK_PWRDNACKN),
> +						0, USEC_PER_MSEC);
> +		} else
> +			ret = regmap_read_poll_timeout(domain->regmap,
> +						GPC_PU_PGC_SW_PUP_REQ, reg_val,
> +						!(reg_val & domain->bits.pxx),
> +						0, USEC_PER_MSEC);
> +
The driver already handles the PWRHSK bits at the appropriate places.
Please do not hack in random sequences from the reference manual for
specific domains. Also you can not wait for the handshake ack in the
power up sequence, as the blk-ctrl driver only enables the ADB clock,
_after_ the GPC power domain has been powered up, so there is no way
for it to so the handshake here. See the comments in the blk-ctrl
driver.

Regards,
Lucas

>  		if (ret) {
>  			dev_err(domain->dev, "failed to command PGC\n");
>  			goto out_clk_disable;
> @@ -355,11 +368,24 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd)
>  		/*
>  		 * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait
>  		 * for PUP_REQ/PDN_REQ bit to be cleared
> +		 *
> +		 * As per "5.2.9.5 Example Code 5" in i.MX-8MMini-yhsc.pdf
> +		 * Display power on section checks for bit 25 of
> +		 * Power handshake register to be set.
>  		 */
> -		ret = regmap_read_poll_timeout(domain->regmap,
> +		if (domain->bits.pxx == IMX8MM_DISPMIX_SW_Pxx_REQ) {
> +			regmap_clear_bits(domain->regmap, GPC_PU_PWRHSK,
> +				   BIT(7));
> +			ret = regmap_read_poll_timeout(domain->regmap,
> +						GPC_PU_PWRHSK, reg_val,
> +						!(reg_val & IMX8MM_DISPMIX_HSK_PWRDNACKN),
> +						0, USEC_PER_MSEC);
> +		} else {
> +			ret = regmap_read_poll_timeout(domain->regmap,
>  					       GPC_PU_PGC_SW_PDN_REQ, reg_val,
>  					       !(reg_val & domain->bits.pxx),
>  					       0, USEC_PER_MSEC);
> +		}
>  		if (ret) {
>  			dev_err(domain->dev, "failed to command PGC\n");
>  			goto out_clk_disable;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ