mirror of https://gitee.com/openkylin/linux.git
ipg: balance locking in irq handler
Spotted-by: <linux@horizon.com> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
This commit is contained in:
parent
d8c89eb3a1
commit
227bc24d67
|
@ -1630,6 +1630,8 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
|
||||||
#ifdef JUMBO_FRAME
|
#ifdef JUMBO_FRAME
|
||||||
ipg_nic_rxrestore(dev);
|
ipg_nic_rxrestore(dev);
|
||||||
#endif
|
#endif
|
||||||
|
spin_lock(&sp->lock);
|
||||||
|
|
||||||
/* Get interrupt source information, and acknowledge
|
/* Get interrupt source information, and acknowledge
|
||||||
* some (i.e. TxDMAComplete, RxDMAComplete, RxEarly,
|
* some (i.e. TxDMAComplete, RxDMAComplete, RxEarly,
|
||||||
* IntRequested, MacControlFrame, LinkEvent) interrupts
|
* IntRequested, MacControlFrame, LinkEvent) interrupts
|
||||||
|
@ -1647,9 +1649,7 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
|
||||||
handled = 1;
|
handled = 1;
|
||||||
|
|
||||||
if (unlikely(!netif_running(dev)))
|
if (unlikely(!netif_running(dev)))
|
||||||
goto out;
|
goto out_unlock;
|
||||||
|
|
||||||
spin_lock(&sp->lock);
|
|
||||||
|
|
||||||
/* If RFDListEnd interrupt, restore all used RFDs. */
|
/* If RFDListEnd interrupt, restore all used RFDs. */
|
||||||
if (status & IPG_IS_RFD_LIST_END) {
|
if (status & IPG_IS_RFD_LIST_END) {
|
||||||
|
@ -1733,9 +1733,9 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
|
||||||
ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE |
|
ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE |
|
||||||
IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE |
|
IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE |
|
||||||
IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE);
|
IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE);
|
||||||
|
out_unlock:
|
||||||
spin_unlock(&sp->lock);
|
spin_unlock(&sp->lock);
|
||||||
out:
|
|
||||||
return IRQ_RETVAL(handled);
|
return IRQ_RETVAL(handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue