scsi: lpfc: Fix a kernel warning triggered by lpfc_get_sgl_per_hdwq()
authorBart Van Assche <bvanassche@acm.org>
Thu, 7 Nov 2019 05:21:54 +0000 (21:21 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 9 Nov 2019 02:28:23 +0000 (21:28 -0500)
Fix the following kernel bug report:

BUG: using smp_processor_id() in preemptible [00000000] code: systemd-udevd/954

Fixes: d79c9e9d4b3d ("scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.")
Link: https://lore.kernel.org/r/20191107052158.25788-2-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index fad890c..613fbf4 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(smp_processor_id()));
+                                  cpu_to_node(raw_smp_processor_id()));
                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(smp_processor_id()));
+                                  cpu_to_node(raw_smp_processor_id()));
                if (!tmp) {
                        lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
                                        "8355 error kmalloc memory for HDWQ "