From: Greg Kroah-Hartman Date: Mon, 14 Feb 2022 07:13:34 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.9.302~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44043c80e9cda18f443683c18b467c6364448eb0;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: can-isotp-fix-error-path-in-isotp_sendmsg-to-unlock-wait-queue.patch makefile.extrawarn-move-wunaligned-access-to-w-1.patch scsi-lpfc-reduce-log-messages-seen-after-firmware-download.patch scsi-lpfc-remove-nvme-support-if-kernel-has-nvme_fc-disabled.patch --- diff --git a/queue-5.10/can-isotp-fix-error-path-in-isotp_sendmsg-to-unlock-wait-queue.patch b/queue-5.10/can-isotp-fix-error-path-in-isotp_sendmsg-to-unlock-wait-queue.patch new file mode 100644 index 00000000000..9b25cc2bdae --- /dev/null +++ b/queue-5.10/can-isotp-fix-error-path-in-isotp_sendmsg-to-unlock-wait-queue.patch @@ -0,0 +1,77 @@ +From 8375dfac4f683e1b2c5956d919d36aeedad46699 Mon Sep 17 00:00:00 2001 +From: Oliver Hartkopp +Date: Wed, 9 Feb 2022 08:36:01 +0100 +Subject: can: isotp: fix error path in isotp_sendmsg() to unlock wait queue + +From: Oliver Hartkopp + +commit 8375dfac4f683e1b2c5956d919d36aeedad46699 upstream. + +Commit 43a08c3bdac4 ("can: isotp: isotp_sendmsg(): fix TX buffer concurrent +access in isotp_sendmsg()") introduced a new locking scheme that may render +the userspace application in a locking state when an error is detected. +This issue shows up under high load on simultaneously running isotp channels +with identical configuration which is against the ISO specification and +therefore breaks any reasonable PDU communication anyway. + +Fixes: 43a08c3bdac4 ("can: isotp: isotp_sendmsg(): fix TX buffer concurrent access in isotp_sendmsg()") +Link: https://lore.kernel.org/all/20220209073601.25728-1-socketcan@hartkopp.net +Cc: stable@vger.kernel.org +Cc: Ziyang Xuan +Signed-off-by: Oliver Hartkopp +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman +--- + net/can/isotp.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/net/can/isotp.c ++++ b/net/can/isotp.c +@@ -885,24 +885,24 @@ static int isotp_sendmsg(struct socket * + + if (!size || size > MAX_MSG_LENGTH) { + err = -EINVAL; +- goto err_out; ++ goto err_out_drop; + } + + err = memcpy_from_msg(so->tx.buf, msg, size); + if (err < 0) +- goto err_out; ++ goto err_out_drop; + + dev = dev_get_by_index(sock_net(sk), so->ifindex); + if (!dev) { + err = -ENXIO; +- goto err_out; ++ goto err_out_drop; + } + + skb = sock_alloc_send_skb(sk, so->ll.mtu + sizeof(struct can_skb_priv), + msg->msg_flags & MSG_DONTWAIT, &err); + if (!skb) { + dev_put(dev); +- goto err_out; ++ goto err_out_drop; + } + + can_skb_reserve(skb); +@@ -967,7 +967,7 @@ static int isotp_sendmsg(struct socket * + if (err) { + pr_notice_once("can-isotp: %s: can_send_ret %d\n", + __func__, err); +- goto err_out; ++ goto err_out_drop; + } + + if (wait_tx_done) { +@@ -980,6 +980,9 @@ static int isotp_sendmsg(struct socket * + + return size; + ++err_out_drop: ++ /* drop this PDU and unlock a potential wait queue */ ++ old_state = ISOTP_IDLE; + err_out: + so->tx.state = old_state; + if (so->tx.state == ISOTP_IDLE) diff --git a/queue-5.10/makefile.extrawarn-move-wunaligned-access-to-w-1.patch b/queue-5.10/makefile.extrawarn-move-wunaligned-access-to-w-1.patch new file mode 100644 index 00000000000..e4702b0f317 --- /dev/null +++ b/queue-5.10/makefile.extrawarn-move-wunaligned-access-to-w-1.patch @@ -0,0 +1,43 @@ +From 1cf5f151d25fcca94689efd91afa0253621fb33a Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 2 Feb 2022 16:05:16 -0700 +Subject: Makefile.extrawarn: Move -Wunaligned-access to W=1 + +From: Nathan Chancellor + +commit 1cf5f151d25fcca94689efd91afa0253621fb33a upstream. + +-Wunaligned-access is a new warning in clang that is default enabled for +arm and arm64 under certain circumstances within the clang frontend (see +LLVM commit below). On v5.17-rc2, an ARCH=arm allmodconfig build shows +1284 total/70 unique instances of this warning (most of the instances +are in header files), which is quite noisy. + +To keep a normal build green through CONFIG_WERROR, only show this +warning with W=1, which will allow automated build systems to catch new +instances of the warning so that the total number can be driven down to +zero eventually since catching unaligned accesses at compile time would +be generally useful. + +Cc: stable@vger.kernel.org +Link: https://github.com/llvm/llvm-project/commit/35737df4dcd28534bd3090157c224c19b501278a +Link: https://github.com/ClangBuiltLinux/linux/issues/1569 +Link: https://github.com/ClangBuiltLinux/linux/issues/1576 +Signed-off-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Signed-off-by: Masahiro Yamada +Signed-off-by: Greg Kroah-Hartman +--- + scripts/Makefile.extrawarn | 1 + + 1 file changed, 1 insertion(+) + +--- a/scripts/Makefile.extrawarn ++++ b/scripts/Makefile.extrawarn +@@ -51,6 +51,7 @@ KBUILD_CFLAGS += -Wno-sign-compare + KBUILD_CFLAGS += -Wno-format-zero-length + KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) + KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare ++KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) + endif + + endif diff --git a/queue-5.10/scsi-lpfc-reduce-log-messages-seen-after-firmware-download.patch b/queue-5.10/scsi-lpfc-reduce-log-messages-seen-after-firmware-download.patch new file mode 100644 index 00000000000..077defbdd6e --- /dev/null +++ b/queue-5.10/scsi-lpfc-reduce-log-messages-seen-after-firmware-download.patch @@ -0,0 +1,62 @@ +From 5852ed2a6a39c862c8a3fdf646e1f4e01b91d710 Mon Sep 17 00:00:00 2001 +From: James Smart +Date: Mon, 7 Feb 2022 10:04:42 -0800 +Subject: scsi: lpfc: Reduce log messages seen after firmware download + +From: James Smart + +commit 5852ed2a6a39c862c8a3fdf646e1f4e01b91d710 upstream. + +Messages around firmware download were incorrectly tagged as being related +to discovery trace events. Thus, firmware download status ended up dumping +the trace log as well as the firmware update message. As there were a +couple of log messages in this state, the trace log was dumped multiple +times. + +Resolve this by converting from trace events to SLI events. + +Link: https://lore.kernel.org/r/20220207180442.72836-1-jsmart2021@gmail.com +Reviewed-by: Ewan D. Milne +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_init.c | 2 +- + drivers/scsi/lpfc/lpfc_sli.c | 8 +++++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -1998,7 +1998,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *ph + } + if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && + reg_err2 == SLIPORT_ERR2_REG_FW_RESTART) { +- lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "3143 Port Down: Firmware Update " + "Detected\n"); + en_rn_msg = false; +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -12402,6 +12402,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *ph + uint32_t uerr_sta_hi, uerr_sta_lo; + uint32_t if_type, portsmphr; + struct lpfc_register portstat_reg; ++ u32 logmask; + + /* + * For now, use the SLI4 device internal unrecoverable error +@@ -12452,7 +12453,12 @@ lpfc_sli4_eratt_read(struct lpfc_hba *ph + readl(phba->sli4_hba.u.if_type2.ERR1regaddr); + phba->work_status[1] = + readl(phba->sli4_hba.u.if_type2.ERR2regaddr); +- lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ++ logmask = LOG_TRACE_EVENT; ++ if (phba->work_status[0] == ++ SLIPORT_ERR1_REG_ERR_CODE_2 && ++ phba->work_status[1] == SLIPORT_ERR2_REG_FW_RESTART) ++ logmask = LOG_SLI; ++ lpfc_printf_log(phba, KERN_ERR, logmask, + "2885 Port Status Event: " + "port status reg 0x%x, " + "port smphr reg 0x%x, " diff --git a/queue-5.10/scsi-lpfc-remove-nvme-support-if-kernel-has-nvme_fc-disabled.patch b/queue-5.10/scsi-lpfc-remove-nvme-support-if-kernel-has-nvme_fc-disabled.patch new file mode 100644 index 00000000000..471ff45ceb2 --- /dev/null +++ b/queue-5.10/scsi-lpfc-remove-nvme-support-if-kernel-has-nvme_fc-disabled.patch @@ -0,0 +1,68 @@ +From c80b27cfd93ba9f5161383f798414609e84729f3 Mon Sep 17 00:00:00 2001 +From: James Smart +Date: Mon, 7 Feb 2022 10:05:16 -0800 +Subject: scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled + +From: James Smart + +commit c80b27cfd93ba9f5161383f798414609e84729f3 upstream. + +The driver is initiating NVMe PRLIs to determine device NVMe support. This +should not be occurring if CONFIG_NVME_FC support is disabled. + +Correct this by changing the default value for FC4 support. Currently it +defaults to FCP and NVMe. With change, when NVME_FC support is not enabled +in the kernel, the default value is just FCP. + +Link: https://lore.kernel.org/r/20220207180516.73052-1-jsmart2021@gmail.com +Reviewed-by: Ewan D. Milne +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc.h | 13 ++++++++++--- + drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- + 2 files changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc.h ++++ b/drivers/scsi/lpfc/lpfc.h +@@ -898,6 +898,16 @@ struct lpfc_hba { + uint32_t cfg_hostmem_hgp; + uint32_t cfg_log_verbose; + uint32_t cfg_enable_fc4_type; ++#define LPFC_ENABLE_FCP 1 ++#define LPFC_ENABLE_NVME 2 ++#define LPFC_ENABLE_BOTH 3 ++#if (IS_ENABLED(CONFIG_NVME_FC)) ++#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_BOTH ++#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_BOTH ++#else ++#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP ++#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP ++#endif + uint32_t cfg_aer_support; + uint32_t cfg_sriov_nr_virtfn; + uint32_t cfg_request_firmware_upgrade; +@@ -918,9 +928,6 @@ struct lpfc_hba { + uint32_t cfg_ras_fwlog_func; + uint32_t cfg_enable_bbcr; /* Enable BB Credit Recovery */ + uint32_t cfg_enable_dpp; /* Enable Direct Packet Push */ +-#define LPFC_ENABLE_FCP 1 +-#define LPFC_ENABLE_NVME 2 +-#define LPFC_ENABLE_BOTH 3 + uint32_t cfg_enable_pbde; + struct nvmet_fc_target_port *targetport; + lpfc_vpd_t vpd; /* vital product data */ +--- a/drivers/scsi/lpfc/lpfc_attr.c ++++ b/drivers/scsi/lpfc/lpfc_attr.c +@@ -3797,8 +3797,8 @@ LPFC_ATTR_R(nvmet_mrq_post, + * 3 - register both FCP and NVME + * Supported values are [1,3]. Default value is 3 + */ +-LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_BOTH, +- LPFC_ENABLE_FCP, LPFC_ENABLE_BOTH, ++LPFC_ATTR_R(enable_fc4_type, LPFC_DEF_ENBL_FC4_TYPE, ++ LPFC_ENABLE_FCP, LPFC_MAX_ENBL_FC4_TYPE, + "Enable FC4 Protocol support - FCP / NVME"); + + /* diff --git a/queue-5.10/series b/queue-5.10/series index 871f1e416e8..d66c326769a 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -107,3 +107,7 @@ usb-serial-cp210x-add-cpi-bulk-coin-recycler-id.patch speakup-dectlk-restore-pitch-setting.patch phy-ti-fix-missing-sentinel-for-clk_div_table.patch hwmon-dell-smm-speed-up-setting-of-fan-speed.patch +makefile.extrawarn-move-wunaligned-access-to-w-1.patch +can-isotp-fix-error-path-in-isotp_sendmsg-to-unlock-wait-queue.patch +scsi-lpfc-remove-nvme-support-if-kernel-has-nvme_fc-disabled.patch +scsi-lpfc-reduce-log-messages-seen-after-firmware-download.patch