]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Aug 2022 07:12:53 +0000 (09:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Aug 2022 07:12:53 +0000 (09:12 +0200)
added patches:
can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch
scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch

queue-5.15/can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch [new file with mode: 0644]
queue-5.15/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch b/queue-5.15/can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch
new file mode 100644 (file)
index 0000000..9930643
--- /dev/null
@@ -0,0 +1,43 @@
+From 8ef49f7f8244424adcf4a546dba4cbbeb0b09c09 Mon Sep 17 00:00:00 2001
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+Date: Fri, 29 Jul 2022 17:36:55 +0300
+Subject: can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once()
+
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+
+commit 8ef49f7f8244424adcf4a546dba4cbbeb0b09c09 upstream.
+
+We should warn user-space that it is doing something wrong when trying
+to activate sessions with identical parameters but WARN_ON_ONCE macro
+can not be used here as it serves a different purpose.
+
+So it would be good to replace it with netdev_warn_once() message.
+
+Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
+
+Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
+Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
+Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
+Link: https://lore.kernel.org/all/20220729143655.1108297-1-pchelkin@ispras.ru
+[mkl: fix indention]
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/can/j1939/socket.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/net/can/j1939/socket.c
++++ b/net/can/j1939/socket.c
+@@ -178,7 +178,10 @@ activate_next:
+       if (!first)
+               return;
+-      if (WARN_ON_ONCE(j1939_session_activate(first))) {
++      if (j1939_session_activate(first)) {
++              netdev_warn_once(first->priv->ndev,
++                               "%s: 0x%p: Identical session is already activated.\n",
++                               __func__, first);
+               first->err = -EBUSY;
+               goto activate_next;
+       } else {
diff --git a/queue-5.15/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch b/queue-5.15/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch
new file mode 100644 (file)
index 0000000..d6ab978
--- /dev/null
@@ -0,0 +1,67 @@
+From f54912b228a8df6c0133e31bc75628677bb8c6e5 Mon Sep 17 00:00:00 2001
+From: Ren Zhijie <renzhijie2@huawei.com>
+Date: Sun, 19 Jun 2022 19:54:32 +0800
+Subject: scsi: ufs: ufs-mediatek: Fix build error and type mismatch
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ren Zhijie <renzhijie2@huawei.com>
+
+commit f54912b228a8df6c0133e31bc75628677bb8c6e5 upstream.
+
+If CONFIG_PM_SLEEP is not set.
+
+make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will fail:
+
+drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_vreg_fix_vcc’:
+drivers/ufs/host/ufs-mediatek.c:688:46: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
+    snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
+                                             ~^   ~~~~~~
+                                             %lu
+drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_suspend’:
+drivers/ufs/host/ufs-mediatek.c:1371:8: error: implicit declaration of function ‘ufshcd_system_suspend’; did you mean ‘ufs_mtk_system_suspend’? [-Werror=implicit-function-declaration]
+  ret = ufshcd_system_suspend(dev);
+        ^~~~~~~~~~~~~~~~~~~~~
+        ufs_mtk_system_suspend
+drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_resume’:
+drivers/ufs/host/ufs-mediatek.c:1386:9: error: implicit declaration of function ‘ufshcd_system_resume’; did you mean ‘ufs_mtk_system_resume’? [-Werror=implicit-function-declaration]
+  return ufshcd_system_resume(dev);
+         ^~~~~~~~~~~~~~~~~~~~
+         ufs_mtk_system_resume
+cc1: some warnings being treated as errors
+
+The declaration of func "ufshcd_system_suspend()" depends on
+CONFIG_PM_SLEEP, so the function wrapper ufs_mtk_system_suspend() should
+wrapped by CONFIG_PM_SLEEP too.
+
+Link: https://lore.kernel.org/r/20220619115432.205504-1-renzhijie2@huawei.com
+Fixes: 3fd23b8dfb54 ("scsi: ufs: ufs-mediatek: Fix the timing of configuring device regulators")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
+Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+[only take the suspend/resume portion of the commit - gregkh]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/ufs/ufs-mediatek.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/scsi/ufs/ufs-mediatek.c
++++ b/drivers/scsi/ufs/ufs-mediatek.c
+@@ -1139,6 +1139,7 @@ static int ufs_mtk_remove(struct platfor
+       return 0;
+ }
++#ifdef CONFIG_PM_SLEEP
+ int ufs_mtk_system_suspend(struct device *dev)
+ {
+       struct ufs_hba *hba = dev_get_drvdata(dev);
+@@ -1161,6 +1162,7 @@ int ufs_mtk_system_resume(struct device
+       return ufshcd_system_resume(dev);
+ }
++#endif
+ int ufs_mtk_runtime_suspend(struct device *dev)
+ {
index 27e0cc49bb0b10b865e0ca7ffc492f989a9881c4..45b379b27ac7a4ef5f4dd5586c6bdd0e729d0c27 100644 (file)
@@ -231,3 +231,5 @@ powerpc-64-init-jump-labels-before-parse_early_param.patch
 venus-pm_helpers-fix-warning-in-opp-during-probe.patch
 video-fbdev-i740fb-check-the-argument-of-i740_calc_v.patch
 mips-tlbex-explicitly-compare-_page_no_exec-against-.patch
+can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch
+scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch