Skip to contentSkip to conversation

lpfc: Fix lpfc_cpumask_of_node_init()

PATCH Applied James Smart 2 participants 2 messages Nov 8, 2019 – Nov 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lpfc: Fix lpfc_cpumask_of_node_init()

From: Bart Van Assche <[email protected]>

Fix the following kernel warning:

cpumask_of_node(-1): (unsigned)node >= nr_node_ids(1)

Fixes dcaa21367938 ("scsi: lpfc: Change default IRQ model on AMD architectures")

---
Barts patch slightly reorged to clear the mask before exiting

---
 drivers/scsi/lpfc/lpfc_init.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +3 -9
index 28e6a763f106..480d5a28c4f5 100644
@@ -6005,19 +6005,13 @@ static void
 lpfc_cpumask_of_node_init(struct lpfc_hba *phba)
 {
 	unsigned int cpu, numa_node;
-	struct cpumask *numa_mask = NULL;
-
-#ifdef CONFIG_NUMA
-	numa_node = phba->pcidev->dev.numa_node;
-#else
-	numa_node = NUMA_NO_NODE;
-#endif
-	numa_mask = &phba->sli4_hba.numa_mask;
+	struct cpumask *numa_mask = &phba->sli4_hba.numa_mask;
 
 	cpumask_clear(numa_mask);
 
 	/* Check if we're a NUMA architecture */
-	if (!cpumask_of_node(numa_node))
+	numa_node = dev_to_node(&phba->pcidev->dev);
+	if (numa_node == NUMA_NO_NODE)
 		return;
 
 	for_each_possible_cpu(cpu)
Signature · 1 line
2.13.7
#1 lore raw

James,

Quoted 3 lines

Fix the following kernel warning:

cpumask_of_node(-1): (unsigned)node >= nr_node_ids(1)

Applied to 5.5/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering