[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH AUTOSEL for 4.15 104/124] clk: fix reentrancy of clk_enable() on UP systems
On Mon, Mar 19, 2018 at 10:55:16AM -0500, David Lechner wrote:
>On 03/19/2018 10:48 AM, Sasha Levin wrote:
>>From: David Lechner <>
>>[ Upstream commit a12aa8a68dfef5de181f2e555aa950a0ab05411f ]
>>Reentrant calls to clk_enable() are not working on UP systems. This is
>>caused by the fact spin_trylock_irqsave() always returns true when
>>CONFIG_SMP=n (and CONFIG_DEBUG_SPINLOCK=n) which causes the reference
>>counting to not work correctly when clk_enable_lock() is called twice
>>before clk_enable_unlock() is called (this happens when clk_enable()
>>is called from within another clk_enable()).
>>This fixes the problem by skipping the call to spin_trylock_irqsave() on UP
>>systems and relying solely on reference counting. We also make sure to set
>>flags in this case so that we are not returning an uninitialized value.
>>Suggested-by: Stephen Boyd <>
>>Signed-off-by: David Lechner <>
>>Signed-off-by: Stephen Boyd <>
>>Signed-off-by: Sasha Levin <>
>I don't know of any existing bugs in v4.15 that this fixes, so I don't
>think this really fits the criteria for stable.

I'll remove it, thanks David!


 \ /
  Last update: 2018-03-19 18:01    [W:1.045 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site