linux_dsm_epyc7002/drivers/net/ethernet/chelsio/cxgb4
Guilherme G. Piccoli 6a146f3a58 cxgb4: fix BUG() on interrupt deallocating path of ULD
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: 0fbc81b3ad ("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>
2017-07-11 13:40:22 -07:00
..
clip_tbl.c treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
clip_tbl.h cxgb4: Fix incorrect 'c' suffix to %pI4, use %pISc instead 2015-02-20 17:25:52 -05:00
cxgb4_dcb.c cxgb4: DCB message handler needs to use correct portid to netdev mapping 2016-04-26 13:23:57 -04:00
cxgb4_dcb.h cxgb4 : Improve IEEE DCBx support, other minor open-lldp fixes 2015-02-02 18:54:35 -08:00
cxgb4_debugfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
cxgb4_debugfs.h VFS: Fix up some ->d_inode accesses in the chelsio driver 2015-04-15 15:06:54 -04:00
cxgb4_ethtool.c cxgb4: Support for get_ts_info ethtool method 2017-07-05 09:21:54 +01:00
cxgb4_fcoe.c cxgb4: fix boolreturn.cocci warnings 2015-03-29 12:15:56 -07:00
cxgb4_fcoe.h cxgb4: add cxgb4_fcoe.h and macro definitions for FCoE 2015-03-24 15:24:38 -04:00
cxgb4_filter.c net: introduce __skb_put_[zero, data, u8] 2017-06-20 13:30:14 -04:00
cxgb4_filter.h cxgb4: add common api support for configuring filters 2016-09-22 01:40:01 -04:00
cxgb4_main.c cxgb4: fix BUG() on interrupt deallocating path of ULD 2017-07-11 13:40:22 -07:00
cxgb4_ptp.c cxgb4: Add PTP Hardware Clock (PHC) support 2017-07-05 09:21:54 +01:00
cxgb4_ptp.h cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
cxgb4_tc_u32_parse.h cxgb4: add support for offloading u32 filters 2016-09-22 01:40:01 -04:00
cxgb4_tc_u32.c treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
cxgb4_tc_u32.h cxgb4: Increase max number of tc u32 links 2017-02-16 14:32:52 -05:00
cxgb4_uld.c cxgb4: fix BUG() on interrupt deallocating path of ULD 2017-07-11 13:40:22 -07:00
cxgb4_uld.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
cxgb4.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
l2t.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
l2t.h cxgb4: move VLAN_NONE macro definition 2016-03-22 00:25:05 -07:00
Makefile cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
sched.c treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
sched.h cxgb4: add support for tx max rate limiting 2016-08-22 18:29:13 -07:00
sge.c cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
t4_chip_type.h cxgb4: T6 adapter lld support for iw_cxgb4 driver 2015-10-21 23:16:38 -04:00
t4_hw.c cxgb4: Use Firmware params to get buffer-group map 2017-06-23 14:22:39 -04:00
t4_hw.h cxgb4: add new routine to get adapter info 2016-04-26 13:23:56 -04:00
t4_msg.h cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
t4_pci_id_tbl.h cxgb4: add new T6 pci device id's 2017-06-19 10:37:05 -04:00
t4_regs.h cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
t4_values.h cxgb4: Update IngPad and IngPack values 2017-03-22 10:53:49 -07:00
t4fw_api.h cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
t4fw_version.h cxgb4: update latest firmware version supported 2017-06-01 12:10:04 -04:00