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

diff --git a/queue-6.9/alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch b/queue-6.9/alsa-hda-realtek-enable-headset-mic-of-jp-ik-leap-w5.patch
new file mode 100644 (file)
index 0000000..8afcdd8
--- /dev/null
@@ -0,0 +1,71 @@
+From 866c7390ddc8b54a303c266e9196c822b448a7bf 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 3a56434c86bd9..c0530d4aa3fc3 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -12029,6 +12029,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[] = {
+@@ -12475,10 +12476,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.9/alsa-ump-set-default-protocol-when-not-given-explici.patch b/queue-6.9/alsa-ump-set-default-protocol-when-not-given-explici.patch
new file mode 100644 (file)
index 0000000..6833a54
--- /dev/null
@@ -0,0 +1,47 @@
+From 8951afd254dfdf337aabc9e75b658f5d5248a9ab 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 117c7ecc48563..3f61220c23b4e 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.9/block-check-for-max_hw_sectors-underflow.patch b/queue-6.9/block-check-for-max_hw_sectors-underflow.patch
new file mode 100644 (file)
index 0000000..f736c2e
--- /dev/null
@@ -0,0 +1,58 @@
+From db937708a6ff1544b8278c9f079f922f79dfdec8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 May 2024 12:46:51 +0200
+Subject: block: check for max_hw_sectors underflow
+
+From: Hannes Reinecke <hare@kernel.org>
+
+[ Upstream commit e993db2d6e5207f1ae061c2ac554ab1f714c741d ]
+
+The logical block size need to be smaller than the max_hw_sector
+setting, otherwise we can't even transfer a single LBA.
+
+Signed-off-by: Hannes Reinecke <hare@kernel.org>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: John Garry <john.g.garry@oracle.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ block/blk-settings.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/block/blk-settings.c b/block/blk-settings.c
+index 15319b217bf3f..4bd7cbab4c241 100644
+--- a/block/blk-settings.c
++++ b/block/blk-settings.c
+@@ -104,6 +104,7 @@ static int blk_validate_zoned_limits(struct queue_limits *lim)
+ static int blk_validate_limits(struct queue_limits *lim)
+ {
+       unsigned int max_hw_sectors;
++      unsigned int logical_block_sectors;
+       /*
+        * Unless otherwise specified, default to 512 byte logical blocks and a
+@@ -134,8 +135,11 @@ static int blk_validate_limits(struct queue_limits *lim)
+               lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
+       if (WARN_ON_ONCE(lim->max_hw_sectors < PAGE_SECTORS))
+               return -EINVAL;
++      logical_block_sectors = lim->logical_block_size >> SECTOR_SHIFT;
++      if (WARN_ON_ONCE(logical_block_sectors > lim->max_hw_sectors))
++              return -EINVAL;
+       lim->max_hw_sectors = round_down(lim->max_hw_sectors,
+-                      lim->logical_block_size >> SECTOR_SHIFT);
++                      logical_block_sectors);
+       /*
+        * The actual max_sectors value is a complex beast and also takes the
+@@ -153,7 +157,7 @@ static int blk_validate_limits(struct queue_limits *lim)
+               lim->max_sectors = min(max_hw_sectors, BLK_DEF_MAX_SECTORS_CAP);
+       }
+       lim->max_sectors = round_down(lim->max_sectors,
+-                      lim->logical_block_size >> SECTOR_SHIFT);
++                      logical_block_sectors);
+       /*
+        * Random default for the maximum number of segments.  Driver should not
+-- 
+2.43.0
+
diff --git a/queue-6.9/clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch b/queue-6.9/clk-mediatek-mt8183-only-enable-runtime-pm-on-mt8183.patch
new file mode 100644 (file)
index 0000000..15687de
--- /dev/null
@@ -0,0 +1,113 @@
+From 6a759e4b0e7a901cd9dc2f5de0761d19fe169fca 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.9/clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch b/queue-6.9/clk-qcom-clk-alpha-pll-set-alpha_en-bit-for-stromer-.patch
new file mode 100644 (file)
index 0000000..60d506e
--- /dev/null
@@ -0,0 +1,44 @@
+From e412cb0d807fe5ead4623fa6b4b491840c2dadb5 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 be18ff983d35c..003308a288968 100644
+--- a/drivers/clk/qcom/clk-alpha-pll.c
++++ b/drivers/clk/qcom/clk-alpha-pll.c
+@@ -2555,6 +2555,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.9/clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch b/queue-6.9/clk-qcom-gcc-sm6350-fix-gpll6-gpll7-parents.patch
new file mode 100644 (file)
index 0000000..8cbc02f
--- /dev/null
@@ -0,0 +1,77 @@
+From 22bcb1f63e52fab1f18ce54765771fda507e52b1 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.9/connector-fix-invalid-conversion-in-cn_proc.h.patch b/queue-6.9/connector-fix-invalid-conversion-in-cn_proc.h.patch
new file mode 100644 (file)
index 0000000..f026240
--- /dev/null
@@ -0,0 +1,43 @@
+From d3cdb8ee0da3411a7ff25ffaeb2aba2462924db8 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.9/dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch b/queue-6.9/dma-mapping-benchmark-avoid-needless-copy_to_user-if.patch
new file mode 100644 (file)
index 0000000..95677c1
--- /dev/null
@@ -0,0 +1,39 @@
+From 799b4059bc788e9d05ef77097571824457c46a06 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.9/drm-amdgpu-correct-hbm-field-in-boot-status.patch b/queue-6.9/drm-amdgpu-correct-hbm-field-in-boot-status.patch
new file mode 100644 (file)
index 0000000..0c9a92a
--- /dev/null
@@ -0,0 +1,35 @@
+From 2d9084cb211737939aa958b33218c53a1a31e72b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 May 2024 15:03:02 +0800
+Subject: drm/amdgpu: correct hbm field in boot status
+
+From: Hawking Zhang <Hawking.Zhang@amd.com>
+
+[ Upstream commit ec58991054e899c9d86f7e3c8a96cb602d4b5938 ]
+
+hbm filed takes bit 13 and bit 14 in boot status.
+
+Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
+Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+index e0f8ce9d84406..db9cb2b4e9823 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+@@ -43,7 +43,7 @@ struct amdgpu_iv_entry;
+ #define AMDGPU_RAS_GPU_ERR_HBM_BIST_TEST(x)           AMDGPU_GET_REG_FIELD(x, 7, 7)
+ #define AMDGPU_RAS_GPU_ERR_SOCKET_ID(x)                       AMDGPU_GET_REG_FIELD(x, 10, 8)
+ #define AMDGPU_RAS_GPU_ERR_AID_ID(x)                  AMDGPU_GET_REG_FIELD(x, 12, 11)
+-#define AMDGPU_RAS_GPU_ERR_HBM_ID(x)                  AMDGPU_GET_REG_FIELD(x, 13, 13)
++#define AMDGPU_RAS_GPU_ERR_HBM_ID(x)                  AMDGPU_GET_REG_FIELD(x, 14, 13)
+ #define AMDGPU_RAS_GPU_ERR_BOOT_STATUS(x)             AMDGPU_GET_REG_FIELD(x, 31, 31)
+ #define AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT  1000
+-- 
+2.43.0
+
diff --git a/queue-6.9/drm-amdgpu-silence-ubsan-warning.patch b/queue-6.9/drm-amdgpu-silence-ubsan-warning.patch
new file mode 100644 (file)
index 0000000..57c83d4
--- /dev/null
@@ -0,0 +1,37 @@
+From 7a4ff21d8137b24a425ed7fadabef3d443e5bba1 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 a34f064df336b..09cbc3afd6d89 100644
+--- a/drivers/gpu/drm/amd/include/atomfirmware.h
++++ b/drivers/gpu/drm/amd/include/atomfirmware.h
+@@ -3583,7 +3583,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.9/drm-amdkfd-let-vram-allocations-go-to-gtt-domain-on-.patch b/queue-6.9/drm-amdkfd-let-vram-allocations-go-to-gtt-domain-on-.patch
new file mode 100644 (file)
index 0000000..8a93ae9
--- /dev/null
@@ -0,0 +1,199 @@
+From 5532c4d6f544967833efb1c16c60cb2afd1f44fc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 26 Apr 2024 14:56:35 +0800
+Subject: drm/amdkfd: Let VRAM allocations go to GTT domain on small APUs
+
+From: Lang Yu <Lang.Yu@amd.com>
+
+[ Upstream commit eb853413d02c8d9b27942429b261a9eef228f005 ]
+
+Small APUs(i.e., consumer, embedded products) usually have a small
+carveout device memory which can't satisfy most compute workloads
+memory allocation requirements.
+
+We can't even run a Basic MNIST Example with a default 512MB carveout.
+https://github.com/pytorch/examples/tree/main/mnist. Error Log:
+
+"torch.cuda.OutOfMemoryError: HIP out of memory. Tried to allocate
+84.00 MiB. GPU 0 has a total capacity of 512.00 MiB of which 0 bytes
+is free. Of the allocated memory 103.83 MiB is allocated by PyTorch,
+and 22.17 MiB is reserved by PyTorch but unallocated"
+
+Though we can change BIOS settings to enlarge carveout size,
+which is inflexible and may bring complaint. On the other hand,
+the memory resource can't be effectively used between host and device.
+
+The solution is MI300A approach, i.e., let VRAM allocations go to GTT.
+Then device and host can flexibly and effectively share memory resource.
+
+v2: Report local_mem_size_private as 0. (Felix)
+
+Signed-off-by: Lang Yu <Lang.Yu@amd.com>
+Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c    |  5 +++++
+ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  | 20 ++++++++++---------
+ drivers/gpu/drm/amd/amdkfd/kfd_migrate.c      |  2 +-
+ drivers/gpu/drm/amd/amdkfd/kfd_svm.c          |  6 ++++--
+ drivers/gpu/drm/amd/amdkfd/kfd_svm.h          |  3 ++-
+ 5 files changed, 23 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+index 35dd6effa9a34..7291c3fd8cf70 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+@@ -455,6 +455,9 @@ void amdgpu_amdkfd_get_local_mem_info(struct amdgpu_device *adev,
+               else
+                       mem_info->local_mem_size_private =
+                                       KFD_XCP_MEMORY_SIZE(adev, xcp->id);
++      } else if (adev->flags & AMD_IS_APU) {
++              mem_info->local_mem_size_public = (ttm_tt_pages_limit() << PAGE_SHIFT);
++              mem_info->local_mem_size_private = 0;
+       } else {
+               mem_info->local_mem_size_public = adev->gmc.visible_vram_size;
+               mem_info->local_mem_size_private = adev->gmc.real_vram_size -
+@@ -809,6 +812,8 @@ u64 amdgpu_amdkfd_xcp_memory_size(struct amdgpu_device *adev, int xcp_id)
+               }
+               do_div(tmp, adev->xcp_mgr->num_xcp_per_mem_partition);
+               return ALIGN_DOWN(tmp, PAGE_SIZE);
++      } else if (adev->flags & AMD_IS_APU) {
++              return (ttm_tt_pages_limit() << PAGE_SHIFT);
+       } else {
+               return adev->gmc.real_vram_size;
+       }
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index 0535b07987d9d..8975cf41a91ac 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -196,7 +196,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
+                       return -EINVAL;
+               vram_size = KFD_XCP_MEMORY_SIZE(adev, xcp_id);
+-              if (adev->gmc.is_app_apu) {
++              if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
+                       system_mem_needed = size;
+                       ttm_mem_needed = size;
+               }
+@@ -232,7 +232,8 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
+                 "adev reference can't be null when vram is used");
+       if (adev && xcp_id >= 0) {
+               adev->kfd.vram_used[xcp_id] += vram_needed;
+-              adev->kfd.vram_used_aligned[xcp_id] += adev->gmc.is_app_apu ?
++              adev->kfd.vram_used_aligned[xcp_id] +=
++                              (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
+                               vram_needed :
+                               ALIGN(vram_needed, VRAM_AVAILABLITY_ALIGN);
+       }
+@@ -260,7 +261,7 @@ void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
+               if (adev) {
+                       adev->kfd.vram_used[xcp_id] -= size;
+-                      if (adev->gmc.is_app_apu) {
++                      if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
+                               adev->kfd.vram_used_aligned[xcp_id] -= size;
+                               kfd_mem_limit.system_mem_used -= size;
+                               kfd_mem_limit.ttm_mem_used -= size;
+@@ -889,7 +890,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
+        * if peer device has large BAR. In contrast, access over xGMI is
+        * allowed for both small and large BAR configurations of peer device
+        */
+-      if ((adev != bo_adev && !adev->gmc.is_app_apu) &&
++      if ((adev != bo_adev && !(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU)) &&
+           ((mem->domain == AMDGPU_GEM_DOMAIN_VRAM) ||
+            (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) ||
+            (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_MMIO_REMAP))) {
+@@ -1657,7 +1658,7 @@ size_t amdgpu_amdkfd_get_available_memory(struct amdgpu_device *adev,
+               - atomic64_read(&adev->vram_pin_size)
+               - reserved_for_pt;
+-      if (adev->gmc.is_app_apu) {
++      if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
+               system_mem_available = no_system_mem_limit ?
+                                       kfd_mem_limit.max_system_mem_limit :
+                                       kfd_mem_limit.max_system_mem_limit -
+@@ -1705,7 +1706,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+       if (flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
+               domain = alloc_domain = AMDGPU_GEM_DOMAIN_VRAM;
+-              if (adev->gmc.is_app_apu) {
++              if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
+                       domain = AMDGPU_GEM_DOMAIN_GTT;
+                       alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
+                       alloc_flags = 0;
+@@ -1952,7 +1953,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
+       if (size) {
+               if (!is_imported &&
+                  (mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM ||
+-                 (adev->gmc.is_app_apu &&
++                 ((adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) &&
+                   mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT)))
+                       *size = bo_size;
+               else
+@@ -2374,8 +2375,9 @@ static int import_obj_create(struct amdgpu_device *adev,
+       (*mem)->dmabuf = dma_buf;
+       (*mem)->bo = bo;
+       (*mem)->va = va;
+-      (*mem)->domain = (bo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) && !adev->gmc.is_app_apu ?
+-              AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
++      (*mem)->domain = (bo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) &&
++                       !(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
++                       AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
+       (*mem)->mapped_to_gpu_memory = 0;
+       (*mem)->process_info = avm->process_info;
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+index 5c8d81bfce7ab..ba651d12f1fa0 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+@@ -1023,7 +1023,7 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
+       if (amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(9, 0, 1))
+               return -EINVAL;
+-      if (adev->gmc.is_app_apu)
++      if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU)
+               return 0;
+       pgmap = &kfddev->pgmap;
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+index 386875e6eb96b..069b81eeea03c 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+@@ -2619,7 +2619,8 @@ svm_range_best_restore_location(struct svm_range *prange,
+               return -1;
+       }
+-      if (node->adev->gmc.is_app_apu)
++      if (node->adev->gmc.is_app_apu ||
++          node->adev->flags & AMD_IS_APU)
+               return 0;
+       if (prange->preferred_loc == gpuid ||
+@@ -3337,7 +3338,8 @@ svm_range_best_prefetch_location(struct svm_range *prange)
+               goto out;
+       }
+-      if (bo_node->adev->gmc.is_app_apu) {
++      if (bo_node->adev->gmc.is_app_apu ||
++          bo_node->adev->flags & AMD_IS_APU) {
+               best_loc = 0;
+               goto out;
+       }
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
+index 026863a0abcd3..9c37bd0567efa 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
+@@ -201,7 +201,8 @@ void svm_range_list_lock_and_flush_work(struct svm_range_list *svms, struct mm_s
+  * is initialized to not 0 when page migration register device memory.
+  */
+ #define KFD_IS_SVM_API_SUPPORTED(adev) ((adev)->kfd.pgmap.type != 0 ||\
+-                                      (adev)->gmc.is_app_apu)
++                                      (adev)->gmc.is_app_apu ||\
++                                      ((adev)->flags & AMD_IS_APU))
+ void svm_range_bo_unref_async(struct svm_range_bo *svm_bo);
+-- 
+2.43.0
+
diff --git a/queue-6.9/fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch b/queue-6.9/fs-ntfs3-mark-volume-as-dirty-if-xattr-is-broken.patch
new file mode 100644 (file)
index 0000000..79285f6
--- /dev/null
@@ -0,0 +1,38 @@
+From 1ff97b5e9b994f9834924086f0f2ce004766da62 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 53e7d1fa036aa..73785dece7a7f 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.9/hwmon-dell-smm-add-dell-g15-5511-to-fan-control-whit.patch b/queue-6.9/hwmon-dell-smm-add-dell-g15-5511-to-fan-control-whit.patch
new file mode 100644 (file)
index 0000000..d22c853
--- /dev/null
@@ -0,0 +1,47 @@
+From eb84654c6e511491ab9ac2fb23b1ed2919fe1fb0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 May 2024 23:08:09 +0200
+Subject: hwmon: (dell-smm) Add Dell G15 5511 to fan control whitelist
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Armin Wolf <W_Armin@gmx.de>
+
+[ Upstream commit fa0bc8f297b29126b5ae983406e9bc76d48a9a8e ]
+
+A user reported that he needs to disable BIOS fan control on his
+Dell G15 5511 in order to be able to control the fans.
+
+Closes: https://github.com/Wer-Wolf/i8kutils/issues/5
+Signed-off-by: Armin Wolf <W_Armin@gmx.de>
+Acked-by: Pali Rohár <pali@kernel.org>
+Link: https://lore.kernel.org/r/20240522210809.294488-1-W_Armin@gmx.de
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/dell-smm-hwmon.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
+index efcf78673e747..b6a995c852ab4 100644
+--- a/drivers/hwmon/dell-smm-hwmon.c
++++ b/drivers/hwmon/dell-smm-hwmon.c
+@@ -1530,6 +1530,14 @@ static const struct dmi_system_id i8k_whitelist_fan_control[] __initconst = {
+               },
+               .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_30A3_31A3],
+       },
++      {
++              .ident = "Dell G15 5511",
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++                      DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"),
++              },
++              .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_30A3_31A3],
++      },
+       { }
+ };
+-- 
+2.43.0
+
diff --git a/queue-6.9/i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch b/queue-6.9/i2c-pnx-fix-potential-deadlock-warning-from-del_time.patch
new file mode 100644 (file)
index 0000000..2062db6
--- /dev/null
@@ -0,0 +1,185 @@
+From d572e0fc37c11526436cf4f46c9f28b4a6f29d54 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.9/kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch b/queue-6.9/kbuild-fix-short-log-for-as-in-link-vmlinux.sh.patch
new file mode 100644 (file)
index 0000000..99684fa
--- /dev/null
@@ -0,0 +1,59 @@
+From e9770521752b961cd0e4276eed0fc52fef904665 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.9/libbpf-detect-broken-pid-filtering-logic-for-multi-u.patch b/queue-6.9/libbpf-detect-broken-pid-filtering-logic-for-multi-u.patch
new file mode 100644 (file)
index 0000000..04d91b1
--- /dev/null
@@ -0,0 +1,101 @@
+From cb17ed4e46cc33591249bb8a2002e900e27013aa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 May 2024 09:33:59 -0700
+Subject: libbpf: detect broken PID filtering logic for multi-uprobe
+
+From: Andrii Nakryiko <andrii@kernel.org>
+
+[ Upstream commit 04d939a2ab229a3821f04fc81f7c027842f501f1 ]
+
+Libbpf is automatically (and transparently to user) detecting
+multi-uprobe support in the kernel, and, if supported, uses
+multi-uprobes to improve USDT attachment speed.
+
+USDTs can be attached system-wide or for the specific process by PID. In
+the latter case, we rely on correct kernel logic of not triggering USDT
+for unrelated processes.
+
+As such, on older kernels that do support multi-uprobes, but still have
+broken PID filtering logic, we need to fall back to singular uprobes.
+
+Unfortunately, whether user is using PID filtering or not is known at
+the attachment time, which happens after relevant BPF programs were
+loaded into the kernel. Also unfortunately, we need to make a call
+whether to use multi-uprobes or singular uprobe for SEC("usdt") programs
+during BPF object load time, at which point we have no information about
+possible PID filtering.
+
+The distinction between single and multi-uprobes is small, but important
+for the kernel. Multi-uprobes get BPF_TRACE_UPROBE_MULTI attach type,
+and kernel internally substitiute different implementation of some of
+BPF helpers (e.g., bpf_get_attach_cookie()) depending on whether uprobe
+is multi or singular. So, multi-uprobes and singular uprobes cannot be
+intermixed.
+
+All the above implies that we have to make an early and conservative
+call about the use of multi-uprobes. And so this patch modifies libbpf's
+existing feature detector for multi-uprobe support to also check correct
+PID filtering. If PID filtering is not yet fixed, we fall back to
+singular uprobes for USDTs.
+
+This extension to feature detection is simple thanks to kernel's -EINVAL
+addition for pid < 0.
+
+Acked-by: Jiri Olsa <jolsa@kernel.org>
+Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
+Link: https://lore.kernel.org/r/20240521163401.3005045-4-andrii@kernel.org
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/lib/bpf/features.c | 31 ++++++++++++++++++++++++++++++-
+ 1 file changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/tools/lib/bpf/features.c b/tools/lib/bpf/features.c
+index a336786a22a38..3df0125ed5fa7 100644
+--- a/tools/lib/bpf/features.c
++++ b/tools/lib/bpf/features.c
+@@ -392,11 +392,40 @@ static int probe_uprobe_multi_link(int token_fd)
+       link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts);
+       err = -errno; /* close() can clobber errno */
++      if (link_fd >= 0 || err != -EBADF) {
++              close(link_fd);
++              close(prog_fd);
++              return 0;
++      }
++
++      /* Initial multi-uprobe support in kernel didn't handle PID filtering
++       * correctly (it was doing thread filtering, not process filtering).
++       * So now we'll detect if PID filtering logic was fixed, and, if not,
++       * we'll pretend multi-uprobes are not supported, if not.
++       * Multi-uprobes are used in USDT attachment logic, and we need to be
++       * conservative here, because multi-uprobe selection happens early at
++       * load time, while the use of PID filtering is known late at
++       * attachment time, at which point it's too late to undo multi-uprobe
++       * selection.
++       *
++       * Creating uprobe with pid == -1 for (invalid) '/' binary will fail
++       * early with -EINVAL on kernels with fixed PID filtering logic;
++       * otherwise -ESRCH would be returned if passed correct binary path
++       * (but we'll just get -BADF, of course).
++       */
++      link_opts.uprobe_multi.pid = -1; /* invalid PID */
++      link_opts.uprobe_multi.path = "/"; /* invalid path */
++      link_opts.uprobe_multi.offsets = &offset;
++      link_opts.uprobe_multi.cnt = 1;
++
++      link_fd = bpf_link_create(prog_fd, -1, BPF_TRACE_UPROBE_MULTI, &link_opts);
++      err = -errno; /* close() can clobber errno */
++
+       if (link_fd >= 0)
+               close(link_fd);
+       close(prog_fd);
+-      return link_fd < 0 && err == -EBADF;
++      return link_fd < 0 && err == -EINVAL;
+ }
+ static int probe_kern_bpf_cookie(int token_fd)
+-- 
+2.43.0
+
diff --git a/queue-6.9/nfc-nci-add-the-inconsistency-check-between-the-inpu.patch b/queue-6.9/nfc-nci-add-the-inconsistency-check-between-the-inpu.patch
new file mode 100644 (file)
index 0000000..733a04d
--- /dev/null
@@ -0,0 +1,45 @@
+From 4beae712b85b17546abfec97ab16e8bf6388c2c8 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.9/null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch b/queue-6.9/null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch
new file mode 100644 (file)
index 0000000..d8bb2df
--- /dev/null
@@ -0,0 +1,56 @@
+From 1f8f09cf81ee386914f405528b55fee09c11c44d 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 27928deccc643..74d0418ddac78 100644
+--- a/drivers/block/null_blk/zoned.c
++++ b/drivers/block/null_blk/zoned.c
+@@ -84,6 +84,17 @@ int null_init_zoned_dev(struct nullb_device *dev,
+               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.9/nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch b/queue-6.9/nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch
new file mode 100644 (file)
index 0000000..84654f8
--- /dev/null
@@ -0,0 +1,45 @@
+From 47ed3e819c015db521c384490ad623bf3dec536d 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 710043086dffa..102a9fb0c65ff 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.9/nvme-multipath-find-numa-path-only-for-online-numa-n.patch b/queue-6.9/nvme-multipath-find-numa-path-only-for-online-numa-n.patch
new file mode 100644 (file)
index 0000000..bfcc47a
--- /dev/null
@@ -0,0 +1,54 @@
+From d4d5946c62aefef7f2c15b5a3dd84c21e0cc34fa 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 a4e46eb20be63..1bee176fd850e 100644
+--- a/drivers/nvme/host/multipath.c
++++ b/drivers/nvme/host/multipath.c
+@@ -596,7 +596,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.9/nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch b/queue-6.9/nvmet-fix-a-possible-leak-when-destroy-a-ctrl-during.patch
new file mode 100644 (file)
index 0000000..1fd1005
--- /dev/null
@@ -0,0 +1,63 @@
+From 64549b91ee8f8294ae061ea9240fab14a205c37c 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 2fde22323622e..06f0c587f3437 100644
+--- a/drivers/nvme/target/core.c
++++ b/drivers/nvme/target/core.c
+@@ -818,6 +818,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.9/platform-x86-touchscreen_dmi-add-info-for-globalspac.patch b/queue-6.9/platform-x86-touchscreen_dmi-add-info-for-globalspac.patch
new file mode 100644 (file)
index 0000000..7281a93
--- /dev/null
@@ -0,0 +1,69 @@
+From 78753635c0fced3a4e4a706851f5eb19ba3cfff5 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 c6a10ec2c83f6..88bd117f0bf56 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -897,6 +897,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),
+@@ -1624,6 +1640,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.9/platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch b/queue-6.9/platform-x86-touchscreen_dmi-add-info-for-the-ezpad-.patch
new file mode 100644 (file)
index 0000000..5a089c1
--- /dev/null
@@ -0,0 +1,46 @@
+From 372fe783a68aa063f4cb8999d7b7512be583c3b2 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 88bd117f0bf56..89e1be0815b52 100644
+--- a/drivers/platform/x86/touchscreen_dmi.c
++++ b/drivers/platform/x86/touchscreen_dmi.c
+@@ -1401,6 +1401,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.9/regmap-i2c-subtract-reg-size-from-max_write.patch b/queue-6.9/regmap-i2c-subtract-reg-size-from-max_write.patch
new file mode 100644 (file)
index 0000000..401bb51
--- /dev/null
@@ -0,0 +1,46 @@
+From a99c5e848be74992257a188da42e97b14f3c72af 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 174b7a3839027f03f7fee6602b0364c98ffbcfa1..21b4ee8bbe498ee780216902f64a052ec2d6badc 100644 (file)
@@ -167,3 +167,30 @@ bnx2x-fix-multiple-ubsan-array-index-out-of-bounds.patch
 s390-dasd-fix-invalid-dereferencing-of-indirect-ccw-data-pointer.patch
 selftests-harness-fix-tests-timeout-and-race-condition.patch
 arm64-dts-rockchip-fix-the-dcdc_reg2-minimum-voltage-on-quartz64-model-b.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
+drm-amdkfd-let-vram-allocations-go-to-gtt-domain-on-.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
+drm-amdgpu-correct-hbm-field-in-boot-status.patch
+connector-fix-invalid-conversion-in-cn_proc.h.patch
+swap-yield-device-immediately.patch
+nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch
+libbpf-detect-broken-pid-filtering-logic-for-multi-u.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
+block-check-for-max_hw_sectors-underflow.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
+hwmon-dell-smm-add-dell-g15-5511-to-fan-control-whit.patch
+null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch
diff --git a/queue-6.9/spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch b/queue-6.9/spi-cadence-ensure-data-lines-set-to-low-during-dumm.patch
new file mode 100644 (file)
index 0000000..cfb1b51
--- /dev/null
@@ -0,0 +1,102 @@
+From d9ad8f83a690be487a82ad47141bf6311954317c 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 8648b8eb080dc..cdce2e280f663 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.9/swap-yield-device-immediately.patch b/queue-6.9/swap-yield-device-immediately.patch
new file mode 100644 (file)
index 0000000..150819f
--- /dev/null
@@ -0,0 +1,36 @@
+From 1721c28b6af2f8dad6e1cf51ec79125edcae83c2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 May 2024 21:00:44 +0200
+Subject: swap: yield device immediately
+
+From: Christian Brauner <brauner@kernel.org>
+
+[ Upstream commit 712182b67e831912f90259102ae334089e7bccd1 ]
+
+Otherwise we can cause spurious EBUSY issues when trying to mount the
+rootfs later on.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=218845
+Reported-by: Petri Kaukasoina <petri.kaukasoina@tuni.fi>
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/power/swap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/power/swap.c b/kernel/power/swap.c
+index 5bc04bfe2db1d..c6f24d17866d8 100644
+--- a/kernel/power/swap.c
++++ b/kernel/power/swap.c
+@@ -1600,7 +1600,7 @@ int swsusp_check(bool exclusive)
+ put:
+               if (error)
+-                      fput(hib_resume_bdev_file);
++                      bdev_fput(hib_resume_bdev_file);
+               else
+                       pr_debug("Image signature found, resuming\n");
+       } else {
+-- 
+2.43.0
+
diff --git a/queue-6.9/vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch b/queue-6.9/vhost-scsi-handle-vhost_vq_work_queue-failures-for-e.patch
new file mode 100644 (file)
index 0000000..2ce7812
--- /dev/null
@@ -0,0 +1,81 @@
+From 89c97a3d4818b4f0bd5b7afe195fc87e601cc540 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 282aac45c6909..f34f9895b8984 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
+