scsi: lpfc: use hdwq assigned cpu for allocation
authorJames Smart <jsmart2021@gmail.com>
Sat, 16 Nov 2019 00:38:47 +0000 (16:38 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 20 Nov 2019 02:37:34 +0000 (21:37 -0500)
Looking at the recent conversion from smp_processor_id() to
raw_smp_processor_id(), realized that the allocation should be based on the
cpu the hdwq is bound to, not the executing cpu.

Revise to pull cpu number from the hdwq

Fixes: 765ab6cdac3b ("scsi: lpfc: Fix a kernel warning triggered by lpfc_get_sgl_per_hdwq()")
Link: https://lore.kernel.org/r/20191116003847.6141-1-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 5286c78645ac5132473d2182b2abd4e5765a59f7..7c8527bd1677a345edbde6d4a1999ae3927d4054 100644 (file)
@@ -20668,7 +20668,7 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
                /* allocate more */
                spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
                tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
-                                  cpu_to_node(raw_smp_processor_id()));
+                                  cpu_to_node(hdwq->io_wq->chann));
                if (!tmp) {
                        lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
                                        "8353 error kmalloc memory for HDWQ "
@@ -20811,7 +20811,7 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
                /* allocate more */
                spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
                tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
-                                  cpu_to_node(raw_smp_processor_id()));
+                                  cpu_to_node(hdwq->io_wq->chann));
                if (!tmp) {
                        lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
                                        "8355 error kmalloc memory for HDWQ "