Revision 6a146f3a5894b751cef16feb3d7903e45e3c445c authored by Guilherme G. Piccoli on 10 July 2017, 13:55:46 UTC, committed by David S. Miller on 11 July 2017, 20:40:22 UTC
Since the introduction of ULD (Upper-Layer Drivers), the MSI-X
deallocating path changed in cxgb4: the driver frees the interrupts
of ULD when unregistering it or on shutdown PCI handler.

Problem is that if a MSI-X is not freed before deallocated in the PCI
layer, it will trigger a BUG() due to still "alive" interrupt being
tentatively quiesced.

The below trace was observed when doing a simple unbind of Chelsio's
adapter PCI function, like:
  "echo 001e:80:00.4 > /sys/bus/pci/drivers/cxgb4/unbind"

Trace:

  kernel BUG at drivers/pci/msi.c:352!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP [c0000000005a5e60] free_msi_irqs+0xa0/0x250
  LR [c0000000005a5e50] free_msi_irqs+0x90/0x250
  Call Trace:
  [c0000000005a5e50] free_msi_irqs+0x90/0x250 (unreliable)
  [c0000000005a72c4] pci_disable_msix+0x124/0x180
  [d000000011e06708] disable_msi+0x88/0xb0 [cxgb4]
  [d000000011e06948] free_some_resources+0xa8/0x160 [cxgb4]
  [d000000011e06d60] remove_one+0x170/0x3c0 [cxgb4]
  [c00000000058a910] pci_device_remove+0x70/0x110
  [c00000000064ef04] device_release_driver_internal+0x1f4/0x2c0
  ...

This patch fixes the issue by refactoring the shutdown path of ULD on
cxgb4 driver, by properly freeing and disabling interrupts on PCI
remove handler too.

Fixes: 0fbc81b3ad51 ("Allocate resources dynamically for all cxgb4 ULD's")
Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 91d1ae4
History
File Mode Size
Makefile -rw-r--r-- 1.1 KB
datagram.c -rw-r--r-- 20.3 KB
dev.c -rw-r--r-- 216.1 KB
dev_addr_lists.c -rw-r--r-- 20.8 KB
dev_ioctl.c -rw-r--r-- 12.9 KB
devlink.c -rw-r--r-- 70.0 KB
drop_monitor.c -rw-r--r-- 10.2 KB
dst.c -rw-r--r-- 7.8 KB
dst_cache.c -rw-r--r-- 3.7 KB
ethtool.c -rw-r--r-- 70.7 KB
fib_rules.c -rw-r--r-- 22.2 KB
filter.c -rw-r--r-- 100.4 KB
flow.c -rw-r--r-- 12.7 KB
flow_dissector.c -rw-r--r-- 32.5 KB
gen_estimator.c -rw-r--r-- 6.9 KB
gen_stats.c -rw-r--r-- 10.1 KB
gro_cells.c -rw-r--r-- 2.0 KB
hwbm.c -rw-r--r-- 2.2 KB
link_watch.c -rw-r--r-- 5.5 KB
lwt_bpf.c -rw-r--r-- 8.9 KB
lwtunnel.c -rw-r--r-- 8.8 KB
neighbour.c -rw-r--r-- 80.1 KB
net-procfs.c -rw-r--r-- 9.5 KB
net-sysfs.c -rw-r--r-- 38.4 KB
net-sysfs.h -rw-r--r-- 368 bytes
net-traces.c -rw-r--r-- 1.0 KB
net_namespace.c -rw-r--r-- 25.4 KB
netclassid_cgroup.c -rw-r--r-- 2.9 KB
netevent.c -rw-r--r-- 2.0 KB
netpoll.c -rw-r--r-- 19.7 KB
netprio_cgroup.c -rw-r--r-- 6.9 KB
pktgen.c -rw-r--r-- 97.6 KB
ptp_classifier.c -rw-r--r-- 7.2 KB
request_sock.c -rw-r--r-- 5.2 KB
rtnetlink.c -rw-r--r-- 104.0 KB
scm.c -rw-r--r-- 7.9 KB
secure_seq.c -rw-r--r-- 4.9 KB
skbuff.c -rw-r--r-- 124.8 KB
sock.c -rw-r--r-- 81.7 KB
sock_diag.c -rw-r--r-- 7.9 KB
sock_reuseport.c -rw-r--r-- 6.4 KB
stream.c -rw-r--r-- 5.2 KB
sysctl_net_core.c -rw-r--r-- 11.7 KB
timestamping.c -rw-r--r-- 2.1 KB
tso.c -rw-r--r-- 2.3 KB
utils.c -rw-r--r-- 10.6 KB

back to top