FAILED: patch "[PATCH] scsi: qla2xxx: Use correct number of vectors for online CPUs" failed to apply to 4.20-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.20-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f0783d43dde4bb349fcd667df0afabbdbab8b477 Mon Sep 17 00:00:00 2001
From: Ming Lei <[email protected]>
Date: Fri, 11 Jan 2019 09:40:47 -0800
Subject: [PATCH] scsi: qla2xxx: Use correct number of vectors for online CPUs
When SCSI-MQ is enabled, in some case system would present nr_possible_cpus() which is greater than requested vectors by the driver. This results into driver being able to get larger number of MSI-X vectors than actual online CPUs. Driver then uses pci_alloc_irq_vectors_affinity() to assign 1:1 mapping and affinity for each MSI-x vector to CPUs. When the command is submitted using MSI-x vector, assigned to offline CPU, it results in an ABTS and system hang. This hang is result of a driver not being able to process interrupt on a vector assigned to an Off-line CPUs
This patch fixes this issue by setting irq_offset value for the blk_mq_pci_map_queues() to use only those CPUs which has CPU mask affinity assigned and are online. By using the irq_offset value, driver will allow online cpumask to decide which vectors are used in blk_mq_pci_map_queues().
drivers/scsi/qla2xxx/qla_def.h +2 -0
@@ -4394,6 +4394,8 @@ typedef struct scsi_qla_host {uint16_t n2n_id;struct list_head gpnid_list;struct fab_scan scan; + +unsigned int irq_offset; } scsi_qla_host_t;struct qla27xx_image_status {
drivers/scsi/qla2xxx/qla_isr.c +1 -0
@@ -3446,6 +3446,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) "Adjusted Max no of queues pairs: %d.\n", ha->max_qpairs); } } + vha->irq_offset = desc.pre_vectors; ha->msix_entries =kcalloc (ha->msix_count,sizeof (struct qla_msix_entry ),GFP_KERNEL );
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -6939,7 +6939,7 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost)if (USER_CTRL_IRQ (vha->hw)) rc =blk_mq_map_queues (qmap);else - rc =blk_mq_pci_map_queues (qmap, vha->hw->pdev,0 ); + rc =blk_mq_pci_map_queues (qmap, vha->hw->pdev, vha->irq_offset);return rc; }