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
kasan
Kconfig -rw-r--r-- 23.5 KB
Kconfig.debug -rw-r--r-- 3.8 KB
Makefile -rw-r--r-- 3.6 KB
backing-dev.c -rw-r--r-- 27.5 KB
balloon_compaction.c -rw-r--r-- 4.7 KB
bootmem.c -rw-r--r-- 20.8 KB
cleancache.c -rw-r--r-- 9.9 KB
cma.c -rw-r--r-- 13.5 KB
cma.h -rw-r--r-- 534 bytes
cma_debug.c -rw-r--r-- 4.5 KB
compaction.c -rw-r--r-- 57.9 KB
debug.c -rw-r--r-- 4.3 KB
debug_page_ref.c -rw-r--r-- 1.3 KB
dmapool.c -rw-r--r-- 13.7 KB
early_ioremap.c -rw-r--r-- 6.2 KB
fadvise.c -rw-r--r-- 4.3 KB
failslab.c -rw-r--r-- 1.4 KB
filemap.c -rw-r--r-- 84.6 KB
frame_vector.c -rw-r--r-- 6.0 KB
frontswap.c -rw-r--r-- 14.3 KB
gup.c -rw-r--r-- 47.4 KB
highmem.c -rw-r--r-- 11.7 KB
huge_memory.c -rw-r--r-- 74.5 KB
hugetlb.c -rw-r--r-- 128.8 KB
hugetlb_cgroup.c -rw-r--r-- 10.9 KB
hwpoison-inject.c -rw-r--r-- 3.2 KB
init-mm.c -rw-r--r-- 680 bytes
internal.h -rw-r--r-- 16.2 KB
interval_tree.c -rw-r--r-- 3.1 KB
khugepaged.c -rw-r--r-- 48.4 KB
kmemcheck.c -rw-r--r-- 2.9 KB
kmemleak-test.c -rw-r--r-- 3.2 KB
kmemleak.c -rw-r--r-- 58.7 KB
ksm.c -rw-r--r-- 85.5 KB
list_lru.c -rw-r--r-- 12.6 KB
maccess.c -rw-r--r-- 3.0 KB
madvise.c -rw-r--r-- 21.5 KB
memblock.c -rw-r--r-- 50.5 KB
memcontrol.c -rw-r--r-- 155.6 KB
memory-failure.c -rw-r--r-- 49.6 KB
memory.c -rw-r--r-- 117.6 KB
memory_hotplug.c -rw-r--r-- 51.8 KB
mempolicy.c -rw-r--r-- 68.2 KB
mempool.c -rw-r--r-- 13.9 KB
memtest.c -rw-r--r-- 2.7 KB
migrate.c -rw-r--r-- 52.2 KB
mincore.c -rw-r--r-- 6.7 KB
mlock.c -rw-r--r-- 22.6 KB
mm_init.c -rw-r--r-- 4.8 KB
mmap.c -rw-r--r-- 96.3 KB
mmu_context.c -rw-r--r-- 1.3 KB
mmu_notifier.c -rw-r--r-- 11.5 KB
mmzone.c -rw-r--r-- 2.4 KB
mprotect.c -rw-r--r-- 13.4 KB
mremap.c -rw-r--r-- 16.2 KB
msync.c -rw-r--r-- 2.6 KB
nobootmem.c -rw-r--r-- 11.1 KB
nommu.c -rw-r--r-- 48.6 KB
oom_kill.c -rw-r--r-- 28.6 KB
page-writeback.c -rw-r--r-- 84.3 KB
page_alloc.c -rw-r--r-- 211.3 KB
page_counter.c -rw-r--r-- 4.8 KB
page_ext.c -rw-r--r-- 11.1 KB
page_idle.c -rw-r--r-- 5.4 KB
page_io.c -rw-r--r-- 9.4 KB
page_isolation.c -rw-r--r-- 8.4 KB
page_owner.c -rw-r--r-- 14.7 KB
page_poison.c -rw-r--r-- 2.6 KB
page_vma_mapped.c -rw-r--r-- 5.8 KB
pagewalk.c -rw-r--r-- 8.4 KB
percpu-internal.h -rw-r--r-- 4.1 KB
percpu-km.c -rw-r--r-- 2.9 KB
percpu-stats.c -rw-r--r-- 5.0 KB
percpu-vm.c -rw-r--r-- 10.1 KB
percpu.c -rw-r--r-- 66.8 KB
pgtable-generic.c -rw-r--r-- 5.2 KB
process_vm_access.c -rw-r--r-- 10.1 KB
quicklist.c -rw-r--r-- 2.4 KB
readahead.c -rw-r--r-- 16.1 KB
rmap.c -rw-r--r-- 47.6 KB
rodata_test.c -rw-r--r-- 1.4 KB
shmem.c -rw-r--r-- 110.3 KB
slab.c -rw-r--r-- 110.2 KB
slab.h -rw-r--r-- 14.4 KB
slab_common.c -rw-r--r-- 34.3 KB
slob.c -rw-r--r-- 16.0 KB
slub.c -rw-r--r-- 140.6 KB
sparse-vmemmap.c -rw-r--r-- 8.1 KB
sparse.c -rw-r--r-- 22.8 KB
swap.c -rw-r--r-- 27.0 KB
swap_cgroup.c -rw-r--r-- 5.2 KB
swap_slots.c -rw-r--r-- 9.1 KB
swap_state.c -rw-r--r-- 14.8 KB
swapfile.c -rw-r--r-- 88.2 KB
truncate.c -rw-r--r-- 25.3 KB
usercopy.c -rw-r--r-- 7.5 KB
userfaultfd.c -rw-r--r-- 14.3 KB
util.c -rw-r--r-- 18.1 KB
vmacache.c -rw-r--r-- 3.2 KB
vmalloc.c -rw-r--r-- 70.0 KB
vmpressure.c -rw-r--r-- 12.8 KB
vmscan.c -rw-r--r-- 114.7 KB
vmstat.c -rw-r--r-- 47.4 KB
workingset.c -rw-r--r-- 18.2 KB
z3fold.c -rw-r--r-- 23.8 KB
zbud.c -rw-r--r-- 18.2 KB
zpool.c -rw-r--r-- 10.0 KB
zsmalloc.c -rw-r--r-- 59.3 KB
zswap.c -rw-r--r-- 32.8 KB

back to top