• Helmut Schaa's avatar
    rt2x00: Fix PCI interrupt processing race on SMP systems · abc11994
    Helmut Schaa authored
    When toggle_irq is called for PCI devices to disable device interrupts
    it used tasklet_disable to wait for a possibly running tasklet to finish.
    However, on SMP systems the tasklet might still be scheduled on another CPU.
    Instead, use tasklet_kill to ensure that all scheduled tasklets are finished
    before returning from toggle_irq.
    
    Furthermore, it was possible that a tasklet reenabled its interrupt even
    though interrupts have been disabled already. Fix this by checking the
    DEVICE_STATE_ENABLED_RADIO flag before reenabling single interrupts
    during tasklet processing.
    
    While at it also enable/kill the TBTT and PRETBTT tasklets in the
    toggle_irq callback and only use tasklet_kill in stop_queue to wait
    for a currently scheduled beacon update before returning.
    Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
    Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    abc11994
rt2x00dev.c 31.9 KB