Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: smartpqi: Fix NUMA node not updated during init

Correct NUMA node association when calling pqi_pci_probe().

In the function pqi_pci_probe(), the driver makes an OS call to get the
NUMA node associated with a controller. If the call returns that there is
no associated node, the driver attempts to set it to node 0. The problem is
that a different local variable (cp_node) was being used to do this, but
the original local variable (node) was still being used in the call to
pqi_alloc_ctrl_info().

The value of "node" is not updated if the conditional after the call to
dev_to_node() evaluates to TRUE.

Link: https://lore.kernel.org/r/164375213850.440833.5243014942807747074.stgit@brunhilda.pdev.net
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mike McGowen and committed by
Martin K. Petersen
c52efc92 00598b05

+5 -5
+5 -5
drivers/scsi/smartpqi/smartpqi_init.c
··· 8811 8811 const struct pci_device_id *id) 8812 8812 { 8813 8813 int rc; 8814 - int node, cp_node; 8814 + int node; 8815 8815 struct pqi_ctrl_info *ctrl_info; 8816 8816 8817 8817 pqi_print_ctrl_info(pci_dev, id); ··· 8830 8830 8831 8831 node = dev_to_node(&pci_dev->dev); 8832 8832 if (node == NUMA_NO_NODE) { 8833 - cp_node = cpu_to_node(0); 8834 - if (cp_node == NUMA_NO_NODE) 8835 - cp_node = 0; 8836 - set_dev_node(&pci_dev->dev, cp_node); 8833 + node = cpu_to_node(0); 8834 + if (node == NUMA_NO_NODE) 8835 + node = 0; 8836 + set_dev_node(&pci_dev->dev, node); 8837 8837 } 8838 8838 8839 8839 ctrl_info = pqi_alloc_ctrl_info(node);