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:   Thu, 8 Mar 2018 13:38:47 +0800
From:   Lei YU <mine260309@...il.com>
To:     Joel Stanley <joel@....id.au>
Cc:     Eddie James <eajames@...ux.vnet.ibm.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-clk@...r.kernel.org,
        Michael Turquette <mturquette@...libre.com>, sboyd@...nel.org,
        Ryan Chen <ryan_chen@...eedtech.com>
Subject: Re: [PATCH] clk: aspeed: Prevent reset if clock is enabled

On Thu, Mar 8, 2018 at 11:42 AM, Joel Stanley <joel@....id.au> wrote:
>> +       /* Only reset/enable/unreset if clock is stopped */
>> +       regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, &reg);
>> +       if (!(reg & clk))
>> +               return 0;
>
> This doesn't generalise to all of the clocks, as some clocks use set
> to disable. Perhaps we could do something like this:
>
>        /* Only reset/enable/unreset if clock is stopped. The LPC clock
> on ast2500 has issues otherwise */
>        enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk;
>        regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, &reg);
>        if ((reg & clk) == enval) {
>                spin_unlock_irqrestore(gate->lock, flags);
>                return 0;
>        }
>
> I think we should also do this operation under the lock.
>
> Please cc Ryan Chen <ryan_chen@...eedtech.com> so he can confirm that
> this workaround is valid, and credit Lei who spent a lot of time
> investigating this issue. Perhaps "Root-caused-by".
>

The code has aspeed_clk_is_enabled() already, why not just:

    if (aspeed_clk_is_enabled(hw))
        return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ