Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-11-22 14:13:39 +0100
committerDenis Kirjanov <dkirjanov@suse.com>2019-11-27 13:42:53 +0300
commit77572d011718942208a4deed466067969be2298e (patch)
tree57118aaba5000852150f15739701391f1bd052be
parent76b6e60c47bedb712ebeca6816aebf4a762d4cb2 (diff)
lpfc: size cpu map by last cpu id set (bsc#1157160).
-rw-r--r--patches.suse/lpfc-size-cpu-map-by-last-cpu-id-set.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.suse/lpfc-size-cpu-map-by-last-cpu-id-set.patch b/patches.suse/lpfc-size-cpu-map-by-last-cpu-id-set.patch
new file mode 100644
index 0000000000..97fb2a80d2
--- /dev/null
+++ b/patches.suse/lpfc-size-cpu-map-by-last-cpu-id-set.patch
@@ -0,0 +1,43 @@
+From: James Smart <jsmart2021@gmail.com>
+Date: Thu, 21 Nov 2019 09:55:56 -0800
+Subject: [PATCH] lpfc: size cpu map by last cpu id set
+Patch-Mainline: submitted linux-scsi 2019/11/20
+References: bsc#1157160
+
+Currently the lpfc driver sizes its cpu_map array based on
+num_possible_cpus(). However, that can be a value that is less
+than the highest cpu id bit that is set. As such, if a thread
+runs on a cpu with a larger cpu id, or for_each_possible_cpu()
+is used, the driver could index off the end of the array and
+return garbage or GPF.
+
+The driver maintains it's own internal copy of the "num_possible"
+cpu value and sizes arrays by it.
+
+Fix by setting the driver's value to the value of the last cpu id
+bit set in the possible_mask - plus 1. Thus cpu_map will be sized
+to allow access by any cpu id possible.
+
+Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
+Signed-off-by: James Smart <jsmart2021@gmail.com>
+Acked-by: Hannes Reinecke <hare@suse.de>
+---
+ drivers/scsi/lpfc/lpfc_init.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
+index e9323889f199..cd83617354a1 100644
+--- a/drivers/scsi/lpfc/lpfc_init.c
++++ b/drivers/scsi/lpfc/lpfc_init.c
+@@ -6460,7 +6460,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
+ u32 if_fam;
+
+ phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
+- phba->sli4_hba.num_possible_cpu = num_possible_cpus();
++ phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1;
+ phba->sli4_hba.curr_disp_cpu = 0;
+ lpfc_cpumask_of_node_init(phba);
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 93abafc101..b58cb55423 100644
--- a/series.conf
+++ b/series.conf
@@ -51204,6 +51204,7 @@
patches.kabi/kabi-protect-RDMA_DRIVER_EFA.patch
patches.suse/RDMA-restrack-Track-driver-QP-types-in-resource-trac.patch
patches.suse/0001-USBIP-add-config-dependency-for-SGL_ALLOC.patch
+ patches.suse/lpfc-size-cpu-map-by-last-cpu-id-set.patch
########################################################
# end of sorted patches