Home
last modified time | relevance | path

Searched hist:fd51cf19 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/net/ethernet/ti/
H A Dcpsw.cfd51cf19 Tue Apr 23 02:31:37 CDT 2013 Sebastian Siewior <bigeasy@linutronix.de> net/cpsw: don't rely only on netif_running() to check which device is active

netif_running() reports false before the ->ndo_stop() callback is
called. That means if one executes "ifconfig down" and the system
receives an interrupt before the interrupt source has been disabled we
hang for always for two reasons:
- we never disable the interrupt source because devices claim to be
already inactive and don't feel responsible.
- since the ISR always reports IRQ_HANDLED the line is never deactivated
because it looks like the ISR feels responsible.

This patch changes the logic in the ISR a little:
- If none of the status registers reports an active source (RX or TX,
misc is ignored because it is not actived) we leave with IRQ_NONE.
- the interrupt is deactivated
- The first active network device is taken and napi is scheduled. If
none are active (a small race window between ndo_down() and the
interrupt the) then we leave and should not come back because the
source is off.
There is no need to schedule the second NAPI because both share the
same dma queue.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fd51cf19 Tue Apr 23 02:31:37 CDT 2013 Sebastian Siewior <bigeasy@linutronix.de> net/cpsw: don't rely only on netif_running() to check which device is active

netif_running() reports false before the ->ndo_stop() callback is
called. That means if one executes "ifconfig down" and the system
receives an interrupt before the interrupt source has been disabled we
hang for always for two reasons:
- we never disable the interrupt source because devices claim to be
already inactive and don't feel responsible.
- since the ISR always reports IRQ_HANDLED the line is never deactivated
because it looks like the ISR feels responsible.

This patch changes the logic in the ISR a little:
- If none of the status registers reports an active source (RX or TX,
misc is ignored because it is not actived) we leave with IRQ_NONE.
- the interrupt is deactivated
- The first active network device is taken and napi is scheduled. If
none are active (a small race window between ndo_down() and the
interrupt the) then we leave and should not come back because the
source is off.
There is no need to schedule the second NAPI because both share the
same dma queue.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>