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: <674eb592-ec2a-0ff9-bbf5-eb4f0aff4251@foss.st.com>
Date:   Mon, 20 Dec 2021 09:42:43 +0100
From:   Patrice CHOTARD <patrice.chotard@...s.st.com>
To:     Alain Volmat <avolmat@...com>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Rob Herring <robh+dt@...nel.org>
CC:     Lee Jones <lee.jones@...aro.org>, <linux-clk@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 2/2] clk: st: clkgen-mux: search reg within node or
 parent

Hi Alain

On 12/18/21 10:11 PM, Alain Volmat wrote:
> In order to avoid having duplicated addresses within the DT,
> only have one unit-address per clockgen and each driver within
> the clockgen should look at the parent node (overall clockgen)
> to figure out the reg property.  Such behavior is already in
> place in other STi platform clock drivers such as clk-flexgen
> and clkgen-pll.  Keep backward compatibility by first looking
> at reg within the node before looking into the parent node.
> 
> Signed-off-by: Alain Volmat <avolmat@...com>
> ---
> v2: identical to v1
> 
>  drivers/clk/st/clkgen-mux.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c
> index ce583ded968a..ee39af7a0b72 100644
> --- a/drivers/clk/st/clkgen-mux.c
> +++ b/drivers/clk/st/clkgen-mux.c
> @@ -57,10 +57,17 @@ static void __init st_of_clkgen_mux_setup(struct device_node *np,
>  	const char **parents;
>  	int num_parents = 0;
>  
> +	/*
> +	 * First check for reg property within the node to keep backward
> +	 * compatibility, then if reg doesn't exist look at the parent node
> +	 */
>  	reg = of_iomap(np, 0);
>  	if (!reg) {
> -		pr_err("%s: Failed to get base address\n", __func__);
> -		return;
> +		reg = of_iomap(of_get_parent(np), 0);
> +		if (!reg) {
> +			pr_err("%s: Failed to get base address\n", __func__);
> +			return;
> +		}
>  	}
>  
>  	parents = clkgen_mux_get_parents(np, &num_parents);
> 

Reviewed-by: Patrice Chotard <patrice.chotard@...s.st.com>
Thanks
Patrice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ