linux/drivers
Felipe Balbi 101521692f net: ethernet: cpsw: fix hangs with interrupts
commit 7ce67a38f7 upstream.

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)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-01-16 14:34:22 +00:00
..
accessibility printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
acpi ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up 2014-12-01 10:26:07 +00:00
amba ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
ata ahci: disable MSI on SAMSUNG 0xa800 SSD 2014-12-10 17:49:44 +00:00
atm atm: fore200e.c: Cleaning up uninitialized variables 2014-06-02 17:11:03 -07:00
auxdisplay framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
base driver core: Fix unbalanced device reference in drivers_probe 2015-01-05 13:48:40 +00:00
bcma bcma: gpio: register 32 GPIOs on BCM5357 2014-03-27 14:20:04 -04:00
block drbd: merge_bvec_fn: properly remap bvm->bi_bdev 2015-01-05 13:48:41 +00:00
bluetooth Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device 2015-01-12 15:44:04 +00:00
bus bus/arm-cci: add dependency on OF && CPU_V7 2014-06-17 17:09:35 +02:00
cdrom Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2014-06-11 08:41:17 -07:00
char hwrng: pseries - port to new read API and fix stack corruption 2014-11-27 11:21:35 +00:00
clk clk: samsung: Fix double add of syscore ops after driver rebind 2015-01-15 10:44:19 +00:00
clocksource clocksource: arch_timer: Fix code to use physical timers when requested 2015-01-15 10:43:32 +00:00
connector Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00
cpufreq cpufreq: Avoid crash in resume on SMP without OPP 2014-11-27 11:21:38 +00:00
cpuidle powerpc/cpuidle: Fix parsing of idle state flags from device-tree 2014-09-17 09:21:55 -07:00
crypto crypto: caam - remove duplicated sg copy functions 2014-11-27 11:22:03 +00:00
dca dca: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
devfreq PM / devfreq: remove checks for CONFIG_EXYNOS_ASV 2014-05-24 22:33:51 +09:00
dio m68k: don't export static inline functions 2009-12-06 11:18:28 +01:00
dma dmaengine: dw: don't perform DMA when dmaengine_submit is called 2014-10-05 13:41:11 -07:00
edac e7xxx_edac: Report CE events properly 2014-11-13 11:48:39 +00:00
eisa Revert "EISA: Initialize device before its resources" 2014-01-17 14:57:29 -07:00
extcon extcon: palmas: Use devm_extcon_dev_allocate for extcon_dev 2014-04-29 09:52:12 +09:00
firewire firewire: cdev: prevent kernel stack leaking into ioctl arguments 2014-11-27 11:21:52 +00:00
firmware firmware: Do not use WARN_ON(!spin_is_locked()) 2014-09-17 09:21:52 -07:00
fmc Merge 3.14-rc5 into char-misc-next 2014-03-02 19:53:09 -08:00
gpio gpio: Fix potential NULL handler data in chained irqchip handler 2014-10-05 13:41:06 -07:00
gpu drm/nv4c/mc: disable msi 2015-01-15 22:41:20 +00:00
hid HID: i2c-hid: prevent buffer overflow in early IRQ 2015-01-15 10:44:00 +00:00
hsi hsi: omap_ssi_port: use normal module refcounting 2014-06-05 00:59:05 +02:00
hv Drivers: hv: vmbus: Fix a race condition when unregistering a device 2015-01-05 13:48:39 +00:00
hwmon hwmon: (ds1621) Update zbits after conversion rate change 2014-10-05 13:41:06 -07:00
hwspinlock A single patch from Vincent extending OMAP's hwspinlock support to OMAP5. 2013-05-07 14:01:27 -07:00
i2c i2c: mv64xxx: rework offload support to fix several problems 2015-01-15 10:44:39 +00:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide 2014-07-21 22:44:24 -07:00
idle intel_idle: fix IVT idle state table setting 2014-04-21 23:36:07 +02:00
iio iio: adc: men_z188_adc: Add terminating entry for men_z188_ids 2014-12-04 14:36:31 +00:00
infiniband iscsi,iser-target: Expose supported protection ops according to t10_pi 2015-01-15 10:44:30 +00:00
input drivers/input/evdev.c: don't kfree() a vmalloc address 2014-12-10 17:49:43 +00:00
iommu iommu/vt-d: Fix an off-by-one bug in __domain_mapping() 2015-01-12 15:44:11 +00:00
ipack ipack: convert bus code to use dev_groups 2013-10-16 18:40:57 -07:00
irqchip irqchip: armada-370-xp: Fix MPIC interrupt handling 2014-11-14 15:19:55 +00:00
isdn isdn/bas_gigaset: fix a leak on failure path in gigaset_probe() 2014-07-29 12:18:34 -07:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-06-12 13:08:09 -07:00
lguest drivers/lguest/page_tables.c: rename do_set_pte() 2014-04-07 16:35:52 -07:00
macintosh powerpc/macintosh/smu.c: Fix closing brace followed by if 2014-06-24 12:43:15 +10:00
mailbox drivers/mailbox/omap: make mbox->irq signed for error handling 2014-01-23 16:36:53 -08:00
mcb mcb: Add support for shared PCI IRQs 2014-05-27 17:38:11 -07:00
md dm: fix missed error code if .end_io isn't implemented by target_type 2015-01-15 10:44:38 +00:00
media [media] img-ir/hw: Fix potential deadlock stopping timer 2015-01-15 10:43:30 +00:00
memory memory: mvebu-devbus: add a devbus, keep-config property 2014-04-29 13:17:10 +00:00
memstick drivers/memstick/host/rtsx_pci_ms.c: add cancel_work when remove driver 2014-06-23 16:47:44 -07:00
message mptfusion: enable no_write_same for vmware scsi disks 2014-10-30 09:40:12 -07:00
mfd mfd: tc6393xb: Fail ohci suspend if full state restore is required 2015-01-12 15:44:02 +00:00
misc misc: genwqe: check for error from get_user_pages_fast() 2015-01-05 13:48:39 +00:00
mmc mmc: sdhci-pci-o2micro: Fix Dell E5440 issue 2015-01-15 10:44:14 +00:00
mtd mtd: tests: abort torturetest on erase errors 2015-01-15 10:44:05 +00:00
net net: ethernet: cpsw: fix hangs with interrupts 2015-01-16 14:34:22 +00:00
nfc NFC: microread: Potential overflows in microread_target_discovered() 2014-10-05 13:41:05 -07:00
ntb ntb: Use pci_enable_msix_range() instead of pci_enable_msix() 2014-04-07 10:59:20 -07:00
nubus kernel/printk: use symbolic defines for console loglevels 2014-06-04 16:54:17 -07:00
of of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap 2014-12-10 17:49:37 +00:00
oprofile oprofile, nmi-timer: Fix CPU hotplug callback registration 2014-03-20 13:43:46 +01:00
parisc PCI changes for the v3.12 merge window: 2013-09-03 16:24:35 -07:00
parport parport: fix menu breakage 2014-07-25 18:00:23 -07:00
pci PCI: Restore detection of read-only BARs 2015-01-05 13:48:41 +00:00
pcmcia pcmcia: Use pci_is_bridge() to simplify code 2014-05-27 14:58:24 -06:00
phy phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly 2014-11-14 15:19:59 +00:00
pinctrl pinctrl: baytrail: show output gpio state correctly on Intel Baytrail 2014-11-14 15:19:54 +00:00
platform platform/chrome: Add support for the acer c720p touchscreen. 2015-01-15 10:44:57 +00:00
pnp ACPI / PNP: Fix acpi_pnp_match() 2014-07-30 00:23:09 +02:00
power power: charger-manager: Fix accessing invalidated power supply after charger unbind 2014-11-20 12:01:50 +00:00
powercap powercap / RAPL: add support for CPU model 0x3f 2015-01-15 10:44:49 +00:00
pps drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr 2013-11-13 12:09:35 +09:00
ps3 ps3-vuart: don't use PREPARE_WORK 2014-03-07 10:24:48 -05:00
ptp ptp: ptp_pch depends on x86_32 2014-06-17 15:43:48 -07:00
pwm pwm: Fix period and polarity in pwm_get() for non-perfect matches 2014-10-05 13:40:52 -07:00
rapidio rapidio/tsi721_dma: fix failure to obtain transaction descriptor 2014-07-30 17:16:13 -07:00
regulator regulator: anatop: Set default voltage selector for vddpu 2015-01-05 13:33:40 +00:00
remoteproc remoteproc: da8xx: don't select CMA on no-MMU 2014-06-17 17:09:36 +02:00
reset ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
rpmsg A small pull request consisting of: 2013-05-07 14:02:00 -07:00
rtc rtc: omap: fix missing wakealarm attribute 2015-01-15 10:43:53 +00:00
s390 s390/3215: fix tty output containing tabs 2015-01-05 10:15:52 +00:00
sbus bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 2014-08-14 10:09:44 +08:00
scsi SCSI: fix regression in scsi_send_eh_cmnd() 2015-01-16 14:34:21 +00:00
sfi SFI / ACPI: Fix warnings reported during builds with W=1 2013-12-07 01:24:33 +01:00
sh SH Driver Update for v3.16 2014-06-06 11:44:09 -07:00
sn Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
soc soc: qcom: fix of_device_id table 2014-05-26 21:27:09 +02:00
spi spi: sh-msiof: Add runtime PM lock in initializing 2015-01-15 22:41:19 +00:00
spmi spmi: pm: drop bus-level PM suspend/resume routines 2014-03-08 22:15:52 -08:00
ssb Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-01-30 17:20:32 -08:00
staging move d_rcu from overlapping d_child to overlapping d_alias 2015-01-15 10:44:58 +00:00
target iscsi-target: Fail connection on short sendmsg writes 2015-01-15 10:44:34 +00:00
tc TC: Handle device_register() errors. 2014-06-26 10:48:23 +01:00
thermal tick/powerclamp: Remove tick_nohz_idle abuse 2015-01-15 10:44:41 +00:00
tty n_tty: Fix read_buf race condition, increment read_head after pushing data 2015-01-12 15:44:05 +00:00
uio Revert "uio: fix vma io range check in mmap" 2014-06-17 16:07:08 -07:00
usb USB: cdc-acm: check for valid interfaces 2015-01-12 15:43:59 +00:00
uwb uwb: init beacon cache entry before registering uwb device 2014-10-05 13:40:58 -07:00
vfio A handful of VFIO bug fixes for v3.16 2014-06-07 20:12:15 -07:00
vhost vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT 2014-12-01 10:02:11 +00:00
video video/fbdev: fix defio's fsync 2015-01-16 14:34:19 +00:00
virt drivers: clean-up prom.h implicit includes 2013-10-09 20:04:04 -05:00
virtio virtio_pci: fix virtio spec compliance on restore 2014-11-17 14:11:41 +00:00
vlynq drivers/vlynq/vlynq.c: fix another resource size off by 1 error 2014-01-23 16:36:55 -08:00
vme vme_tsi148: Utilize to_pci_dev() macro 2014-04-16 14:08:37 -07:00
w1 w1: mxc_w1: Fix incorrect "presence" status 2014-06-19 17:51:46 -07:00
watchdog Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-06-21 06:47:01 -10:00
xen swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single 2015-01-15 10:43:29 +00:00
zorro zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h> 2013-11-26 11:09:09 +01:00
Kconfig soc: Introduce drivers/soc place-holder for SOC specific drivers 2014-05-23 11:37:46 -05:00
Makefile Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00