Skip to content

Commit dafeaf2

Browse files
johnpgarrymartinkpetersen
authored andcommitted
scsi: aacraid: Stop using PCI_IRQ_AFFINITY
When PCI_IRQ_AFFINITY is set for calling pci_alloc_irq_vectors(), it means interrupts are spread around the available CPUs. It also means that the interrupts become managed, which means that an interrupt is shutdown when all the CPUs in the interrupt affinity mask go offline. Using managed interrupts in this way means that we should ensure that completions should not occur on HW queues where the associated interrupt is shutdown. This is typically achieved by ensuring only CPUs which are online can generate IO completion traffic to the HW queue which they are mapped to (so that they can also serve completion interrupts for that HW queue). The problem in the driver is that a CPU can generate completions to a HW queue whose interrupt may be shutdown, as the CPUs in the HW queue interrupt affinity mask may be offline. This can cause IOs to never complete and hang the system. The driver maintains its own CPU <-> HW queue mapping for submissions, see aac_fib_vector_assign(), but this does not reflect the CPU <-> HW queue interrupt affinity mapping. Commit 9dc704d ("scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity") tried to remedy this issue may mapping CPUs properly to HW queue interrupts. However this was later reverted in commit c5becf5 ("Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity") - it seems that there were other reports of hangs. I guess that this was due to some implementation issue in the original commit or maybe a HW issue. Fix the very original hang by just not using managed interrupts by not setting PCI_IRQ_AFFINITY. In this way, all CPUs will be in each HW queue affinity mask, so should not create completion problems if any CPUs go offline. Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Closes: https://lore.kernel.org/linux-scsi/[email protected]/ Reviewed-by: John Meneghini <[email protected]> Tested-by: John Meneghini <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 33b3120 commit dafeaf2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/aacraid/comminit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ void aac_define_int_mode(struct aac_dev *dev)
481481
pci_find_capability(dev->pdev, PCI_CAP_ID_MSIX)) {
482482
min_msix = 2;
483483
i = pci_alloc_irq_vectors(dev->pdev,
484-
min_msix, msi_count,
485-
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
484+
min_msix, msi_count, PCI_IRQ_MSIX);
486485
if (i > 0) {
487486
dev->msi_enabled = 1;
488487
msi_count = i;

0 commit comments

Comments
 (0)