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]
Date:   Wed, 25 Jul 2018 09:40:34 -0700
From:   Stephen Boyd <sboyd@...nel.org>
To:     Rajan Vaja <rajan.vaja@...inx.com>, mturquette@...libre.com
Cc:     linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        Rajan Vaja <rajan.vaja@...inx.com>
Subject: Re: [PATCH] clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure

Quoting Rajan Vaja (2018-07-17 06:17:00)
> Fixed factor clock has two initializations at of_clk_init() time
> and during platform driver probe. Before of_clk_init() call,
> node is marked as populated and so its probe never gets called.
> 
> During of_clk_init() fixed factor clock registration may fail if
> any of its parent clock is not registered. In this case, it doesn't
> get chance to retry registration from probe. Clear OF_POPULATED
> flag if fixed factor clock registration fails so that clock
> registration is attempted again from probe.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@...inx.com>
> ---
>  drivers/clk/clk-fixed-factor.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
> index d72ef2d..f3ae4ff 100644
> --- a/drivers/clk/clk-fixed-factor.c
> +++ b/drivers/clk/clk-fixed-factor.c
> @@ -177,8 +177,15 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)
> 
>         clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags,
>                                         mult, div);
> -       if (IS_ERR(clk))
> +       if (IS_ERR(clk)) {
> +               /*
> +                * If parent clock is not registered, registration would fail.
> +                * Clear OF_POPULATED flag so that clock registration can be
> +                * attempted again from probe function.
> +                */
> +               of_node_clear_flag(node, OF_POPULATED);
>                 return clk;
> +       }

BTW, this patch was seriously mangled for me so I had to apply it by
hand. Please be more careful next time and consider using something like
git-send-email and git-format-patch to send patches.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ