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: <f0eb6a1ac2e3a03c4cc742f45cdd9cb91537ff4d.camel@mediatek.com>
Date:   Mon, 31 May 2021 19:36:12 +0800
From:   Chun-Jie Chen <chun-jie.chen@...iatek.com>
To:     Hsin-Yi Wang <hsinyi@...omium.org>,
        Matthias Brugger <matthias.bgg@...il.com>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, "Rob Herring" <robh+dt@...nel.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        <chun-jie.chen@...iatek.corp-partner.google.com>,
        Yong Wu <yong.wu@...iatek.com>
Subject: Re: [PATCH 2/3] soc: mtk-pm-domains: do not register smi node as
 syscon

On Mon, 2021-05-31 at 12:35 +0800, Hsin-Yi Wang wrote:
> Mediatek requires mmsys clocks to be unprepared during suspend,
> otherwise system has chances to hang.
> 
> syscon_regmap_lookup_by_phandle_optional() will attach and prepare
> the
> first clock in smi node, leading to additional prepare to the clock
> which is not balanced with the prepare/unprepare pair in
> resume/suspend
> callbacks.
> 
> If a power domain node requests an smi node and the smi node's first
> clock is an mmsys clock, it will results in an unstabke suspend
> resume.
> 
> Signed-off-by: Hsin-Yi Wang <hsinyi@...omium.org>

Reviewed-by: chun-jie.chen <chun-jie.chen@...iatek.com>

> ---
>  drivers/soc/mediatek/mtk-pm-domains.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pm-domains.c
> b/drivers/soc/mediatek/mtk-pm-domains.c
> index 536d8c64b2b4..a9ba71eee4bb 100644
> --- a/drivers/soc/mediatek/mtk-pm-domains.c
> +++ b/drivers/soc/mediatek/mtk-pm-domains.c
> @@ -296,7 +296,7 @@ generic_pm_domain *scpsys_add_one_domain(struct
> scpsys *scpsys, struct device_no
>  {
>  	const struct scpsys_domain_data *domain_data;
>  	struct scpsys_domain *pd;
> -	struct device_node *root_node = scpsys->dev->of_node;
> +	struct device_node *root_node = scpsys->dev->of_node,
> *smi_node;
>  	struct property *prop;
>  	const char *clk_name;
>  	int i, ret, num_clks;
> @@ -352,9 +352,13 @@ generic_pm_domain *scpsys_add_one_domain(struct
> scpsys *scpsys, struct device_no
>  	if (IS_ERR(pd->infracfg))
>  		return ERR_CAST(pd->infracfg);
>  
> -	pd->smi = syscon_regmap_lookup_by_phandle_optional(node,
> "mediatek,smi");
> -	if (IS_ERR(pd->smi))
> -		return ERR_CAST(pd->smi);
> +	smi_node = of_parse_phandle(node, "mediatek,smi", 0);
> +	if (smi_node) {
> +		pd->smi = device_node_to_regmap(smi_node);
> +		of_node_put(smi_node);
> +		if (IS_ERR(pd->smi))
> +			return ERR_CAST(pd->smi);
> +	}
>  
>  	num_clks = of_clk_get_parent_count(node);
>  	if (num_clks > 0) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ