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

queue-5.19/can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch [new file with mode: 0644]
queue-5.19/f2fs-fix-null-ptr-deref-in-f2fs_get_dnode_of_data.patch
queue-5.19/revert-alsa-hda-fix-page-fault-in-snd_hda_codec_shutdown.patch [new file with mode: 0644]
queue-5.19/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch [new file with mode: 0644]
queue-5.19/series

diff --git a/queue-5.19/can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch b/queue-5.19/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 {
index 27734eaf470e4f55ae24278a6c340eabcb8c83f9..75cc50c5af7189aeed049764c3dcf7734ad8766a 100644 (file)
@@ -55,13 +55,11 @@ Reviewed-by: Chao Yu <chao@kernel.org>
 Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- fs/f2fs/f2fs.h    | 6 ++++++
- fs/f2fs/file.c    | 2 +-
- fs/f2fs/segment.c | 4 ++--
+ fs/f2fs/f2fs.h    |    6 ++++++
+ fs/f2fs/file.c    |    2 +-
+ fs/f2fs/segment.c |    4 ++--
  3 files changed, 9 insertions(+), 3 deletions(-)
 
-diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
-index 5c950298837f..7006fa7dd5cb 100644
 --- a/fs/f2fs/f2fs.h
 +++ b/fs/f2fs/f2fs.h
 @@ -757,6 +757,7 @@ enum {
@@ -72,7 +70,7 @@ index 5c950298837f..7006fa7dd5cb 100644
        FI_MAX,                 /* max flag, never be used */
  };
  
-@@ -3208,6 +3209,11 @@ static inline bool f2fs_is_atomic_file(struct inode *inode)
+@@ -3208,6 +3209,11 @@ static inline bool f2fs_is_atomic_file(s
        return is_inode_flag_set(inode, FI_ATOMIC_FILE);
  }
  
@@ -84,11 +82,9 @@ index 5c950298837f..7006fa7dd5cb 100644
  static inline bool f2fs_is_first_block_written(struct inode *inode)
  {
        return is_inode_flag_set(inode, FI_FIRST_BLOCK_WRITTEN);
-diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
-index 41547604f192..ecd833ba35fc 100644
 --- a/fs/f2fs/file.c
 +++ b/fs/f2fs/file.c
-@@ -2061,7 +2061,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
+@@ -2061,7 +2061,7 @@ static int f2fs_ioc_start_atomic_write(s
        spin_unlock(&sbi->inode_lock[ATOMIC_FILE]);
  
        set_inode_flag(inode, FI_ATOMIC_FILE);
@@ -97,11 +93,9 @@ index 41547604f192..ecd833ba35fc 100644
        clear_inode_flag(fi->cow_inode, FI_INLINE_DATA);
        f2fs_up_write(&fi->i_gc_rwsem[WRITE]);
  
-diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
-index ac890c9fa8a1..52df19a0638b 100644
 --- a/fs/f2fs/segment.c
 +++ b/fs/f2fs/segment.c
-@@ -193,7 +193,7 @@ void f2fs_abort_atomic_write(struct inode *inode, bool clean)
+@@ -193,7 +193,7 @@ void f2fs_abort_atomic_write(struct inod
        if (f2fs_is_atomic_file(inode)) {
                if (clean)
                        truncate_inode_pages_final(inode->i_mapping);
@@ -110,7 +104,7 @@ index ac890c9fa8a1..52df19a0638b 100644
                iput(fi->cow_inode);
                fi->cow_inode = NULL;
                clear_inode_flag(inode, FI_ATOMIC_FILE);
-@@ -3166,7 +3166,7 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
+@@ -3166,7 +3166,7 @@ static int __get_segment_type_6(struct f
                        return CURSEG_COLD_DATA;
                if (file_is_hot(inode) ||
                                is_inode_flag_set(inode, FI_HOT_DATA) ||
@@ -119,6 +113,3 @@ index ac890c9fa8a1..52df19a0638b 100644
                        return CURSEG_HOT_DATA;
                return f2fs_rw_hint_to_seg_type(inode->i_write_hint);
        } else {
--- 
-2.35.1
-
diff --git a/queue-5.19/revert-alsa-hda-fix-page-fault-in-snd_hda_codec_shutdown.patch b/queue-5.19/revert-alsa-hda-fix-page-fault-in-snd_hda_codec_shutdown.patch
new file mode 100644 (file)
index 0000000..646b977
--- /dev/null
@@ -0,0 +1,88 @@
+From 53f07e9b010b966017e32be1ca1bbcbcc4cee73d Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 15 Jul 2022 20:29:03 +0200
+Subject: Revert "ALSA: hda: Fix page fault in snd_hda_codec_shutdown()"
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 53f07e9b010b966017e32be1ca1bbcbcc4cee73d upstream.
+
+This reverts commit 980b3a8790b402e959a6d773b38b771019682be1.
+
+The commit didn't consider the fact that ASoC hdac-hda driver
+initializes the HD-audio stuff without calling
+snd_hda_codec_device_init().  Hence this caused a regression leading
+to Oops.
+
+Revert the commit to restore the behavior.
+
+Fixes: 980b3a8790b4 ("ALSA: hda: Fix page fault in snd_hda_codec_shutdown()")
+Link: https://lore.kernel.org/r/3c40df55-3aee-1e08-493b-7b30cd84dc00@linux.intel.com
+Link: https://lore.kernel.org/r/20220715182903.19594-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/hda_codec.c |   41 +++++++++++++++++++++--------------------
+ 1 file changed, 21 insertions(+), 20 deletions(-)
+
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -931,28 +931,8 @@ snd_hda_codec_device_init(struct hda_bus
+       }
+       codec->bus = bus;
+-      codec->depop_delay = -1;
+-      codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
+-      codec->core.dev.release = snd_hda_codec_dev_release;
+-      codec->core.exec_verb = codec_exec_verb;
+       codec->core.type = HDA_DEV_LEGACY;
+-      mutex_init(&codec->spdif_mutex);
+-      mutex_init(&codec->control_mutex);
+-      snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32);
+-      snd_array_init(&codec->nids, sizeof(struct hda_nid_item), 32);
+-      snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16);
+-      snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16);
+-      snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8);
+-      snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
+-      snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16);
+-      snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8);
+-      INIT_LIST_HEAD(&codec->conn_list);
+-      INIT_LIST_HEAD(&codec->pcm_list_head);
+-      INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
+-      refcount_set(&codec->pcm_ref, 1);
+-      init_waitqueue_head(&codec->remove_sleep);
+-
+       return codec;
+ }
+ EXPORT_SYMBOL_GPL(snd_hda_codec_device_init);
+@@ -1000,8 +980,29 @@ int snd_hda_codec_device_new(struct hda_
+       if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
+               return -EINVAL;
++      codec->core.dev.release = snd_hda_codec_dev_release;
++      codec->core.exec_verb = codec_exec_verb;
++
+       codec->card = card;
+       codec->addr = codec_addr;
++      mutex_init(&codec->spdif_mutex);
++      mutex_init(&codec->control_mutex);
++      snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32);
++      snd_array_init(&codec->nids, sizeof(struct hda_nid_item), 32);
++      snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16);
++      snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16);
++      snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8);
++      snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
++      snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16);
++      snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8);
++      INIT_LIST_HEAD(&codec->conn_list);
++      INIT_LIST_HEAD(&codec->pcm_list_head);
++      refcount_set(&codec->pcm_ref, 1);
++      init_waitqueue_head(&codec->remove_sleep);
++
++      INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
++      codec->depop_delay = -1;
++      codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
+ #ifdef CONFIG_PM
+       codec->power_jiffies = jiffies;
diff --git a/queue-5.19/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch b/queue-5.19/scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch
new file mode 100644 (file)
index 0000000..4792199
--- /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/ufs/host/ufs-mediatek.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/ufs/host/ufs-mediatek.c
++++ b/drivers/ufs/host/ufs-mediatek.c
+@@ -1220,6 +1220,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);
+@@ -1242,6 +1243,7 @@ int ufs_mtk_system_resume(struct device
+       return ufshcd_system_resume(dev);
+ }
++#endif
+ int ufs_mtk_runtime_suspend(struct device *dev)
+ {
index 7556691ecf8ace0b9cf05747e790b123dc4178d3..c5472ce5d8a7bbfe6ada1341067bb02b19a098f1 100644 (file)
@@ -238,6 +238,7 @@ stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.pa
 igb-add-lock-to-avoid-data-race.patch
 kbuild-fix-the-modules-order-between-drivers-and-libs.patch
 gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch
+can-j1939-j1939_sk_queue_activate_next_locked-replace-warn_on_once-with-netdev_warn_once.patch
 drm-imx-dcss-get-rid-of-hpd-warning-message.patch
 drm-meson-fix-refcount-bugs-in-meson_vpu_has_availab.patch
 drm-i915-ttm-don-t-leak-the-ccs-state.patch
@@ -361,3 +362,5 @@ video-fbdev-i740fb-check-the-argument-of-i740_calc_v.patch
 mips-tlbex-explicitly-compare-_page_no_exec-against-.patch
 f2fs-revive-f2fs_ioc_abort_volatile_write.patch
 f2fs-fix-null-ptr-deref-in-f2fs_get_dnode_of_data.patch
+scsi-ufs-ufs-mediatek-fix-build-error-and-type-mismatch.patch
+revert-alsa-hda-fix-page-fault-in-snd_hda_codec_shutdown.patch