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] [day] [month] [year] [list]
Message-ID: <CACPK8Xe55+_aOJD+dhpLrYfnw8_kjE-daXuRhu42p=O3K5Rztw@mail.gmail.com>
Date:   Thu, 8 Mar 2018 16:13:28 +1030
From:   Joel Stanley <joel@....id.au>
To:     Lei YU <mine260309@...il.com>
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 4:08 PM, Lei YU <mine260309@...il.com> wrote:
> 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;

Good suggestion.

We should also fix up aspeed_clk_is_enabled() for clocks that have
CLK_GATE_SET_TO_DISABLE set.

Cheers,

Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ