linux/drivers/net/ethernet/ti
Felipe Balbi 7ce67a38f7 net: ethernet: cpsw: fix hangs with interrupts
The CPSW IP implements pulse-signaled interrupts. Due to
that we must write a correct, pre-defined value to the
CPDMA_MACEOIVECTOR register so the controller generates
a pulse on the correct IRQ line to signal the End Of
Interrupt.

The way the driver is written today, all four IRQ lines
are requested using the same IRQ handler and, because of
that, we could fall into situations where a TX IRQ fires
but we tell the controller that we ended an RX IRQ (or
vice-versa). This situation triggers an IRQ storm on the
reserved IRQ 127 of INTC which will in turn call ack_bad_irq()
which will, then, print a ton of:

	unexpected IRQ trap at vector 00

In order to fix the problem, we are moving all calls to
cpdma_ctlr_eoi() inside the IRQ handler and making sure
we *always* write the correct value to the CPDMA_MACEOIVECTOR
register. Note that the algorithm assumes that IRQ numbers and
value-to-be-written-to-EOI are proportional, meaning that a
write of value 0 would trigger an EOI pulse for the RX_THRESHOLD
Interrupt and that's the IRQ number sitting in the 0-th index
of our irqs_table array.

This, however, is safe at least for current implementations of
CPSW so we will refrain from making the check smarter (and, as
a side-effect, slower) until we actually have a platform where
IRQ lines are swapped.

This patch has been tested for several days with AM335x- and
AM437x-based platforms. AM57x was left out because there are
still pending patches to enable ethernet in mainline for that
platform. A read of the TRM confirms the statement on previous
paragraph.

Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Fixes: 510a1e7 (drivers: net: davinci_cpdma: acknowledge interrupt properly)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-04 22:18:34 -05:00
..
Kconfig drivers: net : cpsw: Update Kconfig for CPSW 2014-12-09 13:44:16 -05:00
Makefile drivers: net: cpsw-phy-sel: Add new driver for phy mode selection for cpsw 2013-09-24 10:33:07 -04:00
cpmac.c ethernet: ti: remove unwanted THIS_MODULE macro 2014-09-09 11:59:14 -07:00
cpsw-phy-sel.c ethernet: ti: remove unwanted THIS_MODULE macro 2014-09-09 11:59:14 -07:00
cpsw.c net: ethernet: cpsw: fix hangs with interrupts 2015-01-04 22:18:34 -05:00
cpsw.h net: cpsw: header, Add missing include 2014-09-30 01:30:43 -04:00
cpsw_ale.c drivers: net: cpsw: remove cpsw_ale_stop from cpsw_ale_destroy 2014-11-06 14:58:04 -05:00
cpsw_ale.h drivers: net: cpsw: Support ALLMULTI and fix IFF_PROMISC in switch mode 2014-10-31 16:17:56 -04:00
cpts.c net: ptp: fix time stamp matching logic for VLAN packets. 2014-11-12 15:06:17 -05:00
cpts.h ti: Remove extern from function prototypes 2013-09-24 12:54:10 -07:00
davinci_cpdma.c drivers: net: davinci_cpdma: remove spinlock as SOFTIRQ-unsafe lock order detected 2014-10-14 15:59:38 -04:00
davinci_cpdma.h net/davinci_cpdma: remove unused argument in cpdma_chan_submit() 2013-04-25 04:11:50 -04:00
davinci_emac.c ethernet: ti: remove unwanted THIS_MODULE macro 2014-09-09 11:59:14 -07:00
davinci_mdio.c ethernet: ti: remove unwanted THIS_MODULE macro 2014-09-09 11:59:14 -07:00
tlan.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
tlan.h tlan: Don't scream if no link 2014-07-07 17:06:52 -07:00