]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Mon, 8 Jul 2024 14:41:24 +0000 (10:41 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 8 Jul 2024 14:41:24 +0000 (10:41 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
22 files changed:
queue-6.6/alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch [new file with mode: 0644]
queue-6.6/alsa-ump-set-default-protocol-when-not-given-explici.patch [new file with mode: 0644]
queue-6.6/clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch [new file with mode: 0644]
queue-6.6/clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch [new file with mode: 0644]
queue-6.6/clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch [new file with mode: 0644]
queue-6.6/connector-fix-invalid-conversion-in-cn_proc.h.patch [new file with mode: 0644]
queue-6.6/dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch [new file with mode: 0644]
queue-6.6/drm-amdgpu-silence-ubsan-warning.patch [new file with mode: 0644]
queue-6.6/fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch [new file with mode: 0644]
queue-6.6/i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch [new file with mode: 0644]
queue-6.6/kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch [new file with mode: 0644]
queue-6.6/nfc-nci-add-the-inconsistency-check-between-the-inpu.patch [new file with mode: 0644]
queue-6.6/null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch [new file with mode: 0644]
queue-6.6/nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch [new file with mode: 0644]
queue-6.6/nvme-multipath-find-numa-path-only-for-online-numa-n.patch [new file with mode: 0644]
queue-6.6/nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch [new file with mode: 0644]
queue-6.6/platform-x86-touchscreen_dmi-add-info-for-globalspac.patch [new file with mode: 0644]
queue-6.6/platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch [new file with mode: 0644]
queue-6.6/regmap-i2c-subtract-reg-size-from-max_write.patch [new file with mode: 0644]
queue-6.6/series
queue-6.6/spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch [new file with mode: 0644]
queue-6.6/vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch [new file with mode: 0644]

diff --git a/queue-6.6/alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch b/queue-6.6/alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch
new file mode 100644 (file)
index 0000000..6b8a473
--- /dev/null
@@ -0,0 +1,71 @@
+From 1fa28576d55beafbbb9afbf065d8083dd26fd9f9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 May 2024 13:50:09 +0800
+Subject: ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897
+
+From: Jian-Hong Pan <jhp@endlessos.org>
+
+[ Upstream commit 45e37f9ce28d248470bab4376df2687a215d1b22 ]
+
+JP-IK LEAP W502 laptop's headset mic is not enabled until
+ALC897_FIXUP_HEADSET_MIC_PIN3 quirk is applied.
+
+Here is the original pin node values:
+
+0x11 0x40000000
+0x12 0xb7a60130
+0x14 0x90170110
+0x15 0x411111f0
+0x16 0x411111f0
+0x17 0x411111f0
+0x18 0x411111f0
+0x19 0x411111f0
+0x1a 0x411111f0
+0x1b 0x03211020
+0x1c 0x411111f0
+0x1d 0x4026892d
+0x1e 0x411111f0
+0x1f 0x411111f0
+
+Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
+Link: https://lore.kernel.org/r/20240520055008.7083-2-jhp@endlessos.org
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/patch_realtek.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index c9f07e6fde963..fed3f59d7bd69 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -11773,6 +11773,7 @@ enum {
+       ALC897_FIXUP_LENOVO_HEADSET_MODE,
+       ALC897_FIXUP_HEADSET_MIC_PIN2,
+       ALC897_FIXUP_UNIS_H3C_X500S,
++      ALC897_FIXUP_HEADSET_MIC_PIN3,
+ };
+ static const struct hda_fixup alc662_fixups[] = {
+@@ -12219,10 +12220,18 @@ static const struct hda_fixup alc662_fixups[] = {
+                       {}
+               },
+       },
++      [ALC897_FIXUP_HEADSET_MIC_PIN3] = {
++              .type = HDA_FIXUP_PINS,
++              .v.pins = (const struct hda_pintbl[]) {
++                      { 0x19, 0x03a11050 }, /* use as headset mic */
++                      { }
++              },
++      },
+ };
+ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
+       SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
++      SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
+       SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
+       SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
+       SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
+-- 
+2.43.0
+
diff --git a/queue-6.6/alsa-ump-set-default-protocol-when-not-given-explici.patch b/queue-6.6/alsa-ump-set-default-protocol-when-not-given-explici.patch
new file mode 100644 (file)
index 0000000..bbc3431
--- /dev/null
@@ -0,0 +1,47 @@
+From 1f13b8b39b3b6aab4d04d15717639019100af062 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 29 May 2024 18:47:17 +0200
+Subject: ALSA: ump: Set default protocol when not given explicitly
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit bc42ca002d5d211f9c57334b9b4c25ddb0b4ec35 ]
+
+When an inquiry of the current protocol via UMP Stream Configuration
+message fails by some reason, we may leave the current protocol
+undefined, which may lead to unexpected behavior.  Better to assume a
+valid protocol found in the protocol capability bits instead.
+
+For a device that doesn't support the UMP v1.2 feature, it won't reach
+to this code path, and USB MIDI GTB descriptor would be used for
+determining the protocol, instead.
+
+Link: https://lore.kernel.org/r/20240529164723.18309-2-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/core/ump.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/sound/core/ump.c b/sound/core/ump.c
+index 3cd07c103d9ea..d68d3bda97e42 100644
+--- a/sound/core/ump.c
++++ b/sound/core/ump.c
+@@ -967,6 +967,14 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
+       if (err < 0)
+               ump_dbg(ump, "Unable to get UMP EP stream config\n");
++      /* If no protocol is set by some reason, assume the valid one */
++      if (!(ump->info.protocol & SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK)) {
++              if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI2)
++                      ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI2;
++              else if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI1)
++                      ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI1;
++      }
++
+       /* Query and create blocks from Function Blocks */
+       for (blk = 0; blk < ump->info.num_blocks; blk++) {
+               err = create_block_from_fb_info(ump, blk);
+-- 
+2.43.0
+
diff --git a/queue-6.6/clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch b/queue-6.6/clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch
new file mode 100644 (file)
index 0000000..e464971
--- /dev/null
@@ -0,0 +1,113 @@
+From 7cc48a03554e9fe9878da1cd4faa4db79a34d66f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 13 Jun 2024 20:02:28 +0800
+Subject: clk: mediatek: mt8183: Only enable runtime PM on mt8183-mfgcfg
+
+From: Pin-yen Lin <treapking@chromium.org>
+
+[ Upstream commit 878e845d8db04df9ff3bbbaac09d335b24153704 ]
+
+Commit 2f7b1d8b5505 ("clk: mediatek: Do a runtime PM get on controllers
+during probe") enabled runtime PM for all mediatek clock controllers,
+but this introduced an issue on the resume path.
+
+If a device resumes earlier than the clock controller and calls
+clk_prepare() when runtime PM is enabled on the controller, it will end
+up calling clk_pm_runtime_get(). But the subsequent
+pm_runtime_resume_and_get() call will fail because the runtime PM is
+temporarily disabled during suspend.
+
+To workaround this, introduce a need_runtime_pm flag and only enable it
+on mt8183-mfgcfg, which is the driver that observed deadlock previously.
+Hopefully mt8183-cfgcfg won't run into the issue at the resume stage
+because the GPU should have stopped rendering before the system calls
+suspend.
+
+Fixes: 2f7b1d8b5505 ("clk: mediatek: Do a runtime PM get on controllers during probe")
+Signed-off-by: Pin-yen Lin <treapking@chromium.org>
+Link: https://lore.kernel.org/r/20240613120357.1043342-1-treapking@chromium.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/mediatek/clk-mt8183-mfgcfg.c |  1 +
+ drivers/clk/mediatek/clk-mtk.c           | 24 ++++++++++++++----------
+ drivers/clk/mediatek/clk-mtk.h           |  2 ++
+ 3 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/clk/mediatek/clk-mt8183-mfgcfg.c b/drivers/clk/mediatek/clk-mt8183-mfgcfg.c
+index ba504e19d4203..62d876e150e11 100644
+--- a/drivers/clk/mediatek/clk-mt8183-mfgcfg.c
++++ b/drivers/clk/mediatek/clk-mt8183-mfgcfg.c
+@@ -29,6 +29,7 @@ static const struct mtk_gate mfg_clks[] = {
+ static const struct mtk_clk_desc mfg_desc = {
+       .clks = mfg_clks,
+       .num_clks = ARRAY_SIZE(mfg_clks),
++      .need_runtime_pm = true,
+ };
+ static const struct of_device_id of_match_clk_mt8183_mfg[] = {
+diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
+index bd37ab4d1a9bb..ba1d1c495bc2b 100644
+--- a/drivers/clk/mediatek/clk-mtk.c
++++ b/drivers/clk/mediatek/clk-mtk.c
+@@ -496,14 +496,16 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,
+       }
+-      devm_pm_runtime_enable(&pdev->dev);
+-      /*
+-       * Do a pm_runtime_resume_and_get() to workaround a possible
+-       * deadlock between clk_register() and the genpd framework.
+-       */
+-      r = pm_runtime_resume_and_get(&pdev->dev);
+-      if (r)
+-              return r;
++      if (mcd->need_runtime_pm) {
++              devm_pm_runtime_enable(&pdev->dev);
++              /*
++               * Do a pm_runtime_resume_and_get() to workaround a possible
++               * deadlock between clk_register() and the genpd framework.
++               */
++              r = pm_runtime_resume_and_get(&pdev->dev);
++              if (r)
++                      return r;
++      }
+       /* Calculate how many clk_hw_onecell_data entries to allocate */
+       num_clks = mcd->num_clks + mcd->num_composite_clks;
+@@ -585,7 +587,8 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,
+                       goto unregister_clks;
+       }
+-      pm_runtime_put(&pdev->dev);
++      if (mcd->need_runtime_pm)
++              pm_runtime_put(&pdev->dev);
+       return r;
+@@ -618,7 +621,8 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,
+       if (mcd->shared_io && base)
+               iounmap(base);
+-      pm_runtime_put(&pdev->dev);
++      if (mcd->need_runtime_pm)
++              pm_runtime_put(&pdev->dev);
+       return r;
+ }
+diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h
+index 22096501a60a7..c17fe1c2d732d 100644
+--- a/drivers/clk/mediatek/clk-mtk.h
++++ b/drivers/clk/mediatek/clk-mtk.h
+@@ -237,6 +237,8 @@ struct mtk_clk_desc {
+       int (*clk_notifier_func)(struct device *dev, struct clk *clk);
+       unsigned int mfg_clk_idx;
++
++      bool need_runtime_pm;
+ };
+ int mtk_clk_pdev_probe(struct platform_device *pdev);
+-- 
+2.43.0
+
diff --git a/queue-6.6/clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch b/queue-6.6/clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch
new file mode 100644 (file)
index 0000000..fd340b1
--- /dev/null
@@ -0,0 +1,44 @@
+From eb413331a2913ecf4b2bb958d69a1ad6901a68dd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 May 2024 22:34:14 +0200
+Subject: clk: qcom: clk-alpha-pll: set ALPHA_EN bit for Stromer Plus PLLs
+
+From: Gabor Juhos <j4g8y7@gmail.com>
+
+[ Upstream commit 5a33a64524e6381c399e5e42571d9363ffc0bed4 ]
+
+The clk_alpha_pll_stromer_plus_set_rate() function does not
+sets the ALPHA_EN bit in the USER_CTL register, so setting
+rates which requires using alpha mode works only if the bit
+gets set already prior calling the function.
+
+Extend the function to set the ALPHA_EN bit in order to allow
+using fractional rates regardless whether the bit gets set
+previously or not.
+
+Fixes: 84da48921a97 ("clk: qcom: clk-alpha-pll: introduce stromer plus ops")
+Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
+Link: https://lore.kernel.org/r/20240508-stromer-plus-alpha-en-v1-1-6639ce01ca5b@gmail.com
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/qcom/clk-alpha-pll.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
+index 5cf862b0bb62a..85aa089650eaa 100644
+--- a/drivers/clk/qcom/clk-alpha-pll.c
++++ b/drivers/clk/qcom/clk-alpha-pll.c
+@@ -2510,6 +2510,9 @@ static int clk_alpha_pll_stromer_plus_set_rate(struct clk_hw *hw,
+       regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll),
+                                       a >> ALPHA_BITWIDTH);
++      regmap_update_bits(pll->clkr.regmap, PLL_USER_CTL(pll),
++                         PLL_ALPHA_EN, PLL_ALPHA_EN);
++
+       regmap_write(pll->clkr.regmap, PLL_MODE(pll), PLL_BYPASSNL);
+       /* Wait five micro seconds or more */
+-- 
+2.43.0
+
diff --git a/queue-6.6/clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch b/queue-6.6/clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch
new file mode 100644 (file)
index 0000000..b9042d4
--- /dev/null
@@ -0,0 +1,77 @@
+From 2411fb9f7750f1604fe8d9b297d1e6d802ad4982 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 May 2024 10:12:53 +0200
+Subject: clk: qcom: gcc-sm6350: Fix gpll6* & gpll7 parents
+
+From: Luca Weiss <luca.weiss@fairphone.com>
+
+[ Upstream commit 3414f41a13eb41db15c558fbc695466203dca4fa ]
+
+Both gpll6 and gpll7 are parented to CXO at 19.2 MHz and not to GPLL0
+which runs at 600 MHz. Also gpll6_out_even should have the parent gpll6
+and not gpll0.
+
+Adjust the parents of these clocks to make Linux report the correct rate
+and not absurd numbers like gpll7 at ~25 GHz or gpll6 at 24 GHz.
+
+Corrected rates are the following:
+
+  gpll7              807999902 Hz
+  gpll6              768000000 Hz
+     gpll6_out_even  384000000 Hz
+  gpll0              600000000 Hz
+     gpll0_out_odd   200000000 Hz
+     gpll0_out_even  300000000 Hz
+
+And because gpll6 is the parent of gcc_sdcc2_apps_clk_src (at 202 MHz)
+that clock also reports the correct rate now and avoids this warning:
+
+  [    5.984062] mmc0: Card appears overclocked; req 202000000 Hz, actual 6312499237 Hz
+
+Fixes: 131abae905df ("clk: qcom: Add SM6350 GCC driver")
+Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
+Link: https://lore.kernel.org/r/20240508-sm6350-gpll-fix-v1-1-e4ea34284a6d@fairphone.com
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/qcom/gcc-sm6350.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/clk/qcom/gcc-sm6350.c b/drivers/clk/qcom/gcc-sm6350.c
+index cf4a7b6e0b23a..0559a33faf00e 100644
+--- a/drivers/clk/qcom/gcc-sm6350.c
++++ b/drivers/clk/qcom/gcc-sm6350.c
+@@ -100,8 +100,8 @@ static struct clk_alpha_pll gpll6 = {
+               .enable_mask = BIT(6),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gpll6",
+-                      .parent_hws = (const struct clk_hw*[]){
+-                              &gpll0.clkr.hw,
++                      .parent_data = &(const struct clk_parent_data){
++                              .fw_name = "bi_tcxo",
+                       },
+                       .num_parents = 1,
+                       .ops = &clk_alpha_pll_fixed_fabia_ops,
+@@ -124,7 +124,7 @@ static struct clk_alpha_pll_postdiv gpll6_out_even = {
+       .clkr.hw.init = &(struct clk_init_data){
+               .name = "gpll6_out_even",
+               .parent_hws = (const struct clk_hw*[]){
+-                      &gpll0.clkr.hw,
++                      &gpll6.clkr.hw,
+               },
+               .num_parents = 1,
+               .ops = &clk_alpha_pll_postdiv_fabia_ops,
+@@ -139,8 +139,8 @@ static struct clk_alpha_pll gpll7 = {
+               .enable_mask = BIT(7),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gpll7",
+-                      .parent_hws = (const struct clk_hw*[]){
+-                              &gpll0.clkr.hw,
++                      .parent_data = &(const struct clk_parent_data){
++                              .fw_name = "bi_tcxo",
+                       },
+                       .num_parents = 1,
+                       .ops = &clk_alpha_pll_fixed_fabia_ops,
+-- 
+2.43.0
+
diff --git a/queue-6.6/connector-fix-invalid-conversion-in-cn_proc.h.patch b/queue-6.6/connector-fix-invalid-conversion-in-cn_proc.h.patch
new file mode 100644 (file)
index 0000000..1905d14
--- /dev/null
@@ -0,0 +1,43 @@
+From e394e033a24d15b36402020d17ce4b2d0c1067b1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 14 May 2024 12:10:46 +0800
+Subject: connector: Fix invalid conversion in cn_proc.h
+
+From: Matt Jan <zoo868e@gmail.com>
+
+[ Upstream commit 06e785aeb9ea8a43d0a3967c1ba6e69d758e82d4 ]
+
+The implicit conversion from unsigned int to enum
+proc_cn_event is invalid, so explicitly cast it
+for compilation in a C++ compiler.
+/usr/include/linux/cn_proc.h: In function 'proc_cn_event valid_event(proc_cn_event)':
+/usr/include/linux/cn_proc.h:72:17: error: invalid conversion from 'unsigned int' to 'proc_cn_event' [-fpermissive]
+   72 |         ev_type &= PROC_EVENT_ALL;
+      |                 ^
+      |                 |
+      |                 unsigned int
+
+Signed-off-by: Matt Jan <zoo868e@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/uapi/linux/cn_proc.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
+index f2afb7cc4926c..18e3745b86cd4 100644
+--- a/include/uapi/linux/cn_proc.h
++++ b/include/uapi/linux/cn_proc.h
+@@ -69,8 +69,7 @@ struct proc_input {
+ static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type)
+ {
+-      ev_type &= PROC_EVENT_ALL;
+-      return ev_type;
++      return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL);
+ }
+ /*
+-- 
+2.43.0
+
diff --git a/queue-6.6/dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch b/queue-6.6/dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch
new file mode 100644 (file)
index 0000000..68a4d3c
--- /dev/null
@@ -0,0 +1,39 @@
+From 56c320a91f9f31fc9ce7abacb76de723b6091d7f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 4 May 2024 14:47:02 +0300
+Subject: dma-mapping: benchmark: avoid needless copy_to_user if benchmark
+ fails
+
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+
+[ Upstream commit f7c9ccaadffd13066353332c13d7e9bf73b8f92d ]
+
+If do_map_benchmark() has failed, there is nothing useful to copy back
+to userspace.
+
+Suggested-by: Barry Song <21cnbao@gmail.com>
+Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
+Acked-by: Robin Murphy <robin.murphy@arm.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/dma/map_benchmark.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
+index f7f3d14fa69a7..4950e0b622b1f 100644
+--- a/kernel/dma/map_benchmark.c
++++ b/kernel/dma/map_benchmark.c
+@@ -256,6 +256,9 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
+                * dma_mask changed by benchmark
+                */
+               dma_set_mask(map->dev, old_dma_mask);
++
++              if (ret)
++                      return ret;
+               break;
+       default:
+               return -EINVAL;
+-- 
+2.43.0
+
diff --git a/queue-6.6/drm-amdgpu-silence-ubsan-warning.patch b/queue-6.6/drm-amdgpu-silence-ubsan-warning.patch
new file mode 100644 (file)
index 0000000..7530f1d
--- /dev/null
@@ -0,0 +1,37 @@
+From 0a86df9a57547c5ef9e5831a8bfbae4d833f70cf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 16 May 2024 09:51:26 -0400
+Subject: drm/amdgpu: silence UBSAN warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+[ Upstream commit 05d9e24ddb15160164ba6e917a88c00907dc2434 ]
+
+Convert a variable sized array from [1] to [].
+
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/include/atomfirmware.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/include/atomfirmware.h b/drivers/gpu/drm/amd/include/atomfirmware.h
+index 5848617252317..6c8b4afa7cc6e 100644
+--- a/drivers/gpu/drm/amd/include/atomfirmware.h
++++ b/drivers/gpu/drm/amd/include/atomfirmware.h
+@@ -3551,7 +3551,7 @@ struct atom_gpio_voltage_object_v4
+    uint8_t  phase_delay_us;                      // phase delay in unit of micro second
+    uint8_t  reserved;   
+    uint32_t gpio_mask_val;                         // GPIO Mask value
+-   struct atom_voltage_gpio_map_lut voltage_gpio_lut[1];
++   struct atom_voltage_gpio_map_lut voltage_gpio_lut[] __counted_by(gpio_entry_num);
+ };
+ struct  atom_svid2_voltage_object_v4
+-- 
+2.43.0
+
diff --git a/queue-6.6/fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch b/queue-6.6/fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch
new file mode 100644 (file)
index 0000000..23ad658
--- /dev/null
@@ -0,0 +1,38 @@
+From 7f4a7e8a52c46e237cdcded37fbe062f4366710c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 22 Apr 2024 17:18:51 +0300
+Subject: fs/ntfs3: Mark volume as dirty if xattr is broken
+
+From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
+
+[ Upstream commit 24f6f5020b0b2c89c2cba5ec224547be95f753ee ]
+
+Mark a volume as corrupted if the name length exceeds the space
+occupied by ea.
+
+Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ntfs3/xattr.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
+index b50010494e6d0..72bceb8cd164b 100644
+--- a/fs/ntfs3/xattr.c
++++ b/fs/ntfs3/xattr.c
+@@ -219,8 +219,11 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,
+               if (!ea->name_len)
+                       break;
+-              if (ea->name_len > ea_size)
++              if (ea->name_len > ea_size) {
++                      ntfs_set_state(ni->mi.sbi, NTFS_DIRTY_ERROR);
++                      err = -EINVAL; /* corrupted fs */
+                       break;
++              }
+               if (buffer) {
+                       /* Check if we can use field ea->name */
+-- 
+2.43.0
+
diff --git a/queue-6.6/i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch b/queue-6.6/i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch
new file mode 100644 (file)
index 0000000..88858bd
--- /dev/null
@@ -0,0 +1,185 @@
+From 87487a43ad8c1538272032495048a90687baa247 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 28 Jun 2024 17:25:42 +0200
+Subject: i2c: pnx: Fix potential deadlock warning from del_timer_sync() call
+ in isr
+
+From: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
+
+[ Upstream commit f63b94be6942ba82c55343e196bd09b53227618e ]
+
+When del_timer_sync() is called in an interrupt context it throws a warning
+because of potential deadlock. The timer is used only to exit from
+wait_for_completion() after a timeout so replacing the call with
+wait_for_completion_timeout() allows to remove the problematic timer and
+its related functions altogether.
+
+Fixes: 41561f28e76a ("i2c: New Philips PNX bus driver")
+Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-pnx.c | 48 ++++++++----------------------------
+ 1 file changed, 10 insertions(+), 38 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
+index a12525b3186bc..f448505d54682 100644
+--- a/drivers/i2c/busses/i2c-pnx.c
++++ b/drivers/i2c/busses/i2c-pnx.c
+@@ -15,7 +15,6 @@
+ #include <linux/ioport.h>
+ #include <linux/delay.h>
+ #include <linux/i2c.h>
+-#include <linux/timer.h>
+ #include <linux/completion.h>
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+@@ -32,7 +31,6 @@ struct i2c_pnx_mif {
+       int                     ret;            /* Return value */
+       int                     mode;           /* Interface mode */
+       struct completion       complete;       /* I/O completion */
+-      struct timer_list       timer;          /* Timeout */
+       u8 *                    buf;            /* Data buffer */
+       int                     len;            /* Length of data buffer */
+       int                     order;          /* RX Bytes to order via TX */
+@@ -117,24 +115,6 @@ static inline int wait_reset(struct i2c_pnx_algo_data *data)
+       return (timeout <= 0);
+ }
+-static inline void i2c_pnx_arm_timer(struct i2c_pnx_algo_data *alg_data)
+-{
+-      struct timer_list *timer = &alg_data->mif.timer;
+-      unsigned long expires = msecs_to_jiffies(alg_data->timeout);
+-
+-      if (expires <= 1)
+-              expires = 2;
+-
+-      del_timer_sync(timer);
+-
+-      dev_dbg(&alg_data->adapter.dev, "Timer armed at %lu plus %lu jiffies.\n",
+-              jiffies, expires);
+-
+-      timer->expires = jiffies + expires;
+-
+-      add_timer(timer);
+-}
+-
+ /**
+  * i2c_pnx_start - start a device
+  * @slave_addr:               slave address
+@@ -259,8 +239,6 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
+                               ~(mcntrl_afie | mcntrl_naie | mcntrl_drmie),
+                                 I2C_REG_CTL(alg_data));
+-                      del_timer_sync(&alg_data->mif.timer);
+-
+                       dev_dbg(&alg_data->adapter.dev,
+                               "%s(): Waking up xfer routine.\n",
+                               __func__);
+@@ -276,8 +254,6 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
+                       ~(mcntrl_afie | mcntrl_naie | mcntrl_drmie),
+                         I2C_REG_CTL(alg_data));
+-              /* Stop timer. */
+-              del_timer_sync(&alg_data->mif.timer);
+               dev_dbg(&alg_data->adapter.dev,
+                       "%s(): Waking up xfer routine after zero-xfer.\n",
+                       __func__);
+@@ -364,8 +340,6 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data)
+                                mcntrl_drmie | mcntrl_daie);
+                       iowrite32(ctl, I2C_REG_CTL(alg_data));
+-                      /* Kill timer. */
+-                      del_timer_sync(&alg_data->mif.timer);
+                       complete(&alg_data->mif.complete);
+               }
+       }
+@@ -400,8 +374,6 @@ static irqreturn_t i2c_pnx_interrupt(int irq, void *dev_id)
+                        mcntrl_drmie);
+               iowrite32(ctl, I2C_REG_CTL(alg_data));
+-              /* Stop timer, to prevent timeout. */
+-              del_timer_sync(&alg_data->mif.timer);
+               complete(&alg_data->mif.complete);
+       } else if (stat & mstatus_nai) {
+               /* Slave did not acknowledge, generate a STOP */
+@@ -419,8 +391,6 @@ static irqreturn_t i2c_pnx_interrupt(int irq, void *dev_id)
+               /* Our return value. */
+               alg_data->mif.ret = -EIO;
+-              /* Stop timer, to prevent timeout. */
+-              del_timer_sync(&alg_data->mif.timer);
+               complete(&alg_data->mif.complete);
+       } else {
+               /*
+@@ -453,9 +423,8 @@ static irqreturn_t i2c_pnx_interrupt(int irq, void *dev_id)
+       return IRQ_HANDLED;
+ }
+-static void i2c_pnx_timeout(struct timer_list *t)
++static void i2c_pnx_timeout(struct i2c_pnx_algo_data *alg_data)
+ {
+-      struct i2c_pnx_algo_data *alg_data = from_timer(alg_data, t, mif.timer);
+       u32 ctl;
+       dev_err(&alg_data->adapter.dev,
+@@ -472,7 +441,6 @@ static void i2c_pnx_timeout(struct timer_list *t)
+       iowrite32(ctl, I2C_REG_CTL(alg_data));
+       wait_reset(alg_data);
+       alg_data->mif.ret = -EIO;
+-      complete(&alg_data->mif.complete);
+ }
+ static inline void bus_reset_if_active(struct i2c_pnx_algo_data *alg_data)
+@@ -514,6 +482,7 @@ i2c_pnx_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+       struct i2c_msg *pmsg;
+       int rc = 0, completed = 0, i;
+       struct i2c_pnx_algo_data *alg_data = adap->algo_data;
++      unsigned long time_left;
+       u32 stat;
+       dev_dbg(&alg_data->adapter.dev,
+@@ -548,7 +517,6 @@ i2c_pnx_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+               dev_dbg(&alg_data->adapter.dev, "%s(): mode %d, %d bytes\n",
+                       __func__, alg_data->mif.mode, alg_data->mif.len);
+-              i2c_pnx_arm_timer(alg_data);
+               /* initialize the completion var */
+               init_completion(&alg_data->mif.complete);
+@@ -564,7 +532,10 @@ i2c_pnx_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+                       break;
+               /* Wait for completion */
+-              wait_for_completion(&alg_data->mif.complete);
++              time_left = wait_for_completion_timeout(&alg_data->mif.complete,
++                                                      alg_data->timeout);
++              if (time_left == 0)
++                      i2c_pnx_timeout(alg_data);
+               if (!(rc = alg_data->mif.ret))
+                       completed++;
+@@ -653,7 +624,10 @@ static int i2c_pnx_probe(struct platform_device *pdev)
+       alg_data->adapter.algo_data = alg_data;
+       alg_data->adapter.nr = pdev->id;
+-      alg_data->timeout = I2C_PNX_TIMEOUT_DEFAULT;
++      alg_data->timeout = msecs_to_jiffies(I2C_PNX_TIMEOUT_DEFAULT);
++      if (alg_data->timeout <= 1)
++              alg_data->timeout = 2;
++
+ #ifdef CONFIG_OF
+       alg_data->adapter.dev.of_node = of_node_get(pdev->dev.of_node);
+       if (pdev->dev.of_node) {
+@@ -673,8 +647,6 @@ static int i2c_pnx_probe(struct platform_device *pdev)
+       if (IS_ERR(alg_data->clk))
+               return PTR_ERR(alg_data->clk);
+-      timer_setup(&alg_data->mif.timer, i2c_pnx_timeout, 0);
+-
+       snprintf(alg_data->adapter.name, sizeof(alg_data->adapter.name),
+                "%s", pdev->name);
+-- 
+2.43.0
+
diff --git a/queue-6.6/kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch b/queue-6.6/kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch
new file mode 100644 (file)
index 0000000..ab062f6
--- /dev/null
@@ -0,0 +1,59 @@
+From 95a80137bfa1ef95f7698a9ee81e79eb76bc1947 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 May 2024 21:42:11 +0900
+Subject: kbuild: fix short log for AS in link-vmlinux.sh
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 3430f65d6130ccbc86f0ff45642eeb9e2032a600 ]
+
+In convention, short logs print the output file, not the input file.
+
+Let's change the suffix for 'AS' since it assembles *.S into *.o.
+
+[Before]
+
+  LD      .tmp_vmlinux.kallsyms1
+  NM      .tmp_vmlinux.kallsyms1.syms
+  KSYMS   .tmp_vmlinux.kallsyms1.S
+  AS      .tmp_vmlinux.kallsyms1.S
+  LD      .tmp_vmlinux.kallsyms2
+  NM      .tmp_vmlinux.kallsyms2.syms
+  KSYMS   .tmp_vmlinux.kallsyms2.S
+  AS      .tmp_vmlinux.kallsyms2.S
+  LD      vmlinux
+
+[After]
+
+  LD      .tmp_vmlinux.kallsyms1
+  NM      .tmp_vmlinux.kallsyms1.syms
+  KSYMS   .tmp_vmlinux.kallsyms1.S
+  AS      .tmp_vmlinux.kallsyms1.o
+  LD      .tmp_vmlinux.kallsyms2
+  NM      .tmp_vmlinux.kallsyms2.syms
+  KSYMS   .tmp_vmlinux.kallsyms2.S
+  AS      .tmp_vmlinux.kallsyms2.o
+  LD      vmlinux
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/link-vmlinux.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
+index 7862a81017477..a9434a72cac4f 100755
+--- a/scripts/link-vmlinux.sh
++++ b/scripts/link-vmlinux.sh
+@@ -182,7 +182,7 @@ kallsyms_step()
+       mksysmap ${kallsyms_vmlinux} ${kallsyms_vmlinux}.syms ${kallsymso_prev}
+       kallsyms ${kallsyms_vmlinux}.syms ${kallsyms_S}
+-      info AS ${kallsyms_S}
++      info AS ${kallsymso}
+       ${CC} ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS} \
+             ${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
+             -c -o ${kallsymso} ${kallsyms_S}
+-- 
+2.43.0
+
diff --git a/queue-6.6/nfc-nci-add-the-inconsistency-check-between-the-inpu.patch b/queue-6.6/nfc-nci-add-the-inconsistency-check-between-the-inpu.patch
new file mode 100644 (file)
index 0000000..83c130e
--- /dev/null
@@ -0,0 +1,45 @@
+From 36d9d29f21cabb6799a1ef64e549770a04e414d4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 28 May 2024 11:12:31 +0800
+Subject: nfc/nci: Add the inconsistency check between the input data length
+ and count
+
+From: Edward Adam Davis <eadavis@qq.com>
+
+[ Upstream commit 068648aab72c9ba7b0597354ef4d81ffaac7b979 ]
+
+write$nci(r0, &(0x7f0000000740)=ANY=[@ANYBLOB="610501"], 0xf)
+
+Syzbot constructed a write() call with a data length of 3 bytes but a count value
+of 15, which passed too little data to meet the basic requirements of the function
+nci_rf_intf_activated_ntf_packet().
+
+Therefore, increasing the comparison between data length and count value to avoid
+problems caused by inconsistent data length and count.
+
+Reported-and-tested-by: syzbot+71bfed2b2bcea46c98f2@syzkaller.appspotmail.com
+Signed-off-by: Edward Adam Davis <eadavis@qq.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nfc/virtual_ncidev.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c
+index 590b038e449e5..6b89d596ba9af 100644
+--- a/drivers/nfc/virtual_ncidev.c
++++ b/drivers/nfc/virtual_ncidev.c
+@@ -125,6 +125,10 @@ static ssize_t virtual_ncidev_write(struct file *file,
+               kfree_skb(skb);
+               return -EFAULT;
+       }
++      if (strnlen(skb->data, count) != count) {
++              kfree_skb(skb);
++              return -EINVAL;
++      }
+       nci_recv_frame(vdev->ndev, skb);
+       return count;
+-- 
+2.43.0
+
diff --git a/queue-6.6/null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch b/queue-6.6/null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch
new file mode 100644 (file)
index 0000000..5cba8d2
--- /dev/null
@@ -0,0 +1,56 @@
+From 00172b4d7b609946f71be572b8ac67dca6019997 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 30 May 2024 14:40:32 +0900
+Subject: null_blk: Do not allow runt zone with zone capacity smaller then zone
+ size
+
+From: Damien Le Moal <dlemoal@kernel.org>
+
+[ Upstream commit b164316808ec5de391c3e7b0148ec937d32d280d ]
+
+A zoned device with a smaller last zone together with a zone capacity
+smaller than the zone size does make any sense as that does not
+correspond to any possible setup for a real device:
+1) For ZNS and zoned UFS devices, all zones are always the same size.
+2) For SMR HDDs, all zones always have the same capacity.
+In other words, if we have a smaller last runt zone, then this zone
+capacity should always be equal to the zone size.
+
+Add a check in null_init_zoned_dev() to prevent a configuration to have
+both a smaller zone size and a zone capacity smaller than the zone size.
+
+Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
+Reviewed-by: Niklas Cassel <cassel@kernel.org>
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Link: https://lore.kernel.org/r/20240530054035.491497-2-dlemoal@kernel.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/block/null_blk/zoned.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
+index 36bd191998375..d057f7099e7f7 100644
+--- a/drivers/block/null_blk/zoned.c
++++ b/drivers/block/null_blk/zoned.c
+@@ -83,6 +83,17 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)
+               return -EINVAL;
+       }
++      /*
++       * If a smaller zone capacity was requested, do not allow a smaller last
++       * zone at the same time as such zone configuration does not correspond
++       * to any real zoned device.
++       */
++      if (dev->zone_capacity != dev->zone_size &&
++          dev->size & (dev->zone_size - 1)) {
++              pr_err("A smaller last zone is not allowed with zone capacity smaller than zone size.\n");
++              return -EINVAL;
++      }
++
+       zone_capacity_sects = mb_to_sects(dev->zone_capacity);
+       dev_capacity_sects = mb_to_sects(dev->size);
+       dev->zone_size_sects = mb_to_sects(dev->zone_size);
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch b/queue-6.6/nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch
new file mode 100644 (file)
index 0000000..9c7f316
--- /dev/null
@@ -0,0 +1,45 @@
+From fba64fbfad2947177da34c63d9df17f763b48455 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 23 May 2024 17:01:49 +0530
+Subject: nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset
+
+From: Kundan Kumar <kundan.kumar@samsung.com>
+
+[ Upstream commit 1bd293fcf3af84674e82ed022c049491f3768840 ]
+
+bio_vec start offset may be relatively large particularly when large
+folio gets added to the bio. A bigger offset will result in avoiding the
+single-segment mapping optimization and end up using expensive
+mempool_alloc further.
+
+Rather than using absolute value, adjust bv_offset by
+NVME_CTRL_PAGE_SIZE while checking if segment can be fitted into one/two
+PRP entries.
+
+Suggested-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
+Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/pci.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
+index 8d5ed4cb35d96..710fd4d862520 100644
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -778,7 +778,8 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
+               struct bio_vec bv = req_bvec(req);
+               if (!is_pci_p2pdma_page(bv.bv_page)) {
+-                      if (bv.bv_offset + bv.bv_len <= NVME_CTRL_PAGE_SIZE * 2)
++                      if ((bv.bv_offset & (NVME_CTRL_PAGE_SIZE - 1)) +
++                           bv.bv_len <= NVME_CTRL_PAGE_SIZE * 2)
+                               return nvme_setup_prp_simple(dev, req,
+                                                            &cmnd->rw, &bv);
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvme-multipath-find-numa-path-only-for-online-numa-n.patch b/queue-6.6/nvme-multipath-find-numa-path-only-for-online-numa-n.patch
new file mode 100644 (file)
index 0000000..f581e46
--- /dev/null
@@ -0,0 +1,54 @@
+From 8c79fab9d27abc4bc3b30d4931aa7fe2742d1de3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 16 May 2024 17:43:51 +0530
+Subject: nvme-multipath: find NUMA path only for online numa-node
+
+From: Nilay Shroff <nilay@linux.ibm.com>
+
+[ Upstream commit d3a043733f25d743f3aa617c7f82dbcb5ee2211a ]
+
+In current native multipath design when a shared namespace is created,
+we loop through each possible numa-node, calculate the NUMA distance of
+that node from each nvme controller and then cache the optimal IO path
+for future reference while sending IO. The issue with this design is that
+we may refer to the NUMA distance table for an offline node which may not
+be populated at the time and so we may inadvertently end up finding and
+caching a non-optimal path for IO. Then latter when the corresponding
+numa-node becomes online and hence the NUMA distance table entry for that
+node is created, ideally we should re-calculate the multipath node distance
+for the newly added node however that doesn't happen unless we rescan/reset
+the controller. So essentially, we may keep using non-optimal IO path for a
+node which is made online after namespace is created.
+This patch helps fix this issue ensuring that when a shared namespace is
+created, we calculate the multipath node distance for each online numa-node
+instead of each possible numa-node. Then latter when a node becomes online
+and we receive any IO on that newly added node, we would calculate the
+multipath node distance for newly added node but this time NUMA distance
+table would have been already populated for newly added node. Hence we
+would be able to correctly calculate the multipath node distance and choose
+the optimal path for the IO.
+
+Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/multipath.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
+index 3ac0cc22207dc..6515fa537ee53 100644
+--- a/drivers/nvme/host/multipath.c
++++ b/drivers/nvme/host/multipath.c
+@@ -594,7 +594,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
+               int node, srcu_idx;
+               srcu_idx = srcu_read_lock(&head->srcu);
+-              for_each_node(node)
++              for_each_online_node(node)
+                       __nvme_find_path(head, node);
+               srcu_read_unlock(&head->srcu, srcu_idx);
+       }
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch b/queue-6.6/nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch
new file mode 100644 (file)
index 0000000..d275289
--- /dev/null
@@ -0,0 +1,63 @@
+From b03149b420a242e9a97006fdb320b5d257e84209 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 27 May 2024 22:38:52 +0300
+Subject: nvmet: fix a possible leak when destroy a ctrl during qp
+ establishment
+
+From: Sagi Grimberg <sagi@grimberg.me>
+
+[ Upstream commit c758b77d4a0a0ed3a1292b3fd7a2aeccd1a169a4 ]
+
+In nvmet_sq_destroy we capture sq->ctrl early and if it is non-NULL we
+know that a ctrl was allocated (in the admin connect request handler)
+and we need to release pending AERs, clear ctrl->sqs and sq->ctrl
+(for nvme-loop primarily), and drop the final reference on the ctrl.
+
+However, a small window is possible where nvmet_sq_destroy starts (as
+a result of the client giving up and disconnecting) concurrently with
+the nvme admin connect cmd (which may be in an early stage). But *before*
+kill_and_confirm of sq->ref (i.e. the admin connect managed to get an sq
+live reference). In this case, sq->ctrl was allocated however after it was
+captured in a local variable in nvmet_sq_destroy.
+This prevented the final reference drop on the ctrl.
+
+Solve this by re-capturing the sq->ctrl after all inflight request has
+completed, where for sure sq->ctrl reference is final, and move forward
+based on that.
+
+This issue was observed in an environment with many hosts connecting
+multiple ctrls simoutanuosly, creating a delay in allocating a ctrl
+leading up to this race window.
+
+Reported-by: Alex Turin <alex@vastdata.com>
+Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/target/core.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
+index ce7e945cb4f7e..cfba3ec7add84 100644
+--- a/drivers/nvme/target/core.c
++++ b/drivers/nvme/target/core.c
+@@ -806,6 +806,15 @@ void nvmet_sq_destroy(struct nvmet_sq *sq)
+       percpu_ref_exit(&sq->ref);
+       nvmet_auth_sq_free(sq);
++      /*
++       * we must reference the ctrl again after waiting for inflight IO
++       * to complete. Because admin connect may have sneaked in after we
++       * store sq->ctrl locally, but before we killed the percpu_ref. the
++       * admin connect allocates and assigns sq->ctrl, which now needs a
++       * final ref put, as this ctrl is going away.
++       */
++      ctrl = sq->ctrl;
++
+       if (ctrl) {
+               /*
+                * The teardown flow may take some time, and the host may not
+-- 
+2.43.0
+
diff --git a/queue-6.6/platform-x86-touchscreen_dmi-add-info-for-globalspac.patch b/queue-6.6/platform-x86-touchscreen_dmi-add-info-for-globalspac.patch
new file mode 100644 (file)
index 0000000..0c2be26
--- /dev/null
@@ -0,0 +1,69 @@
+From 277fe1f049791d5ad68d6130f00ed2acc4ecce63 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 27 May 2024 11:14:46 +0200
+Subject: platform/x86: touchscreen_dmi: Add info for GlobalSpace SolT IVW
+ 11.6" tablet
+
+From: hmtheboy154 <buingoc67@gmail.com>
+
+[ Upstream commit 7c8639aa41343fd7b3dbe09baf6b0791fcc407a1 ]
+
+This is a tablet created by GlobalSpace Technologies Limited
+which uses an Intel Atom x5-Z8300, 4GB of RAM & 64GB of storage.
+
+Link: https://web.archive.org/web/20171102141952/http://globalspace.in/11.6-device.html
+Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20240527091447.248849-2-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/touchscreen_dmi.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
+index 630ed0515b1e9..bb1df9d03bbcd 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -902,6 +902,22 @@ static const struct ts_dmi_data schneider_sct101ctm_data = {
+       .properties     = schneider_sct101ctm_props,
+ };
++static const struct property_entry globalspace_solt_ivw116_props[] = {
++      PROPERTY_ENTRY_U32("touchscreen-min-x", 7),
++      PROPERTY_ENTRY_U32("touchscreen-min-y", 22),
++      PROPERTY_ENTRY_U32("touchscreen-size-x", 1723),
++      PROPERTY_ENTRY_U32("touchscreen-size-y", 1077),
++      PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-globalspace-solt-ivw116.fw"),
++      PROPERTY_ENTRY_U32("silead,max-fingers", 10),
++      PROPERTY_ENTRY_BOOL("silead,home-button"),
++      { }
++};
++
++static const struct ts_dmi_data globalspace_solt_ivw116_data = {
++      .acpi_name      = "MSSL1680:00",
++      .properties     = globalspace_solt_ivw116_props,
++};
++
+ static const struct property_entry techbite_arc_11_6_props[] = {
+       PROPERTY_ENTRY_U32("touchscreen-min-x", 5),
+       PROPERTY_ENTRY_U32("touchscreen-min-y", 7),
+@@ -1629,6 +1645,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
+                       DMI_MATCH(DMI_PRODUCT_NAME, "SCT101CTM"),
+               },
+       },
++      {
++              /* GlobalSpace SoLT IVW 11.6" */
++              .driver_data = (void *)&globalspace_solt_ivw116_data,
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Globalspace Tech Pvt Ltd"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "SolTIVW"),
++                      DMI_MATCH(DMI_PRODUCT_SKU, "PN20170413488"),
++              },
++      },
+       {
+               /* Techbite Arc 11.6 */
+               .driver_data = (void *)&techbite_arc_11_6_data,
+-- 
+2.43.0
+
diff --git a/queue-6.6/platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch b/queue-6.6/platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch
new file mode 100644 (file)
index 0000000..dab3fbe
--- /dev/null
@@ -0,0 +1,46 @@
+From 087063d1e8760a9e138331586b3bb811df66263f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 27 May 2024 11:14:47 +0200
+Subject: platform/x86: touchscreen_dmi: Add info for the EZpad 6s Pro
+
+From: hmtheboy154 <buingoc67@gmail.com>
+
+[ Upstream commit 3050052613790e75b5e4a8536930426b0a8b0774 ]
+
+The "EZpad 6s Pro" uses the same touchscreen as the "EZpad 6 Pro B",
+unlike the "Ezpad 6 Pro" which has its own touchscreen.
+
+Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20240527091447.248849-3-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/touchscreen_dmi.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
+index bb1df9d03bbcd..06ebab520f271 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -1406,6 +1406,17 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
+                       DMI_MATCH(DMI_BIOS_DATE, "04/24/2018"),
+               },
+       },
++      {
++              /* Jumper EZpad 6s Pro */
++              .driver_data = (void *)&jumper_ezpad_6_pro_b_data,
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Ezpad"),
++                      /* Above matches are too generic, add bios match */
++                      DMI_MATCH(DMI_BIOS_VERSION, "E.WSA116_8.E1.042.bin"),
++                      DMI_MATCH(DMI_BIOS_DATE, "01/08/2020"),
++              },
++      },
+       {
+               /* Jumper EZpad 6 m4 */
+               .driver_data = (void *)&jumper_ezpad_6_m4_data,
+-- 
+2.43.0
+
diff --git a/queue-6.6/regmap-i2c-subtract-reg-size-from-max_write.patch b/queue-6.6/regmap-i2c-subtract-reg-size-from-max_write.patch
new file mode 100644 (file)
index 0000000..201fcb5
--- /dev/null
@@ -0,0 +1,46 @@
+From 0e726d91cf6c2361cc0467cd0e8be65abd0e7a0a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 23 May 2024 16:14:36 -0500
+Subject: regmap-i2c: Subtract reg size from max_write
+
+From: Jim Wylder <jwylder@google.com>
+
+[ Upstream commit 611b7eb19d0a305d4de00280e4a71a1b15c507fc ]
+
+Currently, when an adapter defines a max_write_len quirk,
+the data will be chunked into data sizes equal to the
+max_write_len quirk value.  But the payload will be increased by
+the size of the register address before transmission.  The
+resulting value always ends up larger than the limit set
+by the quirk.
+
+Avoid this error by setting regmap's max_write to the quirk's
+max_write_len minus the number of bytes for the register and
+padding.  This allows the chunking to work correctly for this
+limited case without impacting other use-cases.
+
+Signed-off-by: Jim Wylder <jwylder@google.com>
+Link: https://msgid.link/r/20240523211437.2839942-1-jwylder@google.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/regmap/regmap-i2c.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c
+index 3ec611dc0c09f..a905e955bbfc7 100644
+--- a/drivers/base/regmap/regmap-i2c.c
++++ b/drivers/base/regmap/regmap-i2c.c
+@@ -350,7 +350,8 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
+               if (quirks->max_write_len &&
+                   (bus->max_raw_write == 0 || bus->max_raw_write > quirks->max_write_len))
+-                      max_write = quirks->max_write_len;
++                      max_write = quirks->max_write_len -
++                              (config->reg_bits + config->pad_bits) / BITS_PER_BYTE;
+               if (max_read || max_write) {
+                       ret_bus = kmemdup(bus, sizeof(*bus), GFP_KERNEL);
+-- 
+2.43.0
+
index cf9f08690952aa81eb239515f1f4149d73ccc9db..2ac2eefe6cd0dac242f04423ee92d661a3f78835 100644 (file)
@@ -115,3 +115,24 @@ bnx2x-fix-multiple-ubsan-array-index-out-of-bounds.patch
 arm64-dts-rockchip-fix-the-dcdc_reg2-minimum-voltage-on-quartz64-model-b.patch
 ima-avoid-blocking-in-rcu-read-side-critical-section.patch
 media-dw2102-fix-a-potential-buffer-overflow.patch
+clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch
+clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch
+clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch
+i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch
+fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch
+alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch
+vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch
+nvme-multipath-find-numa-path-only-for-online-numa-n.patch
+dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch
+connector-fix-invalid-conversion-in-cn_proc.h.patch
+nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch
+regmap-i2c-subtract-reg-size-from-max_write.patch
+platform-x86-touchscreen_dmi-add-info-for-globalspac.patch
+platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch
+nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch
+kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch
+nfc-nci-add-the-inconsistency-check-between-the-inpu.patch
+spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch
+alsa-ump-set-default-protocol-when-not-given-explici.patch
+drm-amdgpu-silence-ubsan-warning.patch
+null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch
diff --git a/queue-6.6/spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch b/queue-6.6/spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch
new file mode 100644 (file)
index 0000000..fb9c124
--- /dev/null
@@ -0,0 +1,102 @@
+From 0060227fd9a2085c9bcbc0d6d246f90d6147d808 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 29 May 2024 00:40:32 -0700
+Subject: spi: cadence: Ensure data lines set to low during dummy-cycle period
+
+From: Witold Sadowski <wsadowski@marvell.com>
+
+[ Upstream commit 4a69c1264ff41bc5bf7c03101ada0454fbf08868 ]
+
+During dummy-cycles xSPI will switch GPIO into Hi-Z mode. In that dummy
+period voltage on data lines will slowly drop, what can cause
+unintentional modebyte transmission. Value send to SPI memory chip will
+depend on last address, and clock frequency.
+To prevent unforeseen consequences of that behaviour, force send
+single modebyte(0x00).
+Modebyte will be send only if number of dummy-cycles is not equal
+to 0. Code must also reduce dummycycle byte count by one - as one byte
+is send as modebyte.
+
+Signed-off-by: Witold Sadowski <wsadowski@marvell.com>
+Link: https://msgid.link/r/20240529074037.1345882-2-wsadowski@marvell.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/spi/spi-cadence-xspi.c | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
+index b7e04b03be58e..ee342501b759f 100644
+--- a/drivers/spi/spi-cadence-xspi.c
++++ b/drivers/spi/spi-cadence-xspi.c
+@@ -145,6 +145,9 @@
+ #define CDNS_XSPI_STIG_DONE_FLAG              BIT(0)
+ #define CDNS_XSPI_TRD_STATUS                  0x0104
++#define MODE_NO_OF_BYTES                      GENMASK(25, 24)
++#define MODEBYTES_COUNT                       1
++
+ /* Helper macros for filling command registers */
+ #define CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_1(op, data_phase) ( \
+       FIELD_PREP(CDNS_XSPI_CMD_INSTR_TYPE, (data_phase) ? \
+@@ -157,9 +160,10 @@
+       FIELD_PREP(CDNS_XSPI_CMD_P1_R2_ADDR3, ((op)->addr.val >> 24) & 0xFF) | \
+       FIELD_PREP(CDNS_XSPI_CMD_P1_R2_ADDR4, ((op)->addr.val >> 32) & 0xFF))
+-#define CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_3(op) ( \
++#define CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_3(op, modebytes) ( \
+       FIELD_PREP(CDNS_XSPI_CMD_P1_R3_ADDR5, ((op)->addr.val >> 40) & 0xFF) | \
+       FIELD_PREP(CDNS_XSPI_CMD_P1_R3_CMD, (op)->cmd.opcode) | \
++      FIELD_PREP(MODE_NO_OF_BYTES, modebytes) | \
+       FIELD_PREP(CDNS_XSPI_CMD_P1_R3_NUM_ADDR_BYTES, (op)->addr.nbytes))
+ #define CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_4(op, chipsel) ( \
+@@ -173,12 +177,12 @@
+ #define CDNS_XSPI_CMD_FLD_DSEQ_CMD_2(op) \
+       FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R2_DCNT_L, (op)->data.nbytes & 0xFFFF)
+-#define CDNS_XSPI_CMD_FLD_DSEQ_CMD_3(op) ( \
++#define CDNS_XSPI_CMD_FLD_DSEQ_CMD_3(op, dummybytes) ( \
+       FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R3_DCNT_H, \
+               ((op)->data.nbytes >> 16) & 0xffff) | \
+       FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R3_NUM_OF_DUMMY, \
+                 (op)->dummy.buswidth != 0 ? \
+-                (((op)->dummy.nbytes * 8) / (op)->dummy.buswidth) : \
++                (((dummybytes) * 8) / (op)->dummy.buswidth) : \
+                 0))
+ #define CDNS_XSPI_CMD_FLD_DSEQ_CMD_4(op, chipsel) ( \
+@@ -351,6 +355,7 @@ static int cdns_xspi_send_stig_command(struct cdns_xspi_dev *cdns_xspi,
+       u32 cmd_regs[6];
+       u32 cmd_status;
+       int ret;
++      int dummybytes = op->dummy.nbytes;
+       ret = cdns_xspi_wait_for_controller_idle(cdns_xspi);
+       if (ret < 0)
+@@ -365,7 +370,12 @@ static int cdns_xspi_send_stig_command(struct cdns_xspi_dev *cdns_xspi,
+       memset(cmd_regs, 0, sizeof(cmd_regs));
+       cmd_regs[1] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_1(op, data_phase);
+       cmd_regs[2] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_2(op);
+-      cmd_regs[3] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_3(op);
++      if (dummybytes != 0) {
++              cmd_regs[3] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_3(op, 1);
++              dummybytes--;
++      } else {
++              cmd_regs[3] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_3(op, 0);
++      }
+       cmd_regs[4] = CDNS_XSPI_CMD_FLD_P1_INSTR_CMD_4(op,
+                                                      cdns_xspi->cur_cs);
+@@ -375,7 +385,7 @@ static int cdns_xspi_send_stig_command(struct cdns_xspi_dev *cdns_xspi,
+               cmd_regs[0] = CDNS_XSPI_STIG_DONE_FLAG;
+               cmd_regs[1] = CDNS_XSPI_CMD_FLD_DSEQ_CMD_1(op);
+               cmd_regs[2] = CDNS_XSPI_CMD_FLD_DSEQ_CMD_2(op);
+-              cmd_regs[3] = CDNS_XSPI_CMD_FLD_DSEQ_CMD_3(op);
++              cmd_regs[3] = CDNS_XSPI_CMD_FLD_DSEQ_CMD_3(op, dummybytes);
+               cmd_regs[4] = CDNS_XSPI_CMD_FLD_DSEQ_CMD_4(op,
+                                                          cdns_xspi->cur_cs);
+-- 
+2.43.0
+
diff --git a/queue-6.6/vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch b/queue-6.6/vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch
new file mode 100644 (file)
index 0000000..5d3f6c0
--- /dev/null
@@ -0,0 +1,81 @@
+From 1d0818641b42a014368264ef3886668e52b38bdf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 15 Mar 2024 19:46:59 -0500
+Subject: vhost-scsi: Handle vhost_vq_work_queue failures for events
+
+From: Mike Christie <michael.christie@oracle.com>
+
+[ Upstream commit b1b2ce58ed23c5d56e0ab299a5271ac01f95b75c ]
+
+Currently, we can try to queue an event's work before the vhost_task is
+created. When this happens we just drop it in vhost_scsi_do_plug before
+even calling vhost_vq_work_queue. During a device shutdown we do the
+same thing after vhost_scsi_clear_endpoint has cleared the backends.
+
+In the next patches we will be able to kill the vhost_task before we
+have cleared the endpoint. In that case, vhost_vq_work_queue can fail
+and we will leak the event's memory. This has handle the failure by
+just freeing the event. This is safe to do, because
+vhost_vq_work_queue will only return failure for us when the vhost_task
+is killed and so userspace will not be able to handle events if we
+sent them.
+
+Signed-off-by: Mike Christie <michael.christie@oracle.com>
+Message-Id: <20240316004707.45557-2-michael.christie@oracle.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/vhost/scsi.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
+index abef0619c7901..8f17d29ab7e9c 100644
+--- a/drivers/vhost/scsi.c
++++ b/drivers/vhost/scsi.c
+@@ -497,10 +497,8 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
+               vq_err(vq, "Faulted on vhost_scsi_send_event\n");
+ }
+-static void vhost_scsi_evt_work(struct vhost_work *work)
++static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
+ {
+-      struct vhost_scsi *vs = container_of(work, struct vhost_scsi,
+-                                      vs_event_work);
+       struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
+       struct vhost_scsi_evt *evt, *t;
+       struct llist_node *llnode;
+@@ -508,12 +506,20 @@ static void vhost_scsi_evt_work(struct vhost_work *work)
+       mutex_lock(&vq->mutex);
+       llnode = llist_del_all(&vs->vs_event_list);
+       llist_for_each_entry_safe(evt, t, llnode, list) {
+-              vhost_scsi_do_evt_work(vs, evt);
++              if (!drop)
++                      vhost_scsi_do_evt_work(vs, evt);
+               vhost_scsi_free_evt(vs, evt);
+       }
+       mutex_unlock(&vq->mutex);
+ }
++static void vhost_scsi_evt_work(struct vhost_work *work)
++{
++      struct vhost_scsi *vs = container_of(work, struct vhost_scsi,
++                                           vs_event_work);
++      vhost_scsi_complete_events(vs, false);
++}
++
+ static int vhost_scsi_copy_sgl_to_iov(struct vhost_scsi_cmd *cmd)
+ {
+       struct iov_iter *iter = &cmd->saved_iter;
+@@ -1509,7 +1515,8 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
+       }
+       llist_add(&evt->list, &vs->vs_event_list);
+-      vhost_vq_work_queue(vq, &vs->vs_event_work);
++      if (!vhost_vq_work_queue(vq, &vs->vs_event_work))
++              vhost_scsi_complete_events(vs, true);
+ }
+ static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
+-- 
+2.43.0
+