• Russell King - ARM Linux's avatar
    ARM: PL08x: fix deadlock in terminate_all · 98838f90
    Russell King - ARM Linux authored
    Trying to disable a tasklet while holding a spinlock which the tasklet
    will take is a recipe for deadlock - tasklet_disable() will wait for the
    tasklet to finish running, which it will never do.  In any case, there
    is not a corresponding tasklet_enable(), so once the tasklet is disabled,
    it will never run again until reboot.
    
    It's safe to just remove the tasklet_disable() as we remove all current
    and pending descriptors before releasing this spinlock.  This means that
    the tasklet will find no remaining work if it subsequently runs.
    
    The only remaining issue is that the callback for an already submitted
    txd may be in progress, or even called after terminate_all() returns.
    There's not much that can be done about that as waiting for the callback
    to complete before returning will also lead to deadlocks.
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Acked-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    98838f90
amba-pl08x.c 54.6 KB