From 52c084ffdb8628784d2c757c7106e6dfeaa4eb3c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Aug 2022 11:07:55 +0200 Subject: [PATCH] fix up duplicates in 5.18 queue --- ...cu-verify-that-mount_lock-remains-un.patch | 51 ----- ...-userspace-break-from-using-bin_attr.patch | 188 ---------------- ...back-ftrace_expected-assignment.patch-2936 | 49 ---- ...ck-return-value-of-ioremap-in-gscps2.patch | 40 ---- .../ksmbd-validate-length-in-smb2_write.patch | 9 +- ...qla2xxx-edif-fix-dropped-ike-message.patch | 126 ----------- ...-crash-due-to-stale-srb-access-aroun.patch | 125 ----------- ...covery-issues-in-fc-al-topology.patch-4818 | 116 ---------- ...-erroneous-mailbox-timeout-after-pci.patch | 67 ------ ...-excessive-i-o-error-messages-by-def.patch | 48 ---- ...x-fix-imbalance-vha-vref_count.patch-27970 | 61 ----- ...-losing-fcp-2-targets-during-port-pe.patch | 41 ---- ...-losing-fcp-2-targets-on-long-port-d.patch | 72 ------ ...-losing-target-when-it-reappears-dur.patch | 84 ------- ...-response-queue-handler-reading-stal.patch | 128 ----------- ...ff-multi-queue-for-8g-adapters.patch-18430 | 68 ------ ...-qla2xxx-update-manufacturer-details.patch | 52 ----- ...-down-adapter-after-pcie-error.patch-27996 | 210 ------------------ queue-5.18/series | 20 -- ...tack-out-of-bound-access-in-spmi-tra.patch | 115 ---------- ...te-kcb-status-flag-after-singlestepp.patch | 67 ------ ...ical-not-is-only-applied-to-the-left.patch | 54 ----- 22 files changed, 2 insertions(+), 1789 deletions(-) delete mode 100644 queue-5.18/__follow_mount_rcu-verify-that-mount_lock-remains-un.patch delete mode 100644 queue-5.18/drivers-base-fix-userspace-break-from-using-bin_attr.patch delete mode 100644 queue-5.18/ftrace-x86-add-back-ftrace_expected-assignment.patch-2936 delete mode 100644 queue-5.18/input-gscps2-check-return-value-of-ioremap-in-gscps2.patch delete mode 100644 queue-5.18/scsi-qla2xxx-edif-fix-dropped-ike-message.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-crash-due-to-stale-srb-access-aroun.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch-4818 delete mode 100644 queue-5.18/scsi-qla2xxx-fix-erroneous-mailbox-timeout-after-pci.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-excessive-i-o-error-messages-by-def.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-imbalance-vha-vref_count.patch-27970 delete mode 100644 queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-pe.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-d.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-losing-target-when-it-reappears-dur.patch delete mode 100644 queue-5.18/scsi-qla2xxx-fix-response-queue-handler-reading-stal.patch delete mode 100644 queue-5.18/scsi-qla2xxx-turn-off-multi-queue-for-8g-adapters.patch-18430 delete mode 100644 queue-5.18/scsi-qla2xxx-update-manufacturer-details.patch delete mode 100644 queue-5.18/scsi-qla2xxx-wind-down-adapter-after-pcie-error.patch-27996 delete mode 100644 queue-5.18/spmi-trace-fix-stack-out-of-bound-access-in-spmi-tra.patch delete mode 100644 queue-5.18/x86-kprobes-update-kcb-status-flag-after-singlestepp.patch delete mode 100644 queue-5.18/x86-olpc-fix-logical-not-is-only-applied-to-the-left.patch diff --git a/queue-5.18/__follow_mount_rcu-verify-that-mount_lock-remains-un.patch b/queue-5.18/__follow_mount_rcu-verify-that-mount_lock-remains-un.patch deleted file mode 100644 index c561a7f535b..00000000000 --- a/queue-5.18/__follow_mount_rcu-verify-that-mount_lock-remains-un.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4be2ce739fb3c1ad0fbc2337b07b33a326009677 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 4 Jul 2022 17:26:29 -0400 -Subject: __follow_mount_rcu(): verify that mount_lock remains unchanged - -From: Al Viro - -[ Upstream commit 20aac6c60981f5bfacd66661d090d907bf1482f0 ] - -Validate mount_lock seqcount as soon as we cross into mount in RCU -mode. Sure, ->mnt_root is pinned and will remain so until we -do rcu_read_unlock() anyway, and we will eventually fail to unlazy if -the mount_lock had been touched, but we might run into a hard error -(e.g. -ENOENT) before trying to unlazy. And it's possible to end -up with RCU pathwalk racing with rename() and umount() in a way -that would fail with -ENOENT while non-RCU pathwalk would've -succeeded with any timings. - -Once upon a time we hadn't needed that, but analysis had been subtle, -brittle and went out of window as soon as RENAME_EXCHANGE had been -added. - -It's narrow, hard to hit and won't get you anything other than -stray -ENOENT that could be arranged in much easier way with the -same priveleges, but it's a bug all the same. - -Cc: stable@kernel.org -X-sky-is-falling: unlikely -Fixes: da1ce0670c14 "vfs: add cross-rename" -Signed-off-by: Al Viro -Signed-off-by: Sasha Levin ---- - fs/namei.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/fs/namei.c b/fs/namei.c -index 740a40802780..2fa412c5a082 100644 ---- a/fs/namei.c -+++ b/fs/namei.c -@@ -1511,6 +1511,8 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path, - * becoming unpinned. - */ - flags = dentry->d_flags; -+ if (read_seqretry(&mount_lock, nd->m_seq)) -+ return false; - continue; - } - if (read_seqretry(&mount_lock, nd->m_seq)) --- -2.35.1 - diff --git a/queue-5.18/drivers-base-fix-userspace-break-from-using-bin_attr.patch b/queue-5.18/drivers-base-fix-userspace-break-from-using-bin_attr.patch deleted file mode 100644 index 8278cc9e8c2..00000000000 --- a/queue-5.18/drivers-base-fix-userspace-break-from-using-bin_attr.patch +++ /dev/null @@ -1,188 +0,0 @@ -From cb546eb4a3db40281eb2d2b70ec132d20dba301e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 15 Jul 2022 09:49:24 -0400 -Subject: drivers/base: fix userspace break from using bin_attributes for - cpumap and cpulist - -From: Phil Auld - -[ Upstream commit 7ee951acd31a88f941fd6535fbdee3a1567f1d63 ] - -Using bin_attributes with a 0 size causes fstat and friends to return that -0 size. This breaks userspace code that retrieves the size before reading -the file. Rather than reverting 75bd50fa841 ("drivers/base/node.c: use -bin_attribute to break the size limitation of cpumap ABI") let's put in a -size value at compile time. - -For cpulist the maximum size is on the order of - NR_CPUS * (ceil(log10(NR_CPUS)) + 1)/2 - -which for 8192 is 20480 (8192 * 5)/2. In order to get near that you'd need -a system with every other CPU on one node. For example: (0,2,4,8, ... ). -To simplify the math and support larger NR_CPUS in the future we are using -(NR_CPUS * 7)/2. We also set it to a min of PAGE_SIZE to retain the older -behavior for smaller NR_CPUS. - -The cpumap file the size works out to be NR_CPUS/4 + NR_CPUS/32 - 1 -(or NR_CPUS * 9/32 - 1) including the ","s. - -Add a set of macros for these values to cpumask.h so they can be used in -multiple places. Apply these to the handful of such files in -drivers/base/topology.c as well as node.c. - -As an example, on an 80 cpu 4-node system (NR_CPUS == 8192): - -before: - --r--r--r--. 1 root root 0 Jul 12 14:08 system/node/node0/cpulist --r--r--r--. 1 root root 0 Jul 11 17:25 system/node/node0/cpumap - -after: - --r--r--r--. 1 root root 28672 Jul 13 11:32 system/node/node0/cpulist --r--r--r--. 1 root root 4096 Jul 13 11:31 system/node/node0/cpumap - -CONFIG_NR_CPUS = 16384 --r--r--r--. 1 root root 57344 Jul 13 14:03 system/node/node0/cpulist --r--r--r--. 1 root root 4607 Jul 13 14:02 system/node/node0/cpumap - -The actual number of cpus doesn't matter for the reported size since they -are based on NR_CPUS. - -Fixes: 75bd50fa841d ("drivers/base/node.c: use bin_attribute to break the size limitation of cpumap ABI") -Fixes: bb9ec13d156e ("topology: use bin_attribute to break the size limitation of cpumap ABI") -Cc: Greg Kroah-Hartman -Cc: "Rafael J. Wysocki" -Cc: Yury Norov -Cc: stable@vger.kernel.org -Acked-by: Yury Norov (for include/linux/cpumask.h) -Signed-off-by: Phil Auld -Link: https://lore.kernel.org/r/20220715134924.3466194-1-pauld@redhat.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/base/node.c | 4 ++-- - drivers/base/topology.c | 32 ++++++++++++++++---------------- - include/linux/cpumask.h | 18 ++++++++++++++++++ - 3 files changed, 36 insertions(+), 18 deletions(-) - -diff --git a/drivers/base/node.c b/drivers/base/node.c -index 0ac6376ef7a1..eb0f43784c2b 100644 ---- a/drivers/base/node.c -+++ b/drivers/base/node.c -@@ -45,7 +45,7 @@ static inline ssize_t cpumap_read(struct file *file, struct kobject *kobj, - return n; - } - --static BIN_ATTR_RO(cpumap, 0); -+static BIN_ATTR_RO(cpumap, CPUMAP_FILE_MAX_BYTES); - - static inline ssize_t cpulist_read(struct file *file, struct kobject *kobj, - struct bin_attribute *attr, char *buf, -@@ -66,7 +66,7 @@ static inline ssize_t cpulist_read(struct file *file, struct kobject *kobj, - return n; - } - --static BIN_ATTR_RO(cpulist, 0); -+static BIN_ATTR_RO(cpulist, CPULIST_FILE_MAX_BYTES); - - /** - * struct node_access_nodes - Access class device to hold user visible -diff --git a/drivers/base/topology.c b/drivers/base/topology.c -index ac6ad9ab67f9..89f98be5c5b9 100644 ---- a/drivers/base/topology.c -+++ b/drivers/base/topology.c -@@ -62,47 +62,47 @@ define_id_show_func(ppin, "0x%llx"); - static DEVICE_ATTR_ADMIN_RO(ppin); - - define_siblings_read_func(thread_siblings, sibling_cpumask); --static BIN_ATTR_RO(thread_siblings, 0); --static BIN_ATTR_RO(thread_siblings_list, 0); -+static BIN_ATTR_RO(thread_siblings, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(thread_siblings_list, CPULIST_FILE_MAX_BYTES); - - define_siblings_read_func(core_cpus, sibling_cpumask); --static BIN_ATTR_RO(core_cpus, 0); --static BIN_ATTR_RO(core_cpus_list, 0); -+static BIN_ATTR_RO(core_cpus, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(core_cpus_list, CPULIST_FILE_MAX_BYTES); - - define_siblings_read_func(core_siblings, core_cpumask); --static BIN_ATTR_RO(core_siblings, 0); --static BIN_ATTR_RO(core_siblings_list, 0); -+static BIN_ATTR_RO(core_siblings, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(core_siblings_list, CPULIST_FILE_MAX_BYTES); - - #ifdef TOPOLOGY_CLUSTER_SYSFS - define_siblings_read_func(cluster_cpus, cluster_cpumask); --static BIN_ATTR_RO(cluster_cpus, 0); --static BIN_ATTR_RO(cluster_cpus_list, 0); -+static BIN_ATTR_RO(cluster_cpus, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(cluster_cpus_list, CPULIST_FILE_MAX_BYTES); - #endif - - #ifdef TOPOLOGY_DIE_SYSFS - define_siblings_read_func(die_cpus, die_cpumask); --static BIN_ATTR_RO(die_cpus, 0); --static BIN_ATTR_RO(die_cpus_list, 0); -+static BIN_ATTR_RO(die_cpus, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(die_cpus_list, CPULIST_FILE_MAX_BYTES); - #endif - - define_siblings_read_func(package_cpus, core_cpumask); --static BIN_ATTR_RO(package_cpus, 0); --static BIN_ATTR_RO(package_cpus_list, 0); -+static BIN_ATTR_RO(package_cpus, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(package_cpus_list, CPULIST_FILE_MAX_BYTES); - - #ifdef TOPOLOGY_BOOK_SYSFS - define_id_show_func(book_id, "%d"); - static DEVICE_ATTR_RO(book_id); - define_siblings_read_func(book_siblings, book_cpumask); --static BIN_ATTR_RO(book_siblings, 0); --static BIN_ATTR_RO(book_siblings_list, 0); -+static BIN_ATTR_RO(book_siblings, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(book_siblings_list, CPULIST_FILE_MAX_BYTES); - #endif - - #ifdef TOPOLOGY_DRAWER_SYSFS - define_id_show_func(drawer_id, "%d"); - static DEVICE_ATTR_RO(drawer_id); - define_siblings_read_func(drawer_siblings, drawer_cpumask); --static BIN_ATTR_RO(drawer_siblings, 0); --static BIN_ATTR_RO(drawer_siblings_list, 0); -+static BIN_ATTR_RO(drawer_siblings, CPUMAP_FILE_MAX_BYTES); -+static BIN_ATTR_RO(drawer_siblings_list, CPULIST_FILE_MAX_BYTES); - #endif - - static struct bin_attribute *bin_attrs[] = { -diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h -index fe29ac7cc469..4592d0845941 100644 ---- a/include/linux/cpumask.h -+++ b/include/linux/cpumask.h -@@ -1071,4 +1071,22 @@ cpumap_print_list_to_buf(char *buf, const struct cpumask *mask, - [0] = 1UL \ - } } - -+/* -+ * Provide a valid theoretical max size for cpumap and cpulist sysfs files -+ * to avoid breaking userspace which may allocate a buffer based on the size -+ * reported by e.g. fstat. -+ * -+ * for cpumap NR_CPUS * 9/32 - 1 should be an exact length. -+ * -+ * For cpulist 7 is (ceil(log10(NR_CPUS)) + 1) allowing for NR_CPUS to be up -+ * to 2 orders of magnitude larger than 8192. And then we divide by 2 to -+ * cover a worst-case of every other cpu being on one of two nodes for a -+ * very large NR_CPUS. -+ * -+ * Use PAGE_SIZE as a minimum for smaller configurations. -+ */ -+#define CPUMAP_FILE_MAX_BYTES ((((NR_CPUS * 9)/32 - 1) > PAGE_SIZE) \ -+ ? (NR_CPUS * 9)/32 - 1 : PAGE_SIZE) -+#define CPULIST_FILE_MAX_BYTES (((NR_CPUS * 7)/2 > PAGE_SIZE) ? (NR_CPUS * 7)/2 : PAGE_SIZE) -+ - #endif /* __LINUX_CPUMASK_H */ --- -2.35.1 - diff --git a/queue-5.18/ftrace-x86-add-back-ftrace_expected-assignment.patch-2936 b/queue-5.18/ftrace-x86-add-back-ftrace_expected-assignment.patch-2936 deleted file mode 100644 index 5be2f7ed9d0..00000000000 --- a/queue-5.18/ftrace-x86-add-back-ftrace_expected-assignment.patch-2936 +++ /dev/null @@ -1,49 +0,0 @@ -From e881657d8ff0377cfd861e664e7e198f7d0ca102 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 26 Jul 2022 10:18:51 -0400 -Subject: ftrace/x86: Add back ftrace_expected assignment - -From: Steven Rostedt (Google) - -[ Upstream commit ac6c1b2ca77e722a1e5d651f12f437f2f237e658 ] - -When a ftrace_bug happens (where ftrace fails to modify a location) it is -helpful to have what was at that location as well as what was expected to -be there. - -But with the conversion to text_poke() the variable that assigns the -expected for debugging was dropped. Unfortunately, I noticed this when I -needed it. Add it back. - -Link: https://lkml.kernel.org/r/20220726101851.069d2e70@gandalf.local.home - -Cc: "x86@kernel.org" -Cc: Peter Zijlstra -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: Borislav Petkov -Cc: "H. Peter Anvin" -Cc: Andrew Morton -Cc: stable@vger.kernel.org -Fixes: 768ae4406a5c ("x86/ftrace: Use text_poke()") -Signed-off-by: Steven Rostedt (Google) -Signed-off-by: Sasha Levin ---- - arch/x86/kernel/ftrace.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c -index 6892ca67d9c6..b6d7ece7bf51 100644 ---- a/arch/x86/kernel/ftrace.c -+++ b/arch/x86/kernel/ftrace.c -@@ -93,6 +93,7 @@ static int ftrace_verify_code(unsigned long ip, const char *old_code) - - /* Make sure it is what we expect it to be */ - if (memcmp(cur_code, old_code, MCOUNT_INSN_SIZE) != 0) { -+ ftrace_expected = old_code; - WARN_ON(1); - return -EINVAL; - } --- -2.35.1 - diff --git a/queue-5.18/input-gscps2-check-return-value-of-ioremap-in-gscps2.patch b/queue-5.18/input-gscps2-check-return-value-of-ioremap-in-gscps2.patch deleted file mode 100644 index f07477db862..00000000000 --- a/queue-5.18/input-gscps2-check-return-value-of-ioremap-in-gscps2.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 6674953f1a89b966ac5c94dac089f2b80d9e9932 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 2 Aug 2022 15:20:33 +0800 -Subject: Input: gscps2 - check return value of ioremap() in gscps2_probe() - -From: Xie Shaowen - -[ Upstream commit e61b3125a4f036b3c6b87ffd656fc1ab00440ae9 ] - -The function ioremap() in gscps2_probe() can fail, so -its return value should be checked. - -Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache") -Cc: # v5.6+ -Reported-by: Hacash Robot -Signed-off-by: Xie Shaowen -Signed-off-by: Helge Deller -Signed-off-by: Sasha Levin ---- - drivers/input/serio/gscps2.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c -index a9065c6ab550..da2c67cb8642 100644 ---- a/drivers/input/serio/gscps2.c -+++ b/drivers/input/serio/gscps2.c -@@ -350,6 +350,10 @@ static int __init gscps2_probe(struct parisc_device *dev) - ps2port->port = serio; - ps2port->padev = dev; - ps2port->addr = ioremap(hpa, GSC_STATUS + 4); -+ if (!ps2port->addr) { -+ ret = -ENOMEM; -+ goto fail_nomem; -+ } - spin_lock_init(&ps2port->lock); - - gscps2_reset(ps2port); --- -2.35.1 - diff --git a/queue-5.18/ksmbd-validate-length-in-smb2_write.patch b/queue-5.18/ksmbd-validate-length-in-smb2_write.patch index d8404ccb413..5d8a3a4ac5b 100644 --- a/queue-5.18/ksmbd-validate-length-in-smb2_write.patch +++ b/queue-5.18/ksmbd-validate-length-in-smb2_write.patch @@ -23,14 +23,12 @@ Acked-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- - fs/ksmbd/smb2pdu.c | 49 ++++++++++++++++++---------------------------- + fs/ksmbd/smb2pdu.c | 49 +++++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 30 deletions(-) -diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c -index 0a76aa7fe5f9..5df87fe18905 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c -@@ -6344,23 +6344,18 @@ static noinline int smb2_write_pipe(struct ksmbd_work *work) +@@ -6344,23 +6344,18 @@ static noinline int smb2_write_pipe(stru length = le32_to_cpu(req->Length); id = req->VolatileFileId; @@ -96,6 +94,3 @@ index 0a76aa7fe5f9..5df87fe18905 100644 ksmbd_debug(SMB, "flags %u\n", le32_to_cpu(req->Flags)); if (le32_to_cpu(req->Flags) & SMB2_WRITEFLAG_WRITE_THROUGH) --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-edif-fix-dropped-ike-message.patch b/queue-5.18/scsi-qla2xxx-edif-fix-dropped-ike-message.patch deleted file mode 100644 index d421910c909..00000000000 --- a/queue-5.18/scsi-qla2xxx-edif-fix-dropped-ike-message.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 983ed3d61efd61bb2643bd8b27af58c45e0dfcce Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Jul 2022 22:20:40 -0700 -Subject: scsi: qla2xxx: edif: Fix dropped IKE message - -From: Quinn Tran - -[ Upstream commit c019cd656e717349ff22d0c41d6fbfc773f48c52 ] - -This patch fixes IKE message being dropped due to error in processing Purex -IOCB and Continuation IOCBs. - -Link: https://lore.kernel.org/r/20220713052045.10683-6-njavali@marvell.com -Fixes: fac2807946c1 ("scsi: qla2xxx: edif: Add extraction of auth_els from the wire") -Cc: stable@vger.kernel.org -Reviewed-by: Himanshu Madhani -Signed-off-by: Quinn Tran -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_isr.c | 54 +++++++++++++++------------------- - 1 file changed, 24 insertions(+), 30 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c -index c509bb23af40..125b208cf118 100644 ---- a/drivers/scsi/qla2xxx/qla_isr.c -+++ b/drivers/scsi/qla2xxx/qla_isr.c -@@ -3711,12 +3711,11 @@ void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *vha, - * Return: 0 all iocbs has arrived, xx- all iocbs have not arrived. - */ - static int qla_chk_cont_iocb_avail(struct scsi_qla_host *vha, -- struct rsp_que *rsp, response_t *pkt) -+ struct rsp_que *rsp, response_t *pkt, u32 rsp_q_in) - { -- int start_pkt_ring_index, end_pkt_ring_index, n_ring_index; -- response_t *end_pkt; -+ int start_pkt_ring_index; -+ u32 iocb_cnt = 0; - int rc = 0; -- u32 rsp_q_in; - - if (pkt->entry_count == 1) - return rc; -@@ -3727,34 +3726,18 @@ static int qla_chk_cont_iocb_avail(struct scsi_qla_host *vha, - else - start_pkt_ring_index = rsp->ring_index - 1; - -- if ((start_pkt_ring_index + pkt->entry_count) >= rsp->length) -- end_pkt_ring_index = start_pkt_ring_index + pkt->entry_count - -- rsp->length - 1; -+ if (rsp_q_in < start_pkt_ring_index) -+ /* q in ptr is wrapped */ -+ iocb_cnt = rsp->length - start_pkt_ring_index + rsp_q_in; - else -- end_pkt_ring_index = start_pkt_ring_index + pkt->entry_count - 1; -+ iocb_cnt = rsp_q_in - start_pkt_ring_index; - -- end_pkt = rsp->ring + end_pkt_ring_index; -- -- /* next pkt = end_pkt + 1 */ -- n_ring_index = end_pkt_ring_index + 1; -- if (n_ring_index >= rsp->length) -- n_ring_index = 0; -- -- rsp_q_in = rsp->qpair->use_shadow_reg ? *rsp->in_ptr : -- rd_reg_dword(rsp->rsp_q_in); -- -- /* rsp_q_in is either wrapped or pointing beyond endpkt */ -- if ((rsp_q_in < start_pkt_ring_index && rsp_q_in < n_ring_index) || -- rsp_q_in >= n_ring_index) -- /* all IOCBs arrived. */ -- rc = 0; -- else -+ if (iocb_cnt < pkt->entry_count) - rc = -EIO; - -- ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x5091, -- "%s - ring %p pkt %p end pkt %p entry count %#x rsp_q_in %d rc %d\n", -- __func__, rsp->ring, pkt, end_pkt, pkt->entry_count, -- rsp_q_in, rc); -+ ql_dbg(ql_dbg_init, vha, 0x5091, -+ "%s - ring %p pkt %p entry count %d iocb_cnt %d rsp_q_in %d rc %d\n", -+ __func__, rsp->ring, pkt, pkt->entry_count, iocb_cnt, rsp_q_in, rc); - - return rc; - } -@@ -3771,7 +3754,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - struct qla_hw_data *ha = vha->hw; - struct purex_entry_24xx *purex_entry; - struct purex_item *pure_item; -- u16 rsp_in = 0; -+ u16 rsp_in = 0, cur_ring_index; - int follow_inptr, is_shadow_hba; - - if (!ha->flags.fw_started) -@@ -3802,6 +3785,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - (!follow_inptr && - rsp->ring_ptr->signature != RESPONSE_PROCESSED)) { - pkt = (struct sts_entry_24xx *)rsp->ring_ptr; -+ cur_ring_index = rsp->ring_index; - - rsp->ring_index++; - if (rsp->ring_index == rsp->length) { -@@ -3922,7 +3906,17 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - break; - - case ELS_AUTH_ELS: -- if (qla_chk_cont_iocb_avail(vha, rsp, (response_t *)pkt)) { -+ if (qla_chk_cont_iocb_avail(vha, rsp, (response_t *)pkt, rsp_in)) { -+ /* -+ * ring_ptr and ring_index were -+ * pre-incremented above. Reset them -+ * back to current. Wait for next -+ * interrupt with all IOCBs to arrive -+ * and re-process. -+ */ -+ rsp->ring_ptr = (response_t *)pkt; -+ rsp->ring_index = cur_ring_index; -+ - ql_dbg(ql_dbg_init, vha, 0x5091, - "Defer processing ELS opcode %#x...\n", - purex_entry->els_frame_payload[3]); --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-crash-due-to-stale-srb-access-aroun.patch b/queue-5.18/scsi-qla2xxx-fix-crash-due-to-stale-srb-access-aroun.patch deleted file mode 100644 index 3238e59d025..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-crash-due-to-stale-srb-access-aroun.patch +++ /dev/null @@ -1,125 +0,0 @@ -From ff24e11b6f46bae7af4d61b2021903bdc747c5ec Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:02 -0700 -Subject: scsi: qla2xxx: Fix crash due to stale SRB access around I/O timeouts - -From: Arun Easi - -[ Upstream commit c39587bc0abaf16593f7abcdf8aeec3c038c7d52 ] - -Ensure SRB is returned during I/O timeout error escalation. If that is not -possible fail the escalation path. - -Following crash stack was seen: - -BUG: unable to handle kernel paging request at 0000002f56aa90f8 -IP: qla_chk_edif_rx_sa_delete_pending+0x14/0x30 [qla2xxx] -Call Trace: - ? qla2x00_status_entry+0x19f/0x1c50 [qla2xxx] - ? qla2x00_start_sp+0x116/0x1170 [qla2xxx] - ? dma_pool_alloc+0x1d6/0x210 - ? mempool_alloc+0x54/0x130 - ? qla24xx_process_response_queue+0x548/0x12b0 [qla2xxx] - ? qla_do_work+0x2d/0x40 [qla2xxx] - ? process_one_work+0x14c/0x390 - -Link: https://lore.kernel.org/r/20220616053508.27186-6-njavali@marvell.com -Fixes: d74595278f4a ("scsi: qla2xxx: Add multiple queue pair functionality.") -Cc: stable@vger.kernel.org -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_os.c | 43 +++++++++++++++++++++++++---------- - 1 file changed, 31 insertions(+), 12 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c -index daa9a3c3f7b5..f9ad0847782d 100644 ---- a/drivers/scsi/qla2xxx/qla_os.c -+++ b/drivers/scsi/qla2xxx/qla_os.c -@@ -1342,21 +1342,20 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) - /* - * Returns: QLA_SUCCESS or QLA_FUNCTION_FAILED. - */ --int --qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, -- uint64_t l, enum nexus_wait_type type) -+static int -+__qla2x00_eh_wait_for_pending_commands(struct qla_qpair *qpair, unsigned int t, -+ uint64_t l, enum nexus_wait_type type) - { - int cnt, match, status; - unsigned long flags; -- struct qla_hw_data *ha = vha->hw; -- struct req_que *req; -+ scsi_qla_host_t *vha = qpair->vha; -+ struct req_que *req = qpair->req; - srb_t *sp; - struct scsi_cmnd *cmd; - - status = QLA_SUCCESS; - -- spin_lock_irqsave(&ha->hardware_lock, flags); -- req = vha->req; -+ spin_lock_irqsave(qpair->qp_lock_ptr, flags); - for (cnt = 1; status == QLA_SUCCESS && - cnt < req->num_outstanding_cmds; cnt++) { - sp = req->outstanding_cmds[cnt]; -@@ -1383,12 +1382,32 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, - if (!match) - continue; - -- spin_unlock_irqrestore(&ha->hardware_lock, flags); -+ spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); - status = qla2x00_eh_wait_on_command(cmd); -- spin_lock_irqsave(&ha->hardware_lock, flags); -+ spin_lock_irqsave(qpair->qp_lock_ptr, flags); - } -- spin_unlock_irqrestore(&ha->hardware_lock, flags); -+ spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); -+ -+ return status; -+} -+ -+int -+qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, -+ uint64_t l, enum nexus_wait_type type) -+{ -+ struct qla_qpair *qpair; -+ struct qla_hw_data *ha = vha->hw; -+ int i, status = QLA_SUCCESS; - -+ status = __qla2x00_eh_wait_for_pending_commands(ha->base_qpair, t, l, -+ type); -+ for (i = 0; status == QLA_SUCCESS && i < ha->max_qpairs; i++) { -+ qpair = ha->queue_pair_map[i]; -+ if (!qpair) -+ continue; -+ status = __qla2x00_eh_wait_for_pending_commands(qpair, t, l, -+ type); -+ } - return status; - } - -@@ -1425,7 +1444,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) - return err; - - if (fcport->deleted) -- return SUCCESS; -+ return FAILED; - - ql_log(ql_log_info, vha, 0x8009, - "DEVICE RESET ISSUED nexus=%ld:%d:%llu cmd=%p.\n", vha->host_no, -@@ -1493,7 +1512,7 @@ qla2xxx_eh_target_reset(struct scsi_cmnd *cmd) - return err; - - if (fcport->deleted) -- return SUCCESS; -+ return FAILED; - - ql_log(ql_log_info, vha, 0x8009, - "TARGET RESET ISSUED nexus=%ld:%d cmd=%p.\n", vha->host_no, --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch-4818 b/queue-5.18/scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch-4818 deleted file mode 100644 index 323af66e2d8..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch-4818 +++ /dev/null @@ -1,116 +0,0 @@ -From ada2019561e89a831747aab73d489754049451a5 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Jul 2022 22:20:42 -0700 -Subject: scsi: qla2xxx: Fix discovery issues in FC-AL topology - -From: Arun Easi - -[ Upstream commit 47ccb113cead905bdc236571bf8ac6fed90321b3 ] - -A direct attach tape device, when gets swapped with another, was not -discovered. Fix this by looking at loop map and reinitialize link if there -are devices present. - -Link: https://lore.kernel.org/linux-scsi/baef87c3-5dad-3b47-44c1-6914bfc90108@cybernetics.com/ -Link: https://lore.kernel.org/r/20220713052045.10683-8-njavali@marvell.com -Cc: stable@vger.kernel.org -Reported-by: Tony Battersby -Tested-by: Tony Battersby -Reviewed-by: Himanshu Madhani -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_gbl.h | 3 ++- - drivers/scsi/qla2xxx/qla_init.c | 29 +++++++++++++++++++++++++++++ - drivers/scsi/qla2xxx/qla_mbx.c | 5 ++++- - 3 files changed, 35 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h -index 20ae0ef7d078..331b33200f50 100644 ---- a/drivers/scsi/qla2xxx/qla_gbl.h -+++ b/drivers/scsi/qla2xxx/qla_gbl.h -@@ -436,7 +436,8 @@ extern int - qla2x00_get_resource_cnts(scsi_qla_host_t *); - - extern int --qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); -+qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map, -+ u8 *num_entries); - - extern int - qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *, -diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c -index 01c7eda51d5a..51503a316b10 100644 ---- a/drivers/scsi/qla2xxx/qla_init.c -+++ b/drivers/scsi/qla2xxx/qla_init.c -@@ -5516,6 +5516,22 @@ static int qla2x00_configure_n2n_loop(scsi_qla_host_t *vha) - return QLA_FUNCTION_FAILED; - } - -+static void -+qla_reinitialize_link(scsi_qla_host_t *vha) -+{ -+ int rval; -+ -+ atomic_set(&vha->loop_state, LOOP_DOWN); -+ atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); -+ rval = qla2x00_full_login_lip(vha); -+ if (rval == QLA_SUCCESS) { -+ ql_dbg(ql_dbg_disc, vha, 0xd050, "Link reinitialized\n"); -+ } else { -+ ql_dbg(ql_dbg_disc, vha, 0xd051, -+ "Link reinitialization failed (%d)\n", rval); -+ } -+} -+ - /* - * qla2x00_configure_local_loop - * Updates Fibre Channel Device Database with local loop devices. -@@ -5567,6 +5583,19 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) - spin_unlock_irqrestore(&vha->work_lock, flags); - - if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { -+ u8 loop_map_entries = 0; -+ int rc; -+ -+ rc = qla2x00_get_fcal_position_map(vha, NULL, -+ &loop_map_entries); -+ if (rc == QLA_SUCCESS && loop_map_entries > 1) { -+ /* -+ * There are devices that are still not logged -+ * in. Reinitialize to give them a chance. -+ */ -+ qla_reinitialize_link(vha); -+ return QLA_FUNCTION_FAILED; -+ } - set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); - set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); - } -diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c -index bcade1deb798..86d8c455c07a 100644 ---- a/drivers/scsi/qla2xxx/qla_mbx.c -+++ b/drivers/scsi/qla2xxx/qla_mbx.c -@@ -3068,7 +3068,8 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *vha) - * Kernel context. - */ - int --qla2x00_get_fcal_position_map(scsi_qla_host_t *vha, char *pos_map) -+qla2x00_get_fcal_position_map(scsi_qla_host_t *vha, char *pos_map, -+ u8 *num_entries) - { - int rval; - mbx_cmd_t mc; -@@ -3108,6 +3109,8 @@ qla2x00_get_fcal_position_map(scsi_qla_host_t *vha, char *pos_map) - - if (pos_map) - memcpy(pos_map, pmap, FCAL_MAP_SIZE); -+ if (num_entries) -+ *num_entries = pmap[0]; - } - dma_pool_free(ha->s_dma_pool, pmap, pmap_dma); - --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-erroneous-mailbox-timeout-after-pci.patch b/queue-5.18/scsi-qla2xxx-fix-erroneous-mailbox-timeout-after-pci.patch deleted file mode 100644 index 21005b32a42..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-erroneous-mailbox-timeout-after-pci.patch +++ /dev/null @@ -1,67 +0,0 @@ -From ed1aa089d6371962ed13e3fe349ef0d02f660393 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:07 -0700 -Subject: scsi: qla2xxx: Fix erroneous mailbox timeout after PCI error - injection - -From: Quinn Tran - -[ Upstream commit f260694e6463b63ae550aad25ddefe94cb1904da ] - -Clear wait for mailbox interrupt flag to prevent stale mailbox: - -Feb 22 05:22:56 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-500a:4: LOOP UP detected (16 Gbps). -Feb 22 05:22:59 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-d04c:4: MBX Command timeout for cmd 69, ... - -To fix the issue, driver needs to clear the MBX_INTR_WAIT flag on purging -the mailbox. When the stale mailbox completion does arrive, it will be -dropped. - -Link: https://lore.kernel.org/r/20220616053508.27186-11-njavali@marvell.com -Fixes: b6faaaf796d7 ("scsi: qla2xxx: Serialize mailbox request") -Cc: Naresh Bannoth -Cc: Kyle Mahlkuch -Cc: stable@vger.kernel.org -Reported-by: Naresh Bannoth -Tested-by: Naresh Bannoth -Signed-off-by: Quinn Tran -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_mbx.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c -index 15d8866046b3..bcade1deb798 100644 ---- a/drivers/scsi/qla2xxx/qla_mbx.c -+++ b/drivers/scsi/qla2xxx/qla_mbx.c -@@ -276,6 +276,12 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) - atomic_inc(&ha->num_pend_mbx_stage3); - if (!wait_for_completion_timeout(&ha->mbx_intr_comp, - mcp->tov * HZ)) { -+ ql_dbg(ql_dbg_mbx, vha, 0x117a, -+ "cmd=%x Timeout.\n", command); -+ spin_lock_irqsave(&ha->hardware_lock, flags); -+ clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); -+ spin_unlock_irqrestore(&ha->hardware_lock, flags); -+ - if (chip_reset != ha->chip_reset) { - eeh_delay = ha->flags.eeh_busy ? 1 : 0; - -@@ -288,12 +294,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) - rval = QLA_ABORTED; - goto premature_exit; - } -- ql_dbg(ql_dbg_mbx, vha, 0x117a, -- "cmd=%x Timeout.\n", command); -- spin_lock_irqsave(&ha->hardware_lock, flags); -- clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); -- spin_unlock_irqrestore(&ha->hardware_lock, flags); -- - } else if (ha->flags.purge_mbox || - chip_reset != ha->chip_reset) { - eeh_delay = ha->flags.eeh_busy ? 1 : 0; --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-excessive-i-o-error-messages-by-def.patch b/queue-5.18/scsi-qla2xxx-fix-excessive-i-o-error-messages-by-def.patch deleted file mode 100644 index 3d45b9e051e..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-excessive-i-o-error-messages-by-def.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 1537088b80ff6a934403b341ee3ffb445867f3d3 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:34:58 -0700 -Subject: scsi: qla2xxx: Fix excessive I/O error messages by default - -From: Arun Easi - -[ Upstream commit bff4873c709085e09d0ffae0c25b8e65256e3205 ] - -Disable printing I/O error messages by default. The messages will be -printed only when logging was enabled. - -Link: https://lore.kernel.org/r/20220616053508.27186-2-njavali@marvell.com -Fixes: 8e2d81c6b5be ("scsi: qla2xxx: Fix excessive messages during device logout") -Cc: stable@vger.kernel.org -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_isr.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c -index ad55eace66aa..5e99f559230f 100644 ---- a/drivers/scsi/qla2xxx/qla_isr.c -+++ b/drivers/scsi/qla2xxx/qla_isr.c -@@ -2637,7 +2637,7 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, - } - - if (unlikely(logit)) -- ql_log(ql_dbg_io, fcport->vha, 0x5060, -+ ql_dbg(ql_dbg_io, fcport->vha, 0x5060, - "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n", - sp->name, sp->handle, comp_status, - fd->transferred_length, le32_to_cpu(sts->residual_len), -@@ -3495,7 +3495,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) - - out: - if (logit) -- ql_log(ql_dbg_io, fcport->vha, 0x3022, -+ ql_dbg(ql_dbg_io, fcport->vha, 0x3022, - "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu portid=%02x%02x%02x oxid=0x%x cdb=%10phN len=0x%x rsp_info=0x%x resid=0x%x fw_resid=0x%x sp=%p cp=%p.\n", - comp_status, scsi_status, res, vha->host_no, - cp->device->id, cp->device->lun, fcport->d_id.b.domain, --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-imbalance-vha-vref_count.patch-27970 b/queue-5.18/scsi-qla2xxx-fix-imbalance-vha-vref_count.patch-27970 deleted file mode 100644 index 0b1d6e1dcf8..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-imbalance-vha-vref_count.patch-27970 +++ /dev/null @@ -1,61 +0,0 @@ -From 10606f5e0ba0d8d8210cc69be72aa4035377a56d Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Jul 2022 22:20:41 -0700 -Subject: scsi: qla2xxx: Fix imbalance vha->vref_count - -From: Quinn Tran - -[ Upstream commit 63fa7f2644b4b48e1913af33092c044bf48e9321 ] - -vref_count took an extra decrement in the task management path. Add an -extra ref count to compensate the imbalance. - -Link: https://lore.kernel.org/r/20220713052045.10683-7-njavali@marvell.com -Cc: stable@vger.kernel.org -Reviewed-by: Himanshu Madhani -Signed-off-by: Quinn Tran -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_init.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c -index 3df66934fb1e..01c7eda51d5a 100644 ---- a/drivers/scsi/qla2xxx/qla_init.c -+++ b/drivers/scsi/qla2xxx/qla_init.c -@@ -168,6 +168,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) - struct srb_iocb *abt_iocb; - srb_t *sp; - int rval = QLA_FUNCTION_FAILED; -+ uint8_t bail; - - /* ref: INIT for ABTS command */ - sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, -@@ -175,6 +176,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) - if (!sp) - return QLA_MEMORY_ALLOC_FAILED; - -+ QLA_VHA_MARK_BUSY(vha, bail); - abt_iocb = &sp->u.iocb_cmd; - sp->type = SRB_ABT_CMD; - sp->name = "abort"; -@@ -2018,12 +2020,14 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, - struct srb_iocb *tm_iocb; - srb_t *sp; - int rval = QLA_FUNCTION_FAILED; -+ uint8_t bail; - - /* ref: INIT */ - sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); - if (!sp) - goto done; - -+ QLA_VHA_MARK_BUSY(vha, bail); - sp->type = SRB_TM_CMD; - sp->name = "tmf"; - qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-pe.patch b/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-pe.patch deleted file mode 100644 index 1bb75978768..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-pe.patch +++ /dev/null @@ -1,41 +0,0 @@ -From eea51e30df139a84ea79448c0a19833387a8bb12 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:03 -0700 -Subject: scsi: qla2xxx: Fix losing FCP-2 targets during port perturbation - tests - -From: Arun Easi - -[ Upstream commit 58d1c124cd79ea686b512043c5bd515590b2ed95 ] - -When a mix of FCP-2 (tape) and non-FCP-2 targets are present, FCP-2 target -state was incorrectly transitioned when both of the targets were gone. Fix -this by ignoring state transition for FCP-2 targets. - -Link: https://lore.kernel.org/r/20220616053508.27186-7-njavali@marvell.com -Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target") -Cc: stable@vger.kernel.org -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_gs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c -index c914b5df9c12..7ca734337000 100644 ---- a/drivers/scsi/qla2xxx/qla_gs.c -+++ b/drivers/scsi/qla2xxx/qla_gs.c -@@ -3629,7 +3629,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) - do_delete) { - if (fcport->loop_id != FC_NO_LOOP_ID) { - if (fcport->flags & FCF_FCP2_DEVICE) -- fcport->logout_on_delete = 0; -+ continue; - - ql_log(ql_log_warn, vha, 0x20f0, - "%s %d %8phC post del sess\n", --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-d.patch b/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-d.patch deleted file mode 100644 index 86c4dce1d60..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-d.patch +++ /dev/null @@ -1,72 +0,0 @@ -From cd632680dceb7e22c58ec69f997ffaaf7c4c0dac Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:06 -0700 -Subject: scsi: qla2xxx: Fix losing FCP-2 targets on long port disable with - I/Os - -From: Arun Easi - -[ Upstream commit 2416ccd3815ba1613e10a6da0a24ef21acfe5633 ] - -FCP-2 devices were not coming back online once they were lost, login -retries exhausted, and then came back up. Fix this by accepting RSCN when -the device is not online. - -Link: https://lore.kernel.org/r/20220616053508.27186-10-njavali@marvell.com -Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target") -Cc: stable@vger.kernel.org -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c -index a0d26e2e0ce1..3df66934fb1e 100644 ---- a/drivers/scsi/qla2xxx/qla_init.c -+++ b/drivers/scsi/qla2xxx/qla_init.c -@@ -1832,7 +1832,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) - case RSCN_PORT_ADDR: - fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); - if (fcport) { -- if (fcport->flags & FCF_FCP2_DEVICE) { -+ if (fcport->flags & FCF_FCP2_DEVICE && -+ atomic_read(&fcport->state) == FCS_ONLINE) { - ql_dbg(ql_dbg_disc, vha, 0x2115, - "Delaying session delete for FCP2 portid=%06x %8phC ", - fcport->d_id.b24, fcport->port_name); -@@ -1864,7 +1865,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) - break; - case RSCN_AREA_ADDR: - list_for_each_entry(fcport, &vha->vp_fcports, list) { -- if (fcport->flags & FCF_FCP2_DEVICE) -+ if (fcport->flags & FCF_FCP2_DEVICE && -+ atomic_read(&fcport->state) == FCS_ONLINE) - continue; - - if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) { -@@ -1875,7 +1877,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) - break; - case RSCN_DOM_ADDR: - list_for_each_entry(fcport, &vha->vp_fcports, list) { -- if (fcport->flags & FCF_FCP2_DEVICE) -+ if (fcport->flags & FCF_FCP2_DEVICE && -+ atomic_read(&fcport->state) == FCS_ONLINE) - continue; - - if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) { -@@ -1887,7 +1890,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) - case RSCN_FAB_ADDR: - default: - list_for_each_entry(fcport, &vha->vp_fcports, list) { -- if (fcport->flags & FCF_FCP2_DEVICE) -+ if (fcport->flags & FCF_FCP2_DEVICE && -+ atomic_read(&fcport->state) == FCS_ONLINE) - continue; - - fcport->scan_needed = 1; --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-losing-target-when-it-reappears-dur.patch b/queue-5.18/scsi-qla2xxx-fix-losing-target-when-it-reappears-dur.patch deleted file mode 100644 index 0fe225a3dfd..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-losing-target-when-it-reappears-dur.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a9228406b04cbe27522f81b77535befe4c5e7924 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:04 -0700 -Subject: scsi: qla2xxx: Fix losing target when it reappears during delete - -From: Arun Easi - -[ Upstream commit 118b0c863c8f5629cc5271fc24d72d926e0715d9 ] - -FC target disappeared during port perturbation tests due to a race that -tramples target state. Fix the issue by adding state checks before -proceeding. - -Link: https://lore.kernel.org/r/20220616053508.27186-8-njavali@marvell.com -Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target") -Cc: stable@vger.kernel.org -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_attr.c | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c -index 3b3e4234f37a..412ad888bdc1 100644 ---- a/drivers/scsi/qla2xxx/qla_attr.c -+++ b/drivers/scsi/qla2xxx/qla_attr.c -@@ -2716,17 +2716,24 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) - if (!fcport) - return; - -- /* Now that the rport has been deleted, set the fcport state to -- FCS_DEVICE_DEAD */ -- qla2x00_set_fcport_state(fcport, FCS_DEVICE_DEAD); -+ -+ /* -+ * Now that the rport has been deleted, set the fcport state to -+ * FCS_DEVICE_DEAD, if the fcport is still lost. -+ */ -+ if (fcport->scan_state != QLA_FCPORT_FOUND) -+ qla2x00_set_fcport_state(fcport, FCS_DEVICE_DEAD); - - /* - * Transport has effectively 'deleted' the rport, clear - * all local references. - */ - spin_lock_irqsave(host->host_lock, flags); -- fcport->rport = fcport->drport = NULL; -- *((fc_port_t **)rport->dd_data) = NULL; -+ /* Confirm port has not reappeared before clearing pointers. */ -+ if (rport->port_state != FC_PORTSTATE_ONLINE) { -+ fcport->rport = fcport->drport = NULL; -+ *((fc_port_t **)rport->dd_data) = NULL; -+ } - spin_unlock_irqrestore(host->host_lock, flags); - - if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) -@@ -2759,9 +2766,12 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) - /* - * At this point all fcport's software-states are cleared. Perform any - * final cleanup of firmware resources (PCBs and XCBs). -+ * -+ * Attempt to cleanup only lost devices. - */ - if (fcport->loop_id != FC_NO_LOOP_ID) { -- if (IS_FWI2_CAPABLE(fcport->vha->hw)) { -+ if (IS_FWI2_CAPABLE(fcport->vha->hw) && -+ fcport->scan_state != QLA_FCPORT_FOUND) { - if (fcport->loop_id != FC_NO_LOOP_ID) - fcport->logout_on_delete = 1; - -@@ -2771,7 +2781,7 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) - __LINE__); - qlt_schedule_sess_for_deletion(fcport); - } -- } else { -+ } else if (!IS_FWI2_CAPABLE(fcport->vha->hw)) { - qla2x00_port_logout(fcport->vha, fcport); - } - } --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-fix-response-queue-handler-reading-stal.patch b/queue-5.18/scsi-qla2xxx-fix-response-queue-handler-reading-stal.patch deleted file mode 100644 index 08cf6a62ebc..00000000000 --- a/queue-5.18/scsi-qla2xxx-fix-response-queue-handler-reading-stal.patch +++ /dev/null @@ -1,128 +0,0 @@ -From ac1c86d5f6f0826e7897d9395a1c6abba08a0f8d Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Jul 2022 22:20:39 -0700 -Subject: scsi: qla2xxx: Fix response queue handler reading stale packets - -From: Arun Easi - -[ Upstream commit b1f707146923335849fb70237eec27d4d1ae7d62 ] - -On some platforms, the current logic of relying on finding new packet -solely based on signature pattern can lead to driver reading stale -packets. Though this is a bug in those platforms, reduce such exposures by -limiting reading packets until the IN pointer. - -Two module parameters are introduced: - - ql2xrspq_follow_inptr: - - When set, on newer adapters that has queue pointer shadowing, look for - response packets only until response queue in pointer. - - When reset, response packets are read based on a signature pattern - logic (old way). - - ql2xrspq_follow_inptr_legacy: - - Like ql2xrspq_follow_inptr, but for those adapters where there is no - queue pointer shadowing. - -Link: https://lore.kernel.org/r/20220713052045.10683-5-njavali@marvell.com -Cc: stable@vger.kernel.org -Reviewed-by: Himanshu Madhani -Signed-off-by: Arun Easi -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_gbl.h | 2 ++ - drivers/scsi/qla2xxx/qla_isr.c | 24 +++++++++++++++++++++++- - drivers/scsi/qla2xxx/qla_os.c | 10 ++++++++++ - 3 files changed, 35 insertions(+), 1 deletion(-) - -diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h -index 84b44454c231..20ae0ef7d078 100644 ---- a/drivers/scsi/qla2xxx/qla_gbl.h -+++ b/drivers/scsi/qla2xxx/qla_gbl.h -@@ -193,6 +193,8 @@ extern int ql2xsecenable; - extern int ql2xenforce_iocb_limit; - extern int ql2xabts_wait_nvme; - extern u32 ql2xnvme_queues; -+extern int ql2xrspq_follow_inptr; -+extern int ql2xrspq_follow_inptr_legacy; - - extern int qla2x00_loop_reset(scsi_qla_host_t *); - extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int); -diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c -index de348628aa53..c509bb23af40 100644 ---- a/drivers/scsi/qla2xxx/qla_isr.c -+++ b/drivers/scsi/qla2xxx/qla_isr.c -@@ -3771,6 +3771,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - struct qla_hw_data *ha = vha->hw; - struct purex_entry_24xx *purex_entry; - struct purex_item *pure_item; -+ u16 rsp_in = 0; -+ int follow_inptr, is_shadow_hba; - - if (!ha->flags.fw_started) - return; -@@ -3780,7 +3782,25 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - qla_cpu_update(rsp->qpair, smp_processor_id()); - } - -- while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) { -+#define __update_rsp_in(_update, _is_shadow_hba, _rsp, _rsp_in) \ -+ do { \ -+ if (_update) { \ -+ _rsp_in = _is_shadow_hba ? *(_rsp)->in_ptr : \ -+ rd_reg_dword_relaxed((_rsp)->rsp_q_in); \ -+ } \ -+ } while (0) -+ -+ is_shadow_hba = IS_SHADOW_REG_CAPABLE(ha); -+ follow_inptr = is_shadow_hba ? ql2xrspq_follow_inptr : -+ ql2xrspq_follow_inptr_legacy; -+ -+ __update_rsp_in(follow_inptr, is_shadow_hba, rsp, rsp_in); -+ -+ while ((likely(follow_inptr && -+ rsp->ring_index != rsp_in && -+ rsp->ring_ptr->signature != RESPONSE_PROCESSED)) || -+ (!follow_inptr && -+ rsp->ring_ptr->signature != RESPONSE_PROCESSED)) { - pkt = (struct sts_entry_24xx *)rsp->ring_ptr; - - rsp->ring_index++; -@@ -3893,6 +3913,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, - } - pure_item = qla27xx_copy_fpin_pkt(vha, - (void **)&pkt, &rsp); -+ __update_rsp_in(follow_inptr, is_shadow_hba, -+ rsp, rsp_in); - if (!pure_item) - break; - qla24xx_queue_purex_item(vha, pure_item, -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c -index f9ad0847782d..3bbfce3ccf2e 100644 ---- a/drivers/scsi/qla2xxx/qla_os.c -+++ b/drivers/scsi/qla2xxx/qla_os.c -@@ -338,6 +338,16 @@ module_param(ql2xdelay_before_pci_error_handling, uint, 0644); - MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling, - "Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n"); - -+int ql2xrspq_follow_inptr = 1; -+module_param(ql2xrspq_follow_inptr, int, 0644); -+MODULE_PARM_DESC(ql2xrspq_follow_inptr, -+ "Follow RSP IN pointer for RSP updates for HBAs 27xx and newer (default: 1)."); -+ -+int ql2xrspq_follow_inptr_legacy = 1; -+module_param(ql2xrspq_follow_inptr_legacy, int, 0644); -+MODULE_PARM_DESC(ql2xrspq_follow_inptr_legacy, -+ "Follow RSP IN pointer for RSP updates for HBAs older than 27XX. (default: 1)."); -+ - static void qla2x00_clear_drv_active(struct qla_hw_data *); - static void qla2x00_free_device(scsi_qla_host_t *); - static int qla2xxx_map_queues(struct Scsi_Host *shost); --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-turn-off-multi-queue-for-8g-adapters.patch-18430 b/queue-5.18/scsi-qla2xxx-turn-off-multi-queue-for-8g-adapters.patch-18430 deleted file mode 100644 index 710fef0aff4..00000000000 --- a/queue-5.18/scsi-qla2xxx-turn-off-multi-queue-for-8g-adapters.patch-18430 +++ /dev/null @@ -1,68 +0,0 @@ -From 6467d2dbfbfe7cc5abe98d997e428cbfb58354d9 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:01 -0700 -Subject: scsi: qla2xxx: Turn off multi-queue for 8G adapters - -From: Quinn Tran - -[ Upstream commit 5304673bdb1635e27555bd636fd5d6956f1cd552 ] - -For 8G adapters, multi-queue was enabled accidentally. Make sure -multi-queue is not enabled. - -Link: https://lore.kernel.org/r/20220616053508.27186-5-njavali@marvell.com -Cc: stable@vger.kernel.org -Signed-off-by: Quinn Tran -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_def.h | 4 ++-- - drivers/scsi/qla2xxx/qla_isr.c | 16 ++++++---------- - 2 files changed, 8 insertions(+), 12 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h -index 4cbaea4b993e..01cdd5f8723c 100644 ---- a/drivers/scsi/qla2xxx/qla_def.h -+++ b/drivers/scsi/qla2xxx/qla_def.h -@@ -4268,8 +4268,8 @@ struct qla_hw_data { - #define IS_OEM_001(ha) ((ha)->device_type & DT_OEM_001) - #define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS) - #define IS_CT6_SUPPORTED(ha) ((ha)->device_type & DT_CT6_SUPPORTED) --#define IS_MQUE_CAPABLE(ha) ((ha)->mqenable || IS_QLA83XX(ha) || \ -- IS_QLA27XX(ha) || IS_QLA28XX(ha)) -+#define IS_MQUE_CAPABLE(ha) (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \ -+ IS_QLA28XX(ha)) - #define IS_BIDI_CAPABLE(ha) \ - (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) - /* Bit 21 of fw_attributes decides the MCTP capabilities */ -diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c -index 5e99f559230f..de348628aa53 100644 ---- a/drivers/scsi/qla2xxx/qla_isr.c -+++ b/drivers/scsi/qla2xxx/qla_isr.c -@@ -4419,16 +4419,12 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) - } - - /* Enable MSI-X vector for response queue update for queue 0 */ -- if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { -- if (ha->msixbase && ha->mqiobase && -- (ha->max_rsp_queues > 1 || ha->max_req_queues > 1 || -- ql2xmqsupport)) -- ha->mqenable = 1; -- } else -- if (ha->mqiobase && -- (ha->max_rsp_queues > 1 || ha->max_req_queues > 1 || -- ql2xmqsupport)) -- ha->mqenable = 1; -+ if (IS_MQUE_CAPABLE(ha) && -+ (ha->msixbase && ha->mqiobase && ha->max_qpairs)) -+ ha->mqenable = 1; -+ else -+ ha->mqenable = 0; -+ - ql_dbg(ql_dbg_multiq, vha, 0xc005, - "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n", - ha->mqiobase, ha->max_rsp_queues, ha->max_req_queues); --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-update-manufacturer-details.patch b/queue-5.18/scsi-qla2xxx-update-manufacturer-details.patch deleted file mode 100644 index 74b239db3d5..00000000000 --- a/queue-5.18/scsi-qla2xxx-update-manufacturer-details.patch +++ /dev/null @@ -1,52 +0,0 @@ -From fc0719b2de5e78eb7fd2b53cd1e1f8a06e81653f Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Jul 2022 22:20:44 -0700 -Subject: scsi: qla2xxx: Update manufacturer details - -From: Bikash Hazarika - -[ Upstream commit 1ccad27716ecad1fd58c35e579bedb81fa5e1ad5 ] - -Update manufacturer details to indicate Marvell Semiconductors. - -Link: https://lore.kernel.org/r/20220713052045.10683-10-njavali@marvell.com -Cc: stable@vger.kernel.org -Reviewed-by: Himanshu Madhani -Signed-off-by: Bikash Hazarika -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_def.h | 2 +- - drivers/scsi/qla2xxx/qla_gs.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h -index 01cdd5f8723c..17b8a4e86ffb 100644 ---- a/drivers/scsi/qla2xxx/qla_def.h -+++ b/drivers/scsi/qla2xxx/qla_def.h -@@ -78,7 +78,7 @@ typedef union { - #include "qla_nvme.h" - #define QLA2XXX_DRIVER_NAME "qla2xxx" - #define QLA2XXX_APIDEV "ql2xapidev" --#define QLA2XXX_MANUFACTURER "QLogic Corporation" -+#define QLA2XXX_MANUFACTURER "Marvell Semiconductor, Inc." - - /* - * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, -diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c -index 7ca734337000..64ab070b8716 100644 ---- a/drivers/scsi/qla2xxx/qla_gs.c -+++ b/drivers/scsi/qla2xxx/qla_gs.c -@@ -1616,7 +1616,7 @@ qla2x00_hba_attributes(scsi_qla_host_t *vha, void *entries, - eiter->type = cpu_to_be16(FDMI_HBA_MANUFACTURER); - alen = scnprintf( - eiter->a.manufacturer, sizeof(eiter->a.manufacturer), -- "%s", "QLogic Corporation"); -+ "%s", QLA2XXX_MANUFACTURER); - alen += FDMI_ATTR_ALIGNMENT(alen); - alen += FDMI_ATTR_TYPELEN(eiter); - eiter->len = cpu_to_be16(alen); --- -2.35.1 - diff --git a/queue-5.18/scsi-qla2xxx-wind-down-adapter-after-pcie-error.patch-27996 b/queue-5.18/scsi-qla2xxx-wind-down-adapter-after-pcie-error.patch-27996 deleted file mode 100644 index 978938a28cb..00000000000 --- a/queue-5.18/scsi-qla2xxx-wind-down-adapter-after-pcie-error.patch-27996 +++ /dev/null @@ -1,210 +0,0 @@ -From 7d35e2215d13472f85fd7000bc0f76847bc4d08e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Jun 2022 22:35:00 -0700 -Subject: scsi: qla2xxx: Wind down adapter after PCIe error - -From: Quinn Tran - -[ Upstream commit d3117c83ba316b3200d9f2fe900f2b9a5525a25c ] - -Put adapter into a wind down state if OS does not make any attempt to -recover the adapter after PCIe error. - -Link: https://lore.kernel.org/r/20220616053508.27186-4-njavali@marvell.com -Cc: stable@vger.kernel.org -Signed-off-by: Quinn Tran -Signed-off-by: Nilesh Javali -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin ---- - drivers/scsi/qla2xxx/qla_bsg.c | 10 ++++++- - drivers/scsi/qla2xxx/qla_def.h | 4 +++ - drivers/scsi/qla2xxx/qla_init.c | 20 ++++++++++++++ - drivers/scsi/qla2xxx/qla_os.c | 48 +++++++++++++++++++++++++++++++++ - 4 files changed, 81 insertions(+), 1 deletion(-) - -diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c -index c2f00f076f79..726af9e40572 100644 ---- a/drivers/scsi/qla2xxx/qla_bsg.c -+++ b/drivers/scsi/qla2xxx/qla_bsg.c -@@ -2975,6 +2975,13 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job) - - ql_log(ql_log_info, vha, 0x708b, "%s CMD timeout. bsg ptr %p.\n", - __func__, bsg_job); -+ -+ if (qla2x00_isp_reg_stat(ha)) { -+ ql_log(ql_log_info, vha, 0x9007, -+ "PCI/Register disconnect.\n"); -+ qla_pci_set_eeh_busy(vha); -+ } -+ - /* find the bsg job from the active list of commands */ - spin_lock_irqsave(&ha->hardware_lock, flags); - for (que = 0; que < ha->max_req_queues; que++) { -@@ -2992,7 +2999,8 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job) - sp->u.bsg_job == bsg_job) { - req->outstanding_cmds[cnt] = NULL; - spin_unlock_irqrestore(&ha->hardware_lock, flags); -- if (ha->isp_ops->abort_command(sp)) { -+ -+ if (!ha->flags.eeh_busy && ha->isp_ops->abort_command(sp)) { - ql_log(ql_log_warn, vha, 0x7089, - "mbx abort_command failed.\n"); - bsg_reply->result = -EIO; -diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h -index 4062d46f33a6..4cbaea4b993e 100644 ---- a/drivers/scsi/qla2xxx/qla_def.h -+++ b/drivers/scsi/qla2xxx/qla_def.h -@@ -4048,6 +4048,9 @@ struct qla_hw_data { - uint32_t n2n_fw_acc_sec:1; - uint32_t plogi_template_valid:1; - uint32_t port_isolated:1; -+ uint32_t eeh_flush:2; -+#define EEH_FLUSH_RDY 1 -+#define EEH_FLUSH_DONE 2 - } flags; - - uint16_t max_exchg; -@@ -4082,6 +4085,7 @@ struct qla_hw_data { - uint32_t rsp_que_len; - uint32_t req_que_off; - uint32_t rsp_que_off; -+ unsigned long eeh_jif; - - /* Multi queue data structs */ - device_reg_t *mqiobase; -diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c -index 7bd10b4ed9ed..a0d26e2e0ce1 100644 ---- a/drivers/scsi/qla2xxx/qla_init.c -+++ b/drivers/scsi/qla2xxx/qla_init.c -@@ -47,6 +47,7 @@ qla2x00_sp_timeout(struct timer_list *t) - { - srb_t *sp = from_timer(sp, t, u.iocb_cmd.timer); - struct srb_iocb *iocb; -+ scsi_qla_host_t *vha = sp->vha; - - WARN_ON(irqs_disabled()); - iocb = &sp->u.iocb_cmd; -@@ -54,6 +55,12 @@ qla2x00_sp_timeout(struct timer_list *t) - - /* ref: TMR */ - kref_put(&sp->cmd_kref, qla2x00_sp_release); -+ -+ if (vha && qla2x00_isp_reg_stat(vha->hw)) { -+ ql_log(ql_log_info, vha, 0x9008, -+ "PCI/Register disconnect.\n"); -+ qla_pci_set_eeh_busy(vha); -+ } - } - - void qla2x00_sp_free(srb_t *sp) -@@ -9669,6 +9676,12 @@ int qla2xxx_disable_port(struct Scsi_Host *host) - - vha->hw->flags.port_isolated = 1; - -+ if (qla2x00_isp_reg_stat(vha->hw)) { -+ ql_log(ql_log_info, vha, 0x9006, -+ "PCI/Register disconnect, exiting.\n"); -+ qla_pci_set_eeh_busy(vha); -+ return FAILED; -+ } - if (qla2x00_chip_is_down(vha)) - return 0; - -@@ -9684,6 +9697,13 @@ int qla2xxx_enable_port(struct Scsi_Host *host) - { - scsi_qla_host_t *vha = shost_priv(host); - -+ if (qla2x00_isp_reg_stat(vha->hw)) { -+ ql_log(ql_log_info, vha, 0x9001, -+ "PCI/Register disconnect, exiting.\n"); -+ qla_pci_set_eeh_busy(vha); -+ return FAILED; -+ } -+ - vha->hw->flags.port_isolated = 0; - /* Set the flag to 1, so that isp_abort can proceed */ - vha->flags.online = 1; -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c -index 3c68dad00d04..daa9a3c3f7b5 100644 ---- a/drivers/scsi/qla2xxx/qla_os.c -+++ b/drivers/scsi/qla2xxx/qla_os.c -@@ -333,6 +333,11 @@ MODULE_PARM_DESC(ql2xabts_wait_nvme, - "To wait for ABTS response on I/O timeouts for NVMe. (default: 1)"); - - -+u32 ql2xdelay_before_pci_error_handling = 5; -+module_param(ql2xdelay_before_pci_error_handling, uint, 0644); -+MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling, -+ "Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n"); -+ - static void qla2x00_clear_drv_active(struct qla_hw_data *); - static void qla2x00_free_device(scsi_qla_host_t *); - static int qla2xxx_map_queues(struct Scsi_Host *shost); -@@ -7239,6 +7244,44 @@ static void qla_heart_beat(struct scsi_qla_host *vha, u16 dpc_started) - } - } - -+static void qla_wind_down_chip(scsi_qla_host_t *vha) -+{ -+ struct qla_hw_data *ha = vha->hw; -+ -+ if (!ha->flags.eeh_busy) -+ return; -+ if (ha->pci_error_state) -+ /* system is trying to recover */ -+ return; -+ -+ /* -+ * Current system is not handling PCIE error. At this point, this is -+ * best effort to wind down the adapter. -+ */ -+ if (time_after_eq(jiffies, ha->eeh_jif + ql2xdelay_before_pci_error_handling * HZ) && -+ !ha->flags.eeh_flush) { -+ ql_log(ql_log_info, vha, 0x9009, -+ "PCI Error detected, attempting to reset hardware.\n"); -+ -+ ha->isp_ops->reset_chip(vha); -+ ha->isp_ops->disable_intrs(ha); -+ -+ ha->flags.eeh_flush = EEH_FLUSH_RDY; -+ ha->eeh_jif = jiffies; -+ -+ } else if (ha->flags.eeh_flush == EEH_FLUSH_RDY && -+ time_after_eq(jiffies, ha->eeh_jif + 5 * HZ)) { -+ pci_clear_master(ha->pdev); -+ -+ /* flush all command */ -+ qla2x00_abort_isp_cleanup(vha); -+ ha->flags.eeh_flush = EEH_FLUSH_DONE; -+ -+ ql_log(ql_log_info, vha, 0x900a, -+ "PCI Error handling complete, all IOs aborted.\n"); -+ } -+} -+ - /************************************************************************** - * qla2x00_timer - * -@@ -7262,6 +7305,8 @@ qla2x00_timer(struct timer_list *t) - fc_port_t *fcport = NULL; - - if (ha->flags.eeh_busy) { -+ qla_wind_down_chip(vha); -+ - ql_dbg(ql_dbg_timer, vha, 0x6000, - "EEH = %d, restarting timer.\n", - ha->flags.eeh_busy); -@@ -7842,6 +7887,9 @@ void qla_pci_set_eeh_busy(struct scsi_qla_host *vha) - - spin_lock_irqsave(&base_vha->work_lock, flags); - if (!ha->flags.eeh_busy) { -+ ha->eeh_jif = jiffies; -+ ha->flags.eeh_flush = 0; -+ - ha->flags.eeh_busy = 1; - do_cleanup = true; - } --- -2.35.1 - diff --git a/queue-5.18/series b/queue-5.18/series index 1a109963018..cb3c66c8166 100644 --- a/queue-5.18/series +++ b/queue-5.18/series @@ -990,21 +990,12 @@ drivers-base-fix-userspace-break-from-using-bin_attributes-for-cpumap-and-cpulis drm-mediatek-keep-dsi-as-lp00-before-dcs-cmds-transf.patch crypto-blake2s-remove-shash-module.patch drm-dp-mst-read-the-extended-dpcd-capabilities-durin.patch -scsi-qla2xxx-fix-excessive-i-o-error-messages-by-def.patch -scsi-qla2xxx-wind-down-adapter-after-pcie-error.patch-27996 -scsi-qla2xxx-turn-off-multi-queue-for-8g-adapters.patch-18430 -scsi-qla2xxx-fix-crash-due-to-stale-srb-access-aroun.patch -scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-pe.patch -scsi-qla2xxx-fix-losing-target-when-it-reappears-dur.patch -scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-d.patch -scsi-qla2xxx-fix-erroneous-mailbox-timeout-after-pci.patch drm-vc4-drv-adopt-the-dma-configuration-from-the-hvs.patch usbnet-smsc95xx-don-t-clear-read-only-phy-interrupt.patch usbnet-smsc95xx-avoid-link-settings-race-on-interrup.patch usbnet-smsc95xx-forward-phy-interrupts-to-phy-driver.patch usbnet-smsc95xx-fix-deadlock-on-runtime-resume.patch firmware-arm_scpi-ensure-scpi_info-is-not-assigned-i.patch -__follow_mount_rcu-verify-that-mount_lock-remains-un.patch intel_th-pci-add-meteor-lake-p-support.patch intel_th-pci-add-raptor-lake-s-pch-support.patch intel_th-pci-add-raptor-lake-s-cpu-support.patch @@ -1017,8 +1008,6 @@ serial-8250-fold-endrun-device-support-into-oxsemi-t.patch serial-8250-add-proper-clock-handling-for-oxsemi-pci.patch tty-8250-add-support-for-brainboxes-px-cards.patch dm-writecache-set-a-default-max_writeback_jobs.patch -x86-olpc-fix-logical-not-is-only-applied-to-the-left.patch -drivers-base-fix-userspace-break-from-using-bin_attr.patch kexec_file-drop-weak-attribute-from-functions.patch kexec-clean-up-arch_kexec_kernel_verify_sig.patch kexec-keys-s390-make-use-of-built-in-and-secondary-k.patch @@ -1026,15 +1015,9 @@ tracing-events-add-__vstring-and-__assign_vstr-helpe.patch dm-thin-fix-use-after-free-crash-in-dm_sm_register_t.patch net-9p-initialize-the-iounit-field-during-fid-creati.patch timekeeping-contribute-wall-clock-to-rng-on-time-cha.patch -scsi-qla2xxx-fix-response-queue-handler-reading-stal.patch -scsi-qla2xxx-edif-fix-dropped-ike-message.patch -scsi-qla2xxx-fix-imbalance-vha-vref_count.patch-27970 -scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch-4818 -scsi-qla2xxx-update-manufacturer-details.patch locking-csd_lock-change-csdlock_debug-from-early_par.patch block-serialize-all-debugfs-operations-using-q-debug.patch block-don-t-allow-the-same-type-rq_qos-add-more-than.patch -spmi-trace-fix-stack-out-of-bound-access-in-spmi-tra.patch btrfs-tree-log-make-the-return-value-for-log-syncing.patch btrfs-ensure-pages-are-unlocked-on-cow_file_range-fa.patch btrfs-fix-error-handling-of-fallback-uncompress-writ.patch @@ -1070,7 +1053,6 @@ dm-raid-fix-address-sanitizer-warning-in-raid_resume.patch mm-damon-reclaim-fix-potential-memory-leak-in-damon_.patch hugetlb_cgroup-fix-wrong-hugetlb-cgroup-numa-stat.patch batman-adv-tracing-use-the-new-__vstring-helper.patch -ftrace-x86-add-back-ftrace_expected-assignment.patch-2936 tracing-use-a-struct-alignof-to-determine-trace-even.patch ksmbd-validate-length-in-smb2_write.patch ksmbd-smbd-change-prototypes-of-rdma-read-write-rela.patch @@ -1078,8 +1060,6 @@ ksmbd-smbd-introduce-read-write-credits-for-rdma-rea.patch ksmbd-add-smbd-max-io-size-parameter.patch ksmbd-fix-wrong-smbd-max-read-write-size-check.patch ksmbd-prevent-out-of-bound-read-for-smb2_write.patch -input-gscps2-check-return-value-of-ioremap-in-gscps2.patch -x86-kprobes-update-kcb-status-flag-after-singlestepp.patch ext4-update-s_overhead_clusters-in-the-superblock-du.patch ext4-fix-extent-status-tree-race-in-writeback-error-.patch ext4-add-ext4_inode_has_xattr_space-macro-in-xattr.h.patch diff --git a/queue-5.18/spmi-trace-fix-stack-out-of-bound-access-in-spmi-tra.patch b/queue-5.18/spmi-trace-fix-stack-out-of-bound-access-in-spmi-tra.patch deleted file mode 100644 index 5d00c0e7338..00000000000 --- a/queue-5.18/spmi-trace-fix-stack-out-of-bound-access-in-spmi-tra.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 950c726de64542319fc82b60b84e385645aff774 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 27 Jun 2022 16:55:12 -0700 -Subject: spmi: trace: fix stack-out-of-bound access in SPMI tracing functions - -From: David Collins - -[ Upstream commit 2af28b241eea816e6f7668d1954f15894b45d7e3 ] - -trace_spmi_write_begin() and trace_spmi_read_end() both call -memcpy() with a length of "len + 1". This leads to one extra -byte being read beyond the end of the specified buffer. Fix -this out-of-bound memory access by using a length of "len" -instead. - -Here is a KASAN log showing the issue: - -BUG: KASAN: stack-out-of-bounds in trace_event_raw_event_spmi_read_end+0x1d0/0x234 -Read of size 2 at addr ffffffc0265b7540 by task thermal@2.0-ser/1314 -... -Call trace: - dump_backtrace+0x0/0x3e8 - show_stack+0x2c/0x3c - dump_stack_lvl+0xdc/0x11c - print_address_description+0x74/0x384 - kasan_report+0x188/0x268 - kasan_check_range+0x270/0x2b0 - memcpy+0x90/0xe8 - trace_event_raw_event_spmi_read_end+0x1d0/0x234 - spmi_read_cmd+0x294/0x3ac - spmi_ext_register_readl+0x84/0x9c - regmap_spmi_ext_read+0x144/0x1b0 [regmap_spmi] - _regmap_raw_read+0x40c/0x754 - regmap_raw_read+0x3a0/0x514 - regmap_bulk_read+0x418/0x494 - adc5_gen3_poll_wait_hs+0xe8/0x1e0 [qcom_spmi_adc5_gen3] - ... - __arm64_sys_read+0x4c/0x60 - invoke_syscall+0x80/0x218 - el0_svc_common+0xec/0x1c8 - ... - -addr ffffffc0265b7540 is located in stack of task thermal@2.0-ser/1314 at offset 32 in frame: - adc5_gen3_poll_wait_hs+0x0/0x1e0 [qcom_spmi_adc5_gen3] - -this frame has 1 object: - [32, 33) 'status' - -Memory state around the buggy address: - ffffffc0265b7400: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 - ffffffc0265b7480: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ->ffffffc0265b7500: 00 00 00 00 f1 f1 f1 f1 01 f3 f3 f3 00 00 00 00 - ^ - ffffffc0265b7580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - ffffffc0265b7600: f1 f1 f1 f1 01 f2 07 f2 f2 f2 01 f3 00 00 00 00 -================================================================== - -Fixes: a9fce374815d ("spmi: add command tracepoints for SPMI") -Cc: stable@vger.kernel.org -Reviewed-by: Stephen Boyd -Acked-by: Steven Rostedt (Google) -Signed-off-by: David Collins -Link: https://lore.kernel.org/r/20220627235512.2272783-1-quic_collinsd@quicinc.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - include/trace/events/spmi.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/include/trace/events/spmi.h b/include/trace/events/spmi.h -index 8b60efe18ba6..a6819fd85cdf 100644 ---- a/include/trace/events/spmi.h -+++ b/include/trace/events/spmi.h -@@ -21,15 +21,15 @@ TRACE_EVENT(spmi_write_begin, - __field ( u8, sid ) - __field ( u16, addr ) - __field ( u8, len ) -- __dynamic_array ( u8, buf, len + 1 ) -+ __dynamic_array ( u8, buf, len ) - ), - - TP_fast_assign( - __entry->opcode = opcode; - __entry->sid = sid; - __entry->addr = addr; -- __entry->len = len + 1; -- memcpy(__get_dynamic_array(buf), buf, len + 1); -+ __entry->len = len; -+ memcpy(__get_dynamic_array(buf), buf, len); - ), - - TP_printk("opc=%d sid=%02d addr=0x%04x len=%d buf=0x[%*phD]", -@@ -92,7 +92,7 @@ TRACE_EVENT(spmi_read_end, - __field ( u16, addr ) - __field ( int, ret ) - __field ( u8, len ) -- __dynamic_array ( u8, buf, len + 1 ) -+ __dynamic_array ( u8, buf, len ) - ), - - TP_fast_assign( -@@ -100,8 +100,8 @@ TRACE_EVENT(spmi_read_end, - __entry->sid = sid; - __entry->addr = addr; - __entry->ret = ret; -- __entry->len = len + 1; -- memcpy(__get_dynamic_array(buf), buf, len + 1); -+ __entry->len = len; -+ memcpy(__get_dynamic_array(buf), buf, len); - ), - - TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d len=%02d buf=0x[%*phD]", --- -2.35.1 - diff --git a/queue-5.18/x86-kprobes-update-kcb-status-flag-after-singlestepp.patch b/queue-5.18/x86-kprobes-update-kcb-status-flag-after-singlestepp.patch deleted file mode 100644 index 0a98447a8f6..00000000000 --- a/queue-5.18/x86-kprobes-update-kcb-status-flag-after-singlestepp.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 2eb8d6ab6b01411d529d883d9a23396b251b4c91 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 2 Aug 2022 15:04:16 +0900 -Subject: x86/kprobes: Update kcb status flag after singlestepping -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Masami Hiramatsu (Google) - -[ Upstream commit dec8784c9088b131a1523f582c2194cfc8107dc0 ] - -Fix kprobes to update kcb (kprobes control block) status flag to -KPROBE_HIT_SSDONE even if the kp->post_handler is not set. - -This bug may cause a kernel panic if another INT3 user runs right -after kprobes because kprobe_int3_handler() misunderstands the -INT3 is kprobe's single stepping INT3. - -Fixes: 6256e668b7af ("x86/kprobes: Use int3 instead of debug trap for single-step") -Reported-by: Daniel Müller -Signed-off-by: Masami Hiramatsu (Google) -Signed-off-by: Ingo Molnar -Tested-by: Daniel Müller -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/all/20220727210136.jjgc3lpqeq42yr3m@muellerd-fedora-PC2BDTX9 -Link: https://lore.kernel.org/r/165942025658.342061.12452378391879093249.stgit@devnote2 -Signed-off-by: Sasha Levin ---- - arch/x86/kernel/kprobes/core.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c -index 7c4ab8870da4..74167dc5f55e 100644 ---- a/arch/x86/kernel/kprobes/core.c -+++ b/arch/x86/kernel/kprobes/core.c -@@ -814,16 +814,20 @@ set_current_kprobe(struct kprobe *p, struct pt_regs *regs, - static void kprobe_post_process(struct kprobe *cur, struct pt_regs *regs, - struct kprobe_ctlblk *kcb) - { -- if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) { -- kcb->kprobe_status = KPROBE_HIT_SSDONE; -- cur->post_handler(cur, regs, 0); -- } -- - /* Restore back the original saved kprobes variables and continue. */ -- if (kcb->kprobe_status == KPROBE_REENTER) -+ if (kcb->kprobe_status == KPROBE_REENTER) { -+ /* This will restore both kcb and current_kprobe */ - restore_previous_kprobe(kcb); -- else -+ } else { -+ /* -+ * Always update the kcb status because -+ * reset_curent_kprobe() doesn't update kcb. -+ */ -+ kcb->kprobe_status = KPROBE_HIT_SSDONE; -+ if (cur->post_handler) -+ cur->post_handler(cur, regs, 0); - reset_current_kprobe(); -+ } - } - NOKPROBE_SYMBOL(kprobe_post_process); - --- -2.35.1 - diff --git a/queue-5.18/x86-olpc-fix-logical-not-is-only-applied-to-the-left.patch b/queue-5.18/x86-olpc-fix-logical-not-is-only-applied-to-the-left.patch deleted file mode 100644 index 1b881069133..00000000000 --- a/queue-5.18/x86-olpc-fix-logical-not-is-only-applied-to-the-left.patch +++ /dev/null @@ -1,54 +0,0 @@ -From b63e4693e67826d5eb07e8254daed08277df7133 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 15 Jul 2022 17:15:36 +0200 -Subject: x86/olpc: fix 'logical not is only applied to the left hand side' - -From: Alexander Lobakin - -[ Upstream commit 3a2ba42cbd0b669ce3837ba400905f93dd06c79f ] - -The bitops compile-time optimization series revealed one more -problem in olpc-xo1-sci.c:send_ebook_state(), resulted in GCC -warnings: - -arch/x86/platform/olpc/olpc-xo1-sci.c: In function 'send_ebook_state': -arch/x86/platform/olpc/olpc-xo1-sci.c:83:63: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] - 83 | if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state) - | ^~ -arch/x86/platform/olpc/olpc-xo1-sci.c:83:13: note: add parentheses around left hand side expression to silence this warning - -Despite this code working as intended, this redundant double -negation of boolean value, together with comparing to `char` -with no explicit conversion to bool, makes compilers think -the author made some unintentional logical mistakes here. -Make it the other way around and negate the char instead -to silence the warnings. - -Fixes: d2aa37411b8e ("x86/olpc/xo1/sci: Produce wakeup events for buttons and switches") -Cc: stable@vger.kernel.org # 3.5+ -Reported-by: Guenter Roeck -Reported-by: kernel test robot -Reviewed-and-tested-by: Guenter Roeck -Signed-off-by: Alexander Lobakin -Signed-off-by: Yury Norov -Signed-off-by: Sasha Levin ---- - arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c -index f03a6883dcc6..89f25af4b3c3 100644 ---- a/arch/x86/platform/olpc/olpc-xo1-sci.c -+++ b/arch/x86/platform/olpc/olpc-xo1-sci.c -@@ -80,7 +80,7 @@ static void send_ebook_state(void) - return; - } - -- if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state) -+ if (test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == !!state) - return; /* Nothing new to report. */ - - input_report_switch(ebook_switch_idev, SW_TABLET_MODE, state); --- -2.35.1 - -- 2.47.3