]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Sat, 17 Jun 2023 00:33:41 +0000 (20:33 -0400)
committerSasha Levin <sashal@kernel.org>
Sat, 17 Jun 2023 00:33:41 +0000 (20:33 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
18 files changed:
queue-5.4/arm-dts-vexpress-add-missing-cache-properties.patch [new file with mode: 0644]
queue-5.4/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch [new file with mode: 0644]
queue-5.4/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch [new file with mode: 0644]
queue-5.4/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch [new file with mode: 0644]
queue-5.4/mips-alchemy-fix-dbdma2.patch [new file with mode: 0644]
queue-5.4/mips-move-initrd_start-check-after-initrd-address-sa.patch [new file with mode: 0644]
queue-5.4/mips-restore-au1300-support.patch [new file with mode: 0644]
queue-5.4/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch [new file with mode: 0644]
queue-5.4/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch [new file with mode: 0644]
queue-5.4/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch [new file with mode: 0644]
queue-5.4/power-supply-ab8500-fix-external_power_changed-race.patch [new file with mode: 0644]
queue-5.4/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch [new file with mode: 0644]
queue-5.4/power-supply-fix-logic-checking-if-system-is-running.patch [new file with mode: 0644]
queue-5.4/power-supply-ratelimit-no-data-debug-output.patch [new file with mode: 0644]
queue-5.4/power-supply-sc27xx-fix-external_power_changed-race.patch [new file with mode: 0644]
queue-5.4/regulator-fix-error-checking-for-debugfs_create_dir.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/xen-blkfront-only-check-req_fua-for-writes.patch [new file with mode: 0644]

diff --git a/queue-5.4/arm-dts-vexpress-add-missing-cache-properties.patch b/queue-5.4/arm-dts-vexpress-add-missing-cache-properties.patch
new file mode 100644 (file)
index 0000000..0f6e976
--- /dev/null
@@ -0,0 +1,37 @@
+From c6ed20068e36c04a7556035f58263a3e801bd53e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 23 Apr 2023 17:08:37 +0200
+Subject: ARM: dts: vexpress: add missing cache properties
+
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+[ Upstream commit 328acc5657c6197753238d7ce0a6924ead829347 ]
+
+As all level 2 and level 3 caches are unified, add required
+cache-unified property to fix warnings like:
+
+  vexpress-v2p-ca5s.dtb: cache-controller@2c0f0000: 'cache-unified' is a required property
+
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Link: https://lore.kernel.org/r/20230423150837.118466-1-krzysztof.kozlowski@linaro.org
+Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/boot/dts/vexpress-v2p-ca5s.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
+index d5b47d526f9ef..7f1edc3ba6a1e 100644
+--- a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
++++ b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
+@@ -132,6 +132,7 @@ L2: cache-controller@2c0f0000 {
+               reg = <0x2c0f0000 0x1000>;
+               interrupts = <0 84 4>;
+               cache-level = <2>;
++              cache-unified;
+       };
+       pmu {
+-- 
+2.39.2
+
diff --git a/queue-5.4/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch b/queue-5.4/btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch
new file mode 100644 (file)
index 0000000..fc47f1d
--- /dev/null
@@ -0,0 +1,48 @@
+From c10bc11234c7c955f8336cbc80bb339ee8266533 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 4 May 2023 13:58:13 +0200
+Subject: btrfs: handle memory allocation failure in btrfs_csum_one_bio
+
+From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
+
+[ Upstream commit 806570c0bb7b4847828c22c4934fcf2dc8fc572f ]
+
+Since f8a53bb58ec7 ("btrfs: handle checksum generation in the storage
+layer") the failures of btrfs_csum_one_bio() are handled via
+bio_end_io().
+
+This means, we can return BLK_STS_RESOURCE from btrfs_csum_one_bio() in
+case the allocation of the ordered sums fails.
+
+This also fixes a syzkaller report, where injecting a failure into the
+kvzalloc() call results in a BUG_ON().
+
+Reported-by: syzbot+d8941552e21eac774778@syzkaller.appspotmail.com
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Anand Jain <anand.jain@oracle.com>
+Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/file-item.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
+index 61b82c69eed50..1a7183cdfe950 100644
+--- a/fs/btrfs/file-item.c
++++ b/fs/btrfs/file-item.c
+@@ -499,7 +499,9 @@ blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
+                               sums = kvzalloc(btrfs_ordered_sum_size(fs_info,
+                                                     bytes_left), GFP_KERNEL);
+                               memalloc_nofs_restore(nofs_flag);
+-                              BUG_ON(!sums); /* -ENOMEM */
++                              if (!sums)
++                                      return BLK_STS_RESOURCE;
++
+                               sums->len = bytes_left;
+                               ordered = btrfs_lookup_ordered_extent(inode,
+                                                               offset);
+-- 
+2.39.2
+
diff --git a/queue-5.4/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch b/queue-5.4/drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch
new file mode 100644 (file)
index 0000000..15de86d
--- /dev/null
@@ -0,0 +1,59 @@
+From 895b71aed48a7ee9e465284c62999d2259e1c943 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 3 May 2023 16:15:07 -0700
+Subject: drm:amd:amdgpu: Fix missing buffer object unlock in failure path
+
+From: Sukrut Bellary <sukrut.bellary@linux.com>
+
+[ Upstream commit 60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 ]
+
+smatch warning -
+1) drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:3615 gfx_v9_0_kiq_resume()
+warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'.
+
+2) drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:6901 gfx_v10_0_kiq_resume()
+warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'.
+
+Signed-off-by: Sukrut Bellary <sukrut.bellary@linux.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++-
+ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+index 1d8739a4fbcad..a84deb3c79a30 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+@@ -3527,8 +3527,10 @@ static int gfx_v10_0_kiq_resume(struct amdgpu_device *adev)
+               return r;
+       r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
+-      if (unlikely(r != 0))
++      if (unlikely(r != 0)) {
++              amdgpu_bo_unreserve(ring->mqd_obj);
+               return r;
++      }
+       gfx_v10_0_kiq_init_queue(ring);
+       amdgpu_bo_kunmap(ring->mqd_obj);
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+index 762a407a4997a..4eba6b2d9cdec 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+@@ -3748,8 +3748,10 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev)
+               return r;
+       r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
+-      if (unlikely(r != 0))
++      if (unlikely(r != 0)) {
++              amdgpu_bo_unreserve(ring->mqd_obj);
+               return r;
++      }
+       gfx_v9_0_kiq_init_queue(ring);
+       amdgpu_bo_kunmap(ring->mqd_obj);
+-- 
+2.39.2
+
diff --git a/queue-5.4/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch b/queue-5.4/irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch
new file mode 100644 (file)
index 0000000..c01a80e
--- /dev/null
@@ -0,0 +1,42 @@
+From 64b0c05207123e8d30b395eb9cd2935a0c7ddf06 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 12 May 2023 18:45:06 +0200
+Subject: irqchip/meson-gpio: Mark OF related data as maybe unused
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+[ Upstream commit 14130211be5366a91ec07c3284c183b75d8fba17 ]
+
+The driver can be compile tested with !CONFIG_OF making certain data
+unused:
+
+  drivers/irqchip/irq-meson-gpio.c:153:34: error: ‘meson_irq_gpio_matches’ defined but not used [-Werror=unused-const-variable=]
+
+Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Link: https://lore.kernel.org/r/20230512164506.212267-1-krzysztof.kozlowski@linaro.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/irqchip/irq-meson-gpio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c
+index 829084b568fa8..ffd03d2487379 100644
+--- a/drivers/irqchip/irq-meson-gpio.c
++++ b/drivers/irqchip/irq-meson-gpio.c
+@@ -70,7 +70,7 @@ static const struct meson_gpio_irq_params sm1_params = {
+       .support_edge_both = true,
+ };
+-static const struct of_device_id meson_irq_gpio_matches[] = {
++static const struct of_device_id meson_irq_gpio_matches[] __maybe_unused = {
+       { .compatible = "amlogic,meson8-gpio-intc", .data = &meson8_params },
+       { .compatible = "amlogic,meson8b-gpio-intc", .data = &meson8b_params },
+       { .compatible = "amlogic,meson-gxbb-gpio-intc", .data = &gxbb_params },
+-- 
+2.39.2
+
diff --git a/queue-5.4/mips-alchemy-fix-dbdma2.patch b/queue-5.4/mips-alchemy-fix-dbdma2.patch
new file mode 100644 (file)
index 0000000..09ff382
--- /dev/null
@@ -0,0 +1,87 @@
+From a2cb131e3173dd92996410cffa85db5c11129ad1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 11 May 2023 17:30:10 +0200
+Subject: MIPS: Alchemy: fix dbdma2
+
+From: Manuel Lauss <manuel.lauss@gmail.com>
+
+[ Upstream commit 2d645604f69f3a772d58ead702f9a8e84ab2b342 ]
+
+Various fixes for the Au1200/Au1550/Au1300 DBDMA2 code:
+
+- skip cache invalidation if chip has working coherency circuitry.
+- invalidate KSEG0-portion of the (physical) data address.
+- force the dma channel doorbell write out to bus immediately with
+  a sync.
+
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/alchemy/common/dbdma.c | 27 +++++++++++++++------------
+ 1 file changed, 15 insertions(+), 12 deletions(-)
+
+diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
+index 4ca2c28878e0f..e9ee9ab90a0c6 100644
+--- a/arch/mips/alchemy/common/dbdma.c
++++ b/arch/mips/alchemy/common/dbdma.c
+@@ -30,6 +30,7 @@
+  *
+  */
++#include <linux/dma-map-ops.h> /* for dma_default_coherent */
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+@@ -623,17 +624,18 @@ u32 au1xxx_dbdma_put_source(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
+               dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
+       /*
+-       * There is an errata on the Au1200/Au1550 parts that could result
+-       * in "stale" data being DMA'ed. It has to do with the snoop logic on
+-       * the cache eviction buffer.  DMA_NONCOHERENT is on by default for
+-       * these parts. If it is fixed in the future, these dma_cache_inv will
+-       * just be nothing more than empty macros. See io.h.
++       * There is an erratum on certain Au1200/Au1550 revisions that could
++       * result in "stale" data being DMA'ed. It has to do with the snoop
++       * logic on the cache eviction buffer.  dma_default_coherent is set
++       * to false on these parts.
+        */
+-      dma_cache_wback_inv((unsigned long)buf, nbytes);
++      if (!dma_default_coherent)
++              dma_cache_wback_inv(KSEG0ADDR(buf), nbytes);
+       dp->dscr_cmd0 |= DSCR_CMD0_V;   /* Let it rip */
+       wmb(); /* drain writebuffer */
+       dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
+       ctp->chan_ptr->ddma_dbell = 0;
++      wmb(); /* force doorbell write out to dma engine */
+       /* Get next descriptor pointer. */
+       ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
+@@ -685,17 +687,18 @@ u32 au1xxx_dbdma_put_dest(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
+                         dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
+ #endif
+       /*
+-       * There is an errata on the Au1200/Au1550 parts that could result in
+-       * "stale" data being DMA'ed. It has to do with the snoop logic on the
+-       * cache eviction buffer.  DMA_NONCOHERENT is on by default for these
+-       * parts. If it is fixed in the future, these dma_cache_inv will just
+-       * be nothing more than empty macros. See io.h.
++       * There is an erratum on certain Au1200/Au1550 revisions that could
++       * result in "stale" data being DMA'ed. It has to do with the snoop
++       * logic on the cache eviction buffer.  dma_default_coherent is set
++       * to false on these parts.
+        */
+-      dma_cache_inv((unsigned long)buf, nbytes);
++      if (!dma_default_coherent)
++              dma_cache_inv(KSEG0ADDR(buf), nbytes);
+       dp->dscr_cmd0 |= DSCR_CMD0_V;   /* Let it rip */
+       wmb(); /* drain writebuffer */
+       dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
+       ctp->chan_ptr->ddma_dbell = 0;
++      wmb(); /* force doorbell write out to dma engine */
+       /* Get next descriptor pointer. */
+       ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
+-- 
+2.39.2
+
diff --git a/queue-5.4/mips-move-initrd_start-check-after-initrd-address-sa.patch b/queue-5.4/mips-move-initrd_start-check-after-initrd-address-sa.patch
new file mode 100644 (file)
index 0000000..b3c8c9e
--- /dev/null
@@ -0,0 +1,52 @@
+From 48740b71e841f5528e832633542b761eed5919f1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 9 May 2023 18:29:21 +0100
+Subject: mips: Move initrd_start check after initrd address sanitisation.
+
+From: Liviu Dudau <liviu@dudau.co.uk>
+
+[ Upstream commit 4897a898a216058dec55e5e5902534e6e224fcdf ]
+
+PAGE_OFFSET is technically a virtual address so when checking the value of
+initrd_start against it we should make sure that it has been sanitised from
+the values passed by the bootloader. Without this change, even with a bootloader
+that passes correct addresses for an initrd, we are failing to load it on MT7621
+boards, for example.
+
+Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/kernel/setup.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
+index 82e44b31aad59..d91b772214b5d 100644
+--- a/arch/mips/kernel/setup.c
++++ b/arch/mips/kernel/setup.c
+@@ -190,10 +190,6 @@ static unsigned long __init init_initrd(void)
+               pr_err("initrd start must be page aligned\n");
+               goto disable;
+       }
+-      if (initrd_start < PAGE_OFFSET) {
+-              pr_err("initrd start < PAGE_OFFSET\n");
+-              goto disable;
+-      }
+       /*
+        * Sanitize initrd addresses. For example firmware
+@@ -206,6 +202,11 @@ static unsigned long __init init_initrd(void)
+       initrd_end = (unsigned long)__va(end);
+       initrd_start = (unsigned long)__va(__pa(initrd_start));
++      if (initrd_start < PAGE_OFFSET) {
++              pr_err("initrd start < PAGE_OFFSET\n");
++              goto disable;
++      }
++
+       ROOT_DEV = Root_RAM0;
+       return PFN_UP(end);
+ disable:
+-- 
+2.39.2
+
diff --git a/queue-5.4/mips-restore-au1300-support.patch b/queue-5.4/mips-restore-au1300-support.patch
new file mode 100644 (file)
index 0000000..3594ba5
--- /dev/null
@@ -0,0 +1,48 @@
+From 08396271c918fbd2764ed4d8b459483c742783b0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 10 May 2023 12:33:23 +0200
+Subject: MIPS: Restore Au1300 support
+
+From: Manuel Lauss <manuel.lauss@gmail.com>
+
+[ Upstream commit f2041708dee30a3425f680265c337acd28293782 ]
+
+The Au1300, at least the one I have to test, uses the NetLogic vendor
+ID, but commit 95b8a5e0111a ("MIPS: Remove NETLOGIC support") also
+dropped Au1300 detection.  Restore Au1300 detection.
+
+Tested on DB1300 with Au1380 chip.
+
+Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/kernel/cpu-probe.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
+index f521cbf934e76..0307ff2337d5b 100644
+--- a/arch/mips/kernel/cpu-probe.c
++++ b/arch/mips/kernel/cpu-probe.c
+@@ -1763,6 +1763,10 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
+                       break;
+               }
+               break;
++      case PRID_IMP_NETLOGIC_AU13XX:
++              c->cputype = CPU_ALCHEMY;
++              __cpu_name[cpu] = "Au1300";
++              break;
+       }
+ }
+@@ -2092,6 +2096,7 @@ void cpu_probe(void)
+               cpu_probe_mips(c, cpu);
+               break;
+       case PRID_COMP_ALCHEMY:
++      case PRID_COMP_NETLOGIC:
+               cpu_probe_alchemy(c, cpu);
+               break;
+       case PRID_COMP_SIBYTE:
+-- 
+2.39.2
+
diff --git a/queue-5.4/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch b/queue-5.4/parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch
new file mode 100644 (file)
index 0000000..895746a
--- /dev/null
@@ -0,0 +1,62 @@
+From be0861ff9c9044fdc018eea1677ffc561fbde4cd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 May 2023 15:54:40 +0200
+Subject: parisc: Flush gatt writes and adjust gatt mask in
+ parisc_agp_mask_memory()
+
+From: Helge Deller <deller@gmx.de>
+
+[ Upstream commit d703797380c540bbeac03f104ebcfc364eaf47cc ]
+
+Flush caches after changing gatt entries and calculate entry according
+to SBA requirements.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/char/agp/parisc-agp.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
+index d68d05d5d3838..514f9f287a781 100644
+--- a/drivers/char/agp/parisc-agp.c
++++ b/drivers/char/agp/parisc-agp.c
+@@ -90,6 +90,9 @@ parisc_agp_tlbflush(struct agp_memory *mem)
+ {
+       struct _parisc_agp_info *info = &parisc_agp_info;
++      /* force fdc ops to be visible to IOMMU */
++      asm_io_sync();
++
+       writeq(info->gart_base | ilog2(info->gart_size), info->ioc_regs+IOC_PCOM);
+       readq(info->ioc_regs+IOC_PCOM); /* flush */
+ }
+@@ -158,6 +161,7 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
+                       info->gatt[j] =
+                               parisc_agp_mask_memory(agp_bridge,
+                                       paddr, type);
++                      asm_io_fdc(&info->gatt[j]);
+               }
+       }
+@@ -191,7 +195,16 @@ static unsigned long
+ parisc_agp_mask_memory(struct agp_bridge_data *bridge, dma_addr_t addr,
+                      int type)
+ {
+-      return SBA_PDIR_VALID_BIT | addr;
++      unsigned ci;                    /* coherent index */
++      dma_addr_t pa;
++
++      pa = addr & IOVP_MASK;
++      asm("lci 0(%1), %0" : "=r" (ci) : "r" (phys_to_virt(pa)));
++
++      pa |= (ci >> PAGE_SHIFT) & 0xff;/* move CI (8 bits) into lowest byte */
++      pa |= SBA_PDIR_VALID_BIT;       /* set "valid" bit */
++
++      return cpu_to_le64(pa);
+ }
+ static void
+-- 
+2.39.2
+
diff --git a/queue-5.4/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch b/queue-5.4/parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch
new file mode 100644 (file)
index 0000000..ea17bac
--- /dev/null
@@ -0,0 +1,59 @@
+From dce38ce6f833c071167dba40448e2c3e6686c74f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 May 2023 15:52:30 +0200
+Subject: parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu()
+
+From: Helge Deller <deller@gmx.de>
+
+[ Upstream commit 59fa12646d9f56c842b4d5b6418ed77af625c588 ]
+
+Add comment in arch_sync_dma_for_device() and handle the direction flag in
+arch_sync_dma_for_cpu().
+
+When receiving data from the device (DMA_FROM_DEVICE) unconditionally
+purge the data cache in arch_sync_dma_for_cpu().
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/parisc/kernel/pci-dma.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
+index a60d47fd4d55f..1621f678aa05b 100644
+--- a/arch/parisc/kernel/pci-dma.c
++++ b/arch/parisc/kernel/pci-dma.c
+@@ -442,13 +442,29 @@ void arch_dma_free(struct device *dev, size_t size, void *vaddr,
+ void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
+               enum dma_data_direction dir)
+ {
++      /*
++       * fdc: The data cache line is written back to memory, if and only if
++       * it is dirty, and then invalidated from the data cache.
++       */
+       flush_kernel_dcache_range((unsigned long)phys_to_virt(paddr), size);
+ }
+ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
+               enum dma_data_direction dir)
+ {
+-      flush_kernel_dcache_range((unsigned long)phys_to_virt(paddr), size);
++      unsigned long addr = (unsigned long) phys_to_virt(paddr);
++
++      switch (dir) {
++      case DMA_TO_DEVICE:
++      case DMA_BIDIRECTIONAL:
++              flush_kernel_dcache_range(addr, size);
++              return;
++      case DMA_FROM_DEVICE:
++              purge_kernel_dcache_range_asm(addr, addr + size);
++              return;
++      default:
++              BUG();
++      }
+ }
+ void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+-- 
+2.39.2
+
diff --git a/queue-5.4/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch b/queue-5.4/platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch
new file mode 100644 (file)
index 0000000..8974ccb
--- /dev/null
@@ -0,0 +1,50 @@
+From b6fa81d28c0c0a29591d1ab44ad7c668e0255e05 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 12 May 2023 13:15:17 +0300
+Subject: platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
+
+From: Alexandru Sorodoc <ealex95@gmail.com>
+
+[ Upstream commit 362c1f2ec82cb65940e1c73e15a395a7a891fc6f ]
+
+On ASUS GU604V the key 0x7B is issued when the charger is connected or
+disconnected, and key 0xC0 is issued when an external display is
+connected or disconnected.
+
+This commit maps them to KE_IGNORE to slience kernel messages about
+unknown keys, such as:
+
+    kernel: asus_wmi: Unknown key code 0x7b
+
+Signed-off-by: Alexandru Sorodoc <ealex95@gmail.com>
+Link: https://lore.kernel.org/r/20230512101517.47416-1-ealex95@gmail.com
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/asus-nb-wmi.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
+index 6424bdb33d2f0..78d357de2f040 100644
+--- a/drivers/platform/x86/asus-nb-wmi.c
++++ b/drivers/platform/x86/asus-nb-wmi.c
+@@ -555,6 +555,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
+       { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
+       { KE_IGNORE, 0x6E, },  /* Low Battery notification */
+       { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */
++      { KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */
+       { KE_KEY, 0x7c, { KEY_MICMUTE } },
+       { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
+       { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
+@@ -580,6 +581,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
+       { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+       { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */
+       { KE_KEY, 0xB5, { KEY_CALC } },
++      { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */
+       { KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
+       { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
+       { KE_IGNORE, 0xC6, },  /* Ambient Light Sensor notification */
+-- 
+2.39.2
+
diff --git a/queue-5.4/power-supply-ab8500-fix-external_power_changed-race.patch b/queue-5.4/power-supply-ab8500-fix-external_power_changed-race.patch
new file mode 100644 (file)
index 0000000..63e8363
--- /dev/null
@@ -0,0 +1,73 @@
+From b12b2e3e9d6fcfad8be74e4b4fec92ba37370d7e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Apr 2023 18:07:29 +0200
+Subject: power: supply: ab8500: Fix external_power_changed race
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit a5299ce4e96f3e8930e9c051b28d8093ada87b08 ]
+
+ab8500_btemp_external_power_changed() dereferences di->btemp_psy,
+which gets sets in ab8500_btemp_probe() like this:
+
+        di->btemp_psy = devm_power_supply_register(dev, &ab8500_btemp_desc,
+                                                   &psy_cfg);
+
+As soon as devm_power_supply_register() has called device_add()
+the external_power_changed callback can get called. So there is a window
+where ab8500_btemp_external_power_changed() may get called while
+di->btemp_psy has not been set yet leading to a NULL pointer dereference.
+
+Fixing this is easy. The external_power_changed callback gets passed
+the power_supply which will eventually get stored in di->btemp_psy,
+so ab8500_btemp_external_power_changed() can simply directly use
+the passed in psy argument which is always valid.
+
+And the same applies to ab8500_fg_external_power_changed().
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/power/supply/ab8500_btemp.c | 6 ++----
+ drivers/power/supply/ab8500_fg.c    | 6 ++----
+ 2 files changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
+index c8a22df650364..1f5cf4d7552be 100644
+--- a/drivers/power/supply/ab8500_btemp.c
++++ b/drivers/power/supply/ab8500_btemp.c
+@@ -919,10 +919,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
+  */
+ static void ab8500_btemp_external_power_changed(struct power_supply *psy)
+ {
+-      struct ab8500_btemp *di = power_supply_get_drvdata(psy);
+-
+-      class_for_each_device(power_supply_class, NULL,
+-              di->btemp_psy, ab8500_btemp_get_ext_psy_data);
++      class_for_each_device(power_supply_class, NULL, psy,
++                            ab8500_btemp_get_ext_psy_data);
+ }
+ /* ab8500 btemp driver interrupts and their respective isr */
+diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
+index 4c229e6fb750a..75df20b2fe0e4 100644
+--- a/drivers/power/supply/ab8500_fg.c
++++ b/drivers/power/supply/ab8500_fg.c
+@@ -2380,10 +2380,8 @@ static int ab8500_fg_init_hw_registers(struct ab8500_fg *di)
+  */
+ static void ab8500_fg_external_power_changed(struct power_supply *psy)
+ {
+-      struct ab8500_fg *di = power_supply_get_drvdata(psy);
+-
+-      class_for_each_device(power_supply_class, NULL,
+-              di->fg_psy, ab8500_fg_get_ext_psy_data);
++      class_for_each_device(power_supply_class, NULL, psy,
++                            ab8500_fg_get_ext_psy_data);
+ }
+ /**
+-- 
+2.39.2
+
diff --git a/queue-5.4/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch b/queue-5.4/power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch
new file mode 100644 (file)
index 0000000..43a8626
--- /dev/null
@@ -0,0 +1,40 @@
+From acc2574e369711b9e0738fc7090cbe60b28a0f4d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Apr 2023 20:23:39 +0200
+Subject: power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() +
+ schedule()
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 59dddea9879713423c7b2ade43c423bb71e0d216 ]
+
+Use mod_delayed_work() instead of separate cancel_delayed_work_sync() +
+schedule_delayed_work() calls.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/power/supply/bq27xxx_battery.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
+index ffdd646d7ebc0..e6c4dfdc58c47 100644
+--- a/drivers/power/supply/bq27xxx_battery.c
++++ b/drivers/power/supply/bq27xxx_battery.c
+@@ -886,10 +886,8 @@ static int poll_interval_param_set(const char *val, const struct kernel_param *k
+               return ret;
+       mutex_lock(&bq27xxx_list_lock);
+-      list_for_each_entry(di, &bq27xxx_battery_devices, list) {
+-              cancel_delayed_work_sync(&di->work);
+-              schedule_delayed_work(&di->work, 0);
+-      }
++      list_for_each_entry(di, &bq27xxx_battery_devices, list)
++              mod_delayed_work(system_wq, &di->work, 0);
+       mutex_unlock(&bq27xxx_list_lock);
+       return ret;
+-- 
+2.39.2
+
diff --git a/queue-5.4/power-supply-fix-logic-checking-if-system-is-running.patch b/queue-5.4/power-supply-fix-logic-checking-if-system-is-running.patch
new file mode 100644 (file)
index 0000000..500eefa
--- /dev/null
@@ -0,0 +1,66 @@
+From 6cb883ebbc1cfdc35b78ec178e09d0eacfa237f2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 May 2023 13:25:40 -0500
+Subject: power: supply: Fix logic checking if system is running from battery
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+[ Upstream commit 95339f40a8b652b5b1773def31e63fc53c26378a ]
+
+The logic used for power_supply_is_system_supplied() counts all power
+supplies and assumes that the system is running from AC if there is
+either a non-battery power-supply reporting to be online or if no
+power-supplies exist at all.
+
+The second rule is for desktop systems, that don't have any
+battery/charger devices. These systems will incorrectly report to be
+powered from battery once a device scope power-supply is registered
+(e.g. a HID device), since these power-supplies increase the counter.
+
+Apart from HID devices, recent dGPUs provide UCSI power supplies on a
+desktop systems. The dGPU by default doesn't have anything plugged in so
+it's 'offline'. This makes power_supply_is_system_supplied() return 0
+with a count of 1 meaning all drivers that use this get a wrong judgement.
+
+To fix this case adjust the logic to also examine the scope of the power
+supply. If the power supply is deemed a device power supply, then don't
+count it.
+
+Cc: Evan Quan <Evan.Quan@amd.com>
+Suggested-by: Lijo Lazar <Lijo.Lazar@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/power/supply/power_supply_core.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
+index 3fdc988595b3a..2d6836b33da33 100644
+--- a/drivers/power/supply/power_supply_core.c
++++ b/drivers/power/supply/power_supply_core.c
+@@ -347,6 +347,10 @@ static int __power_supply_is_system_supplied(struct device *dev, void *data)
+       struct power_supply *psy = dev_get_drvdata(dev);
+       unsigned int *count = data;
++      if (!psy->desc->get_property(psy, POWER_SUPPLY_PROP_SCOPE, &ret))
++              if (ret.intval == POWER_SUPPLY_SCOPE_DEVICE)
++                      return 0;
++
+       (*count)++;
+       if (psy->desc->type != POWER_SUPPLY_TYPE_BATTERY)
+               if (!psy->desc->get_property(psy, POWER_SUPPLY_PROP_ONLINE,
+@@ -365,8 +369,8 @@ int power_supply_is_system_supplied(void)
+                                     __power_supply_is_system_supplied);
+       /*
+-       * If no power class device was found at all, most probably we are
+-       * running on a desktop system, so assume we are on mains power.
++       * If no system scope power class device was found at all, most probably we
++       * are running on a desktop system, so assume we are on mains power.
+        */
+       if (count == 0)
+               return 1;
+-- 
+2.39.2
+
diff --git a/queue-5.4/power-supply-ratelimit-no-data-debug-output.patch b/queue-5.4/power-supply-ratelimit-no-data-debug-output.patch
new file mode 100644 (file)
index 0000000..8425e71
--- /dev/null
@@ -0,0 +1,43 @@
+From 1a01e76d9a8f7b685903e64153d901da6e368117 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 5 Mar 2023 21:52:26 +0100
+Subject: power: supply: Ratelimit no data debug output
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit 155c45a25679f571c2ae57d10db843a9dfc63430 ]
+
+Reduce the amount of output this dev_dbg() statement emits into logs,
+otherwise if system software polls the sysfs entry for data and keeps
+getting -ENODATA, it could end up filling the logs up.
+
+This does in fact make systemd journald choke, since during boot the
+sysfs power supply entries are polled and if journald starts at the
+same time, the journal is just being repeatedly filled up, and the
+system stops on trying to start journald without booting any further.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/power/supply/power_supply_sysfs.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
+index f37ad4eae60b9..d6c47ea27010c 100644
+--- a/drivers/power/supply/power_supply_sysfs.c
++++ b/drivers/power/supply/power_supply_sysfs.c
+@@ -127,7 +127,8 @@ static ssize_t power_supply_show_property(struct device *dev,
+               if (ret < 0) {
+                       if (ret == -ENODATA)
+-                              dev_dbg(dev, "driver has no data for `%s' property\n",
++                              dev_dbg_ratelimited(dev,
++                                      "driver has no data for `%s' property\n",
+                                       attr->attr.name);
+                       else if (ret != -ENODEV && ret != -EAGAIN)
+                               dev_err_ratelimited(dev,
+-- 
+2.39.2
+
diff --git a/queue-5.4/power-supply-sc27xx-fix-external_power_changed-race.patch b/queue-5.4/power-supply-sc27xx-fix-external_power_changed-race.patch
new file mode 100644 (file)
index 0000000..3d4d4e0
--- /dev/null
@@ -0,0 +1,70 @@
+From 59d156eae586558ab0f88ca8c5525891e74332bb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Apr 2023 18:07:32 +0200
+Subject: power: supply: sc27xx: Fix external_power_changed race
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 4d5c129d6c8993fe96e9ae712141eedcb9ca68c2 ]
+
+sc27xx_fgu_external_power_changed() dereferences data->battery,
+which gets sets in ab8500_btemp_probe() like this:
+
+       data->battery = devm_power_supply_register(dev, &sc27xx_fgu_desc,
+                                                   &fgu_cfg);
+
+As soon as devm_power_supply_register() has called device_add()
+the external_power_changed callback can get called. So there is a window
+where sc27xx_fgu_external_power_changed() may get called while
+data->battery has not been set yet leading to a NULL pointer dereference.
+
+Fixing this is easy. The external_power_changed callback gets passed
+the power_supply which will eventually get stored in data->battery,
+so sc27xx_fgu_external_power_changed() can simply directly use
+the passed in psy argument which is always valid.
+
+After this change sc27xx_fgu_external_power_changed() is reduced to just
+"power_supply_changed(psy);" and it has the same prototype. While at it
+simply replace it with making the external_power_changed callback
+directly point to power_supply_changed.
+
+Cc: Orson Zhai <orsonzhai@gmail.com>
+Cc: Chunyan Zhang <zhang.lyra@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/power/supply/sc27xx_fuel_gauge.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
+index 5e5bcdbf2e695..557b02d408134 100644
+--- a/drivers/power/supply/sc27xx_fuel_gauge.c
++++ b/drivers/power/supply/sc27xx_fuel_gauge.c
+@@ -634,13 +634,6 @@ static int sc27xx_fgu_set_property(struct power_supply *psy,
+       return ret;
+ }
+-static void sc27xx_fgu_external_power_changed(struct power_supply *psy)
+-{
+-      struct sc27xx_fgu_data *data = power_supply_get_drvdata(psy);
+-
+-      power_supply_changed(data->battery);
+-}
+-
+ static int sc27xx_fgu_property_is_writeable(struct power_supply *psy,
+                                           enum power_supply_property psp)
+ {
+@@ -671,7 +664,7 @@ static const struct power_supply_desc sc27xx_fgu_desc = {
+       .num_properties         = ARRAY_SIZE(sc27xx_fgu_props),
+       .get_property           = sc27xx_fgu_get_property,
+       .set_property           = sc27xx_fgu_set_property,
+-      .external_power_changed = sc27xx_fgu_external_power_changed,
++      .external_power_changed = power_supply_changed,
+       .property_is_writeable  = sc27xx_fgu_property_is_writeable,
+ };
+-- 
+2.39.2
+
diff --git a/queue-5.4/regulator-fix-error-checking-for-debugfs_create_dir.patch b/queue-5.4/regulator-fix-error-checking-for-debugfs_create_dir.patch
new file mode 100644 (file)
index 0000000..33f3c43
--- /dev/null
@@ -0,0 +1,46 @@
+From 4c09522712b51c37e23a2fac7ec0aafb3e128a6c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 15 May 2023 22:29:38 +0500
+Subject: regulator: Fix error checking for debugfs_create_dir
+
+From: Osama Muhammad <osmtendev@gmail.com>
+
+[ Upstream commit 2bf1c45be3b8f3a3f898d0756c1282f09719debd ]
+
+This patch fixes the error checking in core.c in debugfs_create_dir.
+The correct way to check if an error occurred is 'IS_ERR' inline function.
+
+Signed-off-by: Osama Muhammad <osmtendev@gmail.com
+Suggested-by: Ivan Orlov <ivan.orlov0322@gmail.com
+Link: https://lore.kernel.org/r/20230515172938.13338-1-osmtendev@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/regulator/core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index 06da271ad5dd3..cc9aa95d69691 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -4906,7 +4906,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
+       }
+       rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
+-      if (!rdev->debugfs) {
++      if (IS_ERR(rdev->debugfs)) {
+               rdev_warn(rdev, "Failed to create debugfs directory\n");
+               return;
+       }
+@@ -5796,7 +5796,7 @@ static int __init regulator_init(void)
+       ret = class_register(&regulator_class);
+       debugfs_root = debugfs_create_dir("regulator", NULL);
+-      if (!debugfs_root)
++      if (IS_ERR(debugfs_root))
+               pr_warn("regulator: Failed to create debugfs directory\n");
+ #ifdef CONFIG_DEBUG_FS
+-- 
+2.39.2
+
index a3aea6057e4e22cefd9b2898d13ce55aa808d2f7..91099209c4337e82541b4f05f0652dd3e5288e4e 100644 (file)
@@ -2,3 +2,20 @@ test_firmware-fix-a-memory-leak-with-reqs-buffer.patch
 keys-asymmetric-copy-sig-and-digest-in-public_key_ve.patch
 dasd-refactor-dasd_ioctl_information.patch
 s390-dasd-use-correct-lock-while-counting-channel-qu.patch
+power-supply-ab8500-fix-external_power_changed-race.patch
+power-supply-sc27xx-fix-external_power_changed-race.patch
+power-supply-bq27xxx-use-mod_delayed_work-instead-of.patch
+arm-dts-vexpress-add-missing-cache-properties.patch
+power-supply-ratelimit-no-data-debug-output.patch
+platform-x86-asus-wmi-ignore-wmi-events-with-codes-0.patch
+regulator-fix-error-checking-for-debugfs_create_dir.patch
+irqchip-meson-gpio-mark-of-related-data-as-maybe-unu.patch
+power-supply-fix-logic-checking-if-system-is-running.patch
+btrfs-handle-memory-allocation-failure-in-btrfs_csum.patch
+parisc-improve-cache-flushing-for-pcxl-in-arch_sync_.patch
+parisc-flush-gatt-writes-and-adjust-gatt-mask-in-par.patch
+mips-restore-au1300-support.patch
+mips-alchemy-fix-dbdma2.patch
+mips-move-initrd_start-check-after-initrd-address-sa.patch
+xen-blkfront-only-check-req_fua-for-writes.patch
+drm-amd-amdgpu-fix-missing-buffer-object-unlock-in-f.patch
diff --git a/queue-5.4/xen-blkfront-only-check-req_fua-for-writes.patch b/queue-5.4/xen-blkfront-only-check-req_fua-for-writes.patch
new file mode 100644 (file)
index 0000000..5b49599
--- /dev/null
@@ -0,0 +1,45 @@
+From 5bc4eb389e0647d9a1fb3769a842e2723a02b554 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 26 Apr 2023 17:40:05 +0100
+Subject: xen/blkfront: Only check REQ_FUA for writes
+
+From: Ross Lagerwall <ross.lagerwall@citrix.com>
+
+[ Upstream commit b6ebaa8100090092aa602530d7e8316816d0c98d ]
+
+The existing code silently converts read operations with the
+REQ_FUA bit set into write-barrier operations. This results in data
+loss as the backend scribbles zeroes over the data instead of returning
+it.
+
+While the REQ_FUA bit doesn't make sense on a read operation, at least
+one well-known out-of-tree kernel module does set it and since it
+results in data loss, let's be safe here and only look at REQ_FUA for
+writes.
+
+Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
+Acked-by: Juergen Gross <jgross@suse.com>
+Link: https://lore.kernel.org/r/20230426164005.2213139-1-ross.lagerwall@citrix.com
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/block/xen-blkfront.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index d0538c03f0332..da67621ebc212 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -779,7 +779,8 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
+               ring_req->u.rw.handle = info->handle;
+               ring_req->operation = rq_data_dir(req) ?
+                       BLKIF_OP_WRITE : BLKIF_OP_READ;
+-              if (req_op(req) == REQ_OP_FLUSH || req->cmd_flags & REQ_FUA) {
++              if (req_op(req) == REQ_OP_FLUSH ||
++                  (req_op(req) == REQ_OP_WRITE && (req->cmd_flags & REQ_FUA))) {
+                       /*
+                        * Ideally we can do an unordered flush-to-disk.
+                        * In case the backend onlysupports barriers, use that.
+-- 
+2.39.2
+