Skip to content

Commit 359db63

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Select a suitable queue for internal I/Os
For when managed interrupts are used (and shost->nr_hw_queues is set), a fixed queue - set per-device - is still used for internal I/Os. If all the CPUs mapped to that queue are offlined, then the completions for that queue are not serviced and any internal I/Os will time out. Fix by selecting a queue for internal I/Os from the queue mapped from the current CPU in this scenario. This is still not ideal as it does not deal with CPU hotplug for inflight internal I/Os, and needs proper support from [0]. [0] https://lore.kernel.org/linux-scsi/[email protected]/T/#m7d77d049b18f33a24ef206af69ebb66d07440556 Link: https://lore.kernel.org/r/[email protected] Fixes: 8d98416 ("scsi: hisi_sas: Switch v3 hw to MQ") Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 673235f commit 359db63

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,12 @@ static int hisi_sas_task_prep(struct sas_task *task,
452452
blk_tag = blk_mq_unique_tag(scmd->request);
453453
dq_index = blk_mq_unique_tag_to_hwq(blk_tag);
454454
*dq_pointer = dq = &hisi_hba->dq[dq_index];
455+
} else if (hisi_hba->shost->nr_hw_queues) {
456+
struct Scsi_Host *shost = hisi_hba->shost;
457+
struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
458+
int queue = qmap->mq_map[raw_smp_processor_id()];
459+
460+
*dq_pointer = dq = &hisi_hba->dq[queue];
455461
} else {
456462
*dq_pointer = dq = sas_dev->dq;
457463
}

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,6 +2452,11 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
24522452
rc = -ENOENT;
24532453
goto free_irq_vectors;
24542454
}
2455+
cq->irq_mask = pci_irq_get_affinity(pdev, i + BASE_VECTORS_V3_HW);
2456+
if (!cq->irq_mask) {
2457+
dev_err(dev, "could not get cq%d irq affinity!\n", i);
2458+
return -ENOENT;
2459+
}
24552460
}
24562461

24572462
return 0;

0 commit comments

Comments
 (0)