• Felix Fietkau's avatar
    ath9k: fix race condition in enabling/disabling IRQs · 662f7372
    Felix Fietkau authored
    commit 3a5e969b upstream.
    
    The code currently relies on refcounting to disable IRQs from within the
    IRQ handler and re-enabling them again after the tasklet has run.
    
    However, due to race conditions sometimes the IRQ handler might be
    called twice, or the tasklet may not run at all (if interrupted in the
    middle of a reset).
    
    This can cause nasty imbalances in the irq-disable refcount which will
    get the driver permanently stuck until the entire radio has been stopped
    and started again (ath_reset will not recover from this).
    
    Instead of using this fragile logic, change the code to ensure that
    running the irq handler during tasklet processing is safe, and leave the
    refcount untouched.
    Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
    Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
    [bwh: Backported to 3.16: adjust context]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    662f7372
mac.h 21.4 KB