Skip to content

Commit f54e239

Browse files
Giridhar Malavaligregkh
Giridhar Malavali
authored andcommitted
scsi: qla2xxx: Avoid PCI IRQ affinity mapping when multiqueue is not supported
commit f3e0269 upstream. This patch fixes warning seen when BLK-MQ is enabled and hardware does not support MQ. This will result into driver requesting MSIx vectors which are equal or less than pre_desc via PCI IRQ Affinity infrastructure. [ 19.746300] qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 10.00.00.12-k. [ 19.746599] qla2xxx [0000:02:00.0]-001d: : Found an ISP2432 irq 18 iobase 0x(____ptrval____). [ 20.203186] ------------[ cut here ]------------ [ 20.203306] WARNING: CPU: 8 PID: 268 at drivers/pci/msi.c:1273 pci_irq_get_affinity+0xf4/0x120 [ 20.203481] Modules linked in: tg3 ptp qla2xxx(+) pps_core sg libphy scsi_transport_fc flash loop autofs4 [ 20.203700] CPU: 8 PID: 268 Comm: systemd-udevd Not tainted 5.0.0-rc5-00358-gdf3865f #113 [ 20.203830] Call Trace: [ 20.203933] [0000000000461bb0] __warn+0xb0/0xe0 [ 20.204090] [00000000006c8f34] pci_irq_get_affinity+0xf4/0x120 [ 20.204219] [000000000068c764] blk_mq_pci_map_queues+0x24/0x120 [ 20.204396] [00000000007162f4] scsi_map_queues+0x14/0x40 [ 20.204626] [0000000000673654] blk_mq_update_queue_map+0x94/0xe0 [ 20.204698] [0000000000676ce0] blk_mq_alloc_tag_set+0x120/0x300 [ 20.204869] [000000000071077c] scsi_add_host_with_dma+0x7c/0x300 [ 20.205419] [00000000100ead54] qla2x00_probe_one+0x19d4/0x2640 [qla2xxx] [ 20.205621] [00000000006b3c88] pci_device_probe+0xc8/0x160 [ 20.205697] [0000000000701c0c] really_probe+0x1ac/0x2e0 [ 20.205770] [0000000000701f90] driver_probe_device+0x50/0x100 [ 20.205843] [0000000000702134] __driver_attach+0xf4/0x120 [ 20.205913] [0000000000700644] bus_for_each_dev+0x44/0x80 [ 20.206081] [0000000000700c98] bus_add_driver+0x198/0x220 [ 20.206300] [0000000000702950] driver_register+0x70/0x120 [ 20.206582] [0000000010248224] qla2x00_module_init+0x224/0x284 [qla2xxx] [ 20.206857] ---[ end trace b1de7a3f79fab2c2 ]--- The fix is to check if the hardware does not have Multi Queue capabiltiy, use pci_alloc_irq_vectors() call instead of pci_alloc_irq_affinity(). Fixes: f664a3c ("scsi: kill off the legacy IO path") Cc: [email protected] #4.19 Signed-off-by: Giridhar Malavali <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 54e834e commit f54e239

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
34103410
min_vecs++;
34113411
}
34123412

3413-
if (USER_CTRL_IRQ(ha)) {
3413+
if (USER_CTRL_IRQ(ha) || !ha->mqiobase) {
34143414
/* user wants to control IRQ setting for target mode */
34153415
ret = pci_alloc_irq_vectors(ha->pdev, min_vecs,
34163416
ha->msix_count, PCI_IRQ_MSIX);

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6936,7 +6936,7 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost)
69366936
scsi_qla_host_t *vha = (scsi_qla_host_t *)shost->hostdata;
69376937
struct blk_mq_queue_map *qmap = &shost->tag_set.map[0];
69386938

6939-
if (USER_CTRL_IRQ(vha->hw))
6939+
if (USER_CTRL_IRQ(vha->hw) || !vha->hw->mqiobase)
69406940
rc = blk_mq_map_queues(qmap);
69416941
else
69426942
rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, vha->irq_offset);

0 commit comments

Comments
 (0)