mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 20:06:38 +07:00
skge napi->poll() locking bug
According to: Documentation/networking/netdevices.txt: <cite> napi->poll: .......... Context: softirq will be called with interrupts disabled by netconsole. </cite> napi->poll() could be called either with interrupts enabled (in softirq context) or disabled (by netconsole), so the irq flag should be preserved. Inspired by Ingo's resent forcedeth patch :-) Signed-off-by: Marin Mitov <mitov@issp.bas.bg> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
9f5e60dd5f
commit
6ef2977d41
@ -3199,12 +3199,14 @@ static int skge_poll(struct napi_struct *napi, int to_do)
|
|||||||
skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START);
|
skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START);
|
||||||
|
|
||||||
if (work_done < to_do) {
|
if (work_done < to_do) {
|
||||||
spin_lock_irq(&hw->hw_lock);
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&hw->hw_lock, flags);
|
||||||
__netif_rx_complete(dev, napi);
|
__netif_rx_complete(dev, napi);
|
||||||
hw->intr_mask |= napimask[skge->port];
|
hw->intr_mask |= napimask[skge->port];
|
||||||
skge_write32(hw, B0_IMSK, hw->intr_mask);
|
skge_write32(hw, B0_IMSK, hw->intr_mask);
|
||||||
skge_read32(hw, B0_IMSK);
|
skge_read32(hw, B0_IMSK);
|
||||||
spin_unlock_irq(&hw->hw_lock);
|
spin_unlock_irqrestore(&hw->hw_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return work_done;
|
return work_done;
|
||||||
|
Loading…
Reference in New Issue
Block a user