@@ -9,7 +9,6 @@
#include <linux/acpi.h>
#include <linux/blk-mq.h>
-#include <linux/blk-mq-pci.h>
#include <linux/clk.h>
#include <linux/debugfs.h>
#include <linux/dmapool.h>
@@ -3372,7 +3372,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
for (queue_no = 0; queue_no < hisi_hba->cq_nvecs; queue_no++) {
struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
- cq->irq_no = hisi_hba->irq_map[queue_no + 96];
+ cq->irq_no = hisi_hba->irq_map[queue_no + CQ0_IRQ_INDEX];
rc = devm_request_threaded_irq(dev, cq->irq_no,
cq_interrupt_v2_hw,
cq_thread_v2_hw, IRQF_ONESHOT,
@@ -3549,21 +3549,21 @@ static const struct attribute_group *sdev_groups_v2_hw[] = {
NULL
};
+static const struct cpumask *hisi_hba_get_queue_affinity(struct device *dev,
+ unsigned int queue)
+{
+ struct hisi_hba *hba = dev->driver_data;
+
+ return irq_get_affinity_mask(hba->irq_map[queue]);
+}
+
static void map_queues_v2_hw(struct Scsi_Host *shost)
{
struct hisi_hba *hisi_hba = shost_priv(shost);
struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
- const struct cpumask *mask;
- unsigned int queue, cpu;
- for (queue = 0; queue < qmap->nr_queues; queue++) {
- mask = irq_get_affinity_mask(hisi_hba->irq_map[96 + queue]);
- if (!mask)
- continue;
-
- for_each_cpu(cpu, mask)
- qmap->mq_map[cpu] = qmap->queue_offset + queue;
- }
+ blk_mq_hctx_map_queues(qmap, hisi_hba->dev, CQ0_IRQ_INDEX,
+ hisi_hba_get_queue_affinity);
}
static const struct scsi_host_template sht_v2_hw = {
@@ -3322,8 +3322,8 @@ static void hisi_sas_map_queues(struct Scsi_Host *shost)
if (i == HCTX_TYPE_POLL)
blk_mq_map_queues(qmap);
else
- blk_mq_pci_map_queues(qmap, hisi_hba->pci_dev,
- BASE_VECTORS_V3_HW);
+ blk_mq_hctx_map_queues(qmap, &hisi_hba->pci_dev->dev,
+ BASE_VECTORS_V3_HW, NULL);
qoff += qmap->nr_queues;
}
}