lkml.org 
[lkml]   [2019]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] irqchip: stm32: add a second level init to request hwspinlock
From
Date
On 07/03/2019 16:23, Fabien Dessenne wrote:
> Requesting hwspinlock, at the first time it is used, is not correct:
> indeed, at that moment we are under raw_spin_lock_irqsave() context and
> hwspin_lock_request_specific() may sleep ("BUG: sleeping function called
> from invalid context").
> Requesting hwspinlock during the init (stm32*_exti_of_init()) is also
> not possible (the hwspinlock framework is not ready at that stage of the
> kernel init).
> As a consequence, add a second level init (probed with arch_initcall)
> where we can safely request hwspinlock.

No, this is fairly broken. You're playing with stuff you're not supposed
to (OF_POPULATE? really?), and adding initcalls is completely unreliable
(things depend on the link order and will randomly break).

If you need dependencies, implement them correctly. Turn this driver
into a real device driver (in the platform device sense), and return
PROBE_DEFER when you can't find your dependency.

Thanks,

M.
--
Jazz is not dead. It just smells funny...

\
 
 \ /
  Last update: 2019-03-07 17:45    [W:0.046 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site