--- /dev/null
+From 856216b70a41ff3f8c866b627546afa01567b389 Mon Sep 17 00:00:00 2001
+From: Matt Ranostay <mranostay@ti.com>
+Date: Fri, 17 Jun 2022 08:13:04 -0700
+Subject: arm64: dts: ti: k3-j721s2: Fix overlapping GICD memory region
+
+From: Matt Ranostay <mranostay@ti.com>
+
+commit 856216b70a41ff3f8c866b627546afa01567b389 upstream.
+
+GICD region was overlapping with GICR causing the latter to not map
+successfully, and in turn the gic-v3 driver would fail to initialize.
+
+This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim
+iomem resources") replaced of_iomap() calls with of_io_request_and_map()
+that internally called request_mem_region().
+
+Respective console output before this patchset:
+
+[ 0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0
+
+Fixes: b8545f9d3a54 ("arm64: dts: ti: Add initial support for J721S2 SoC")
+Cc: linux-stable@vger.kernel.org
+Cc: Marc Zyngier <maz@kernel.org>
+Cc: Robin Murphy <robin.murphy@arm.com>
+Cc: Nishanth Menon <nm@ti.com>
+Signed-off-by: Matt Ranostay <mranostay@ti.com>
+Acked-by: Marc Zyngier <maz@kernel.org>
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Link: https://lore.kernel.org/r/20220617151304.446607-1-mranostay@ti.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
++++ b/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
+@@ -33,7 +33,7 @@
+ ranges;
+ #interrupt-cells = <3>;
+ interrupt-controller;
+- reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
++ reg = <0x00 0x01800000 0x00 0x100000>, /* GICD */
+ <0x00 0x01900000 0x00 0x100000>, /* GICR */
+ <0x00 0x6f000000 0x00 0x2000>, /* GICC */
+ <0x00 0x6f010000 0x00 0x1000>, /* GICH */
--- /dev/null
+From ada7b0c0dedafd7d059115adf49e48acba3153a8 Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Tue, 24 May 2022 11:45:17 +0400
+Subject: iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit ada7b0c0dedafd7d059115adf49e48acba3153a8 upstream.
+
+of_parse_phandle() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when not need anymore.
+Add missing of_node_put() to avoid refcount leak.
+
+Fixes: ef04070692a2 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Link: https://lore.kernel.org/r/20220524074517.45268-1-linmq006@gmail.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/adi-axi-adc.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/iio/adc/adi-axi-adc.c
++++ b/drivers/iio/adc/adi-axi-adc.c
+@@ -322,16 +322,19 @@ static struct adi_axi_adc_client *adi_ax
+
+ if (!try_module_get(cl->dev->driver->owner)) {
+ mutex_unlock(®istered_clients_lock);
++ of_node_put(cln);
+ return ERR_PTR(-ENODEV);
+ }
+
+ get_device(cl->dev);
+ cl->info = info;
+ mutex_unlock(®istered_clients_lock);
++ of_node_put(cln);
+ return cl;
+ }
+
+ mutex_unlock(®istered_clients_lock);
++ of_node_put(cln);
+
+ return ERR_PTR(-EPROBE_DEFER);
+ }
--- /dev/null
+From 048058399f19d43cf21de9f5d36cd8144337d004 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 6 May 2022 11:50:40 +0200
+Subject: iio: adc: axp288: Override TS pin bias current for some models
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 048058399f19d43cf21de9f5d36cd8144337d004 upstream.
+
+Since commit 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") we
+preserve the bias current set by the firmware at boot. This fixes issues
+we were seeing on various models.
+
+Some models like the Nuvision Solo 10 Draw tablet actually need the
+old hardcoded 80ųA bias current for battery temperature monitoring
+to work properly.
+
+Add a quirk entry for the Nuvision Solo 10 Draw to the DMI quirk table
+to restore setting the bias current to 80ųA on this model.
+
+Fixes: 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling")
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215882
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20220506095040.21008-1-hdegoede@redhat.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/axp288_adc.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/iio/adc/axp288_adc.c
++++ b/drivers/iio/adc/axp288_adc.c
+@@ -196,6 +196,14 @@ static const struct dmi_system_id axp288
+ },
+ .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
+ },
++ {
++ /* Nuvision Solo 10 Draw */
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TMAX"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "TM101W610L"),
++ },
++ .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
++ },
+ {}
+ };
+
--- /dev/null
+From d836715f588ea15f905f607c27bc693587058db4 Mon Sep 17 00:00:00 2001
+From: Jialin Zhang <zhangjialin11@huawei.com>
+Date: Tue, 17 May 2022 11:35:26 +0800
+Subject: iio: adc: rzg2l_adc: add missing fwnode_handle_put() in rzg2l_adc_parse_properties()
+
+From: Jialin Zhang <zhangjialin11@huawei.com>
+
+commit d836715f588ea15f905f607c27bc693587058db4 upstream.
+
+fwnode_handle_put() should be used when terminating
+device_for_each_child_node() iteration with break or return to prevent
+stale device node references from being left behind.
+
+Fixes: d484c21bacfa ("iio: adc: Add driver for Renesas RZ/G2L A/D converter")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com>
+Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Link: https://lore.kernel.org/r/20220517033526.2035735-1-zhangjialin11@huawei.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/rzg2l_adc.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/iio/adc/rzg2l_adc.c
++++ b/drivers/iio/adc/rzg2l_adc.c
+@@ -334,11 +334,15 @@ static int rzg2l_adc_parse_properties(st
+ i = 0;
+ device_for_each_child_node(&pdev->dev, fwnode) {
+ ret = fwnode_property_read_u32(fwnode, "reg", &channel);
+- if (ret)
++ if (ret) {
++ fwnode_handle_put(fwnode);
+ return ret;
++ }
+
+- if (channel >= RZG2L_ADC_MAX_CHANNELS)
++ if (channel >= RZG2L_ADC_MAX_CHANNELS) {
++ fwnode_handle_put(fwnode);
+ return -EINVAL;
++ }
+
+ chan_array[i].type = IIO_VOLTAGE;
+ chan_array[i].indexed = 1;
--- /dev/null
+From 47dcf770abc793f347a65a24c24d550c936f08b0 Mon Sep 17 00:00:00 2001
+From: Jialin Zhang <zhangjialin11@huawei.com>
+Date: Tue, 17 May 2022 11:30:20 +0800
+Subject: iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels()
+
+From: Jialin Zhang <zhangjialin11@huawei.com>
+
+commit 47dcf770abc793f347a65a24c24d550c936f08b0 upstream.
+
+fwnode_handle_put() should be used when terminating
+device_for_each_child_node() iteration with break or return to prevent
+stale device node references from being left behind.
+
+Fixes: d935eddd2799 ("iio: adc: Add driver for Texas Instruments ADS131E0x ADC family")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com>
+Link: https://lore.kernel.org/r/20220517033020.2033324-1-zhangjialin11@huawei.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/ti-ads131e08.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/drivers/iio/adc/ti-ads131e08.c
++++ b/drivers/iio/adc/ti-ads131e08.c
+@@ -739,7 +739,7 @@ static int ads131e08_alloc_channels(stru
+ device_for_each_child_node(dev, node) {
+ ret = fwnode_property_read_u32(node, "reg", &channel);
+ if (ret)
+- return ret;
++ goto err_child_out;
+
+ ret = fwnode_property_read_u32(node, "ti,gain", &tmp);
+ if (ret) {
+@@ -747,7 +747,7 @@ static int ads131e08_alloc_channels(stru
+ } else {
+ ret = ads131e08_pga_gain_to_field_value(st, tmp);
+ if (ret < 0)
+- return ret;
++ goto err_child_out;
+
+ channel_config[i].pga_gain = tmp;
+ }
+@@ -758,7 +758,7 @@ static int ads131e08_alloc_channels(stru
+ } else {
+ ret = ads131e08_validate_channel_mux(st, tmp);
+ if (ret)
+- return ret;
++ goto err_child_out;
+
+ channel_config[i].mux = tmp;
+ }
+@@ -784,6 +784,10 @@ static int ads131e08_alloc_channels(stru
+ st->channel_config = channel_config;
+
+ return 0;
++
++err_child_out:
++ fwnode_handle_put(node);
++ return ret;
+ }
+
+ static void ads131e08_regulator_disable(void *data)
--- /dev/null
+From 31733463372e8d88ea54bfa1e35178aad9b2ffd2 Mon Sep 17 00:00:00 2001
+From: Marcelo Tosatti <mtosatti@redhat.com>
+Date: Mon, 30 May 2022 12:51:56 -0300
+Subject: mm: lru_cache_disable: use synchronize_rcu_expedited
+
+From: Marcelo Tosatti <mtosatti@redhat.com>
+
+commit 31733463372e8d88ea54bfa1e35178aad9b2ffd2 upstream.
+
+commit ff042f4a9b050 ("mm: lru_cache_disable: replace work queue
+synchronization with synchronize_rcu") replaced lru_cache_disable's usage
+of work queues with synchronize_rcu.
+
+Some users reported large performance regressions due to this commit, for
+example:
+https://lore.kernel.org/all/20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1/T/
+
+Switching to synchronize_rcu_expedited fixes the problem.
+
+Link: https://lkml.kernel.org/r/YpToHCmnx/HEcVyR@fuller.cnet
+Fixes: ff042f4a9b050 ("mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu")
+Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
+Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
+Tested-by: Michael Larabel <Michael@MichaelLarabel.com>
+Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Cc: Nicolas Saenz Julienne <nsaenzju@redhat.com>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Minchan Kim <minchan@kernel.org>
+Cc: Matthew Wilcox <willy@infradead.org>
+Cc: Mel Gorman <mgorman@techsingularity.net>
+Cc: Juri Lelli <juri.lelli@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Paul E. McKenney <paulmck@kernel.org>
+Cc: Phil Elwell <phil@raspberrypi.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/swap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mm/swap.c b/mm/swap.c
+index f3922a96b2e9..034bb24879a3 100644
+--- a/mm/swap.c
++++ b/mm/swap.c
+@@ -881,7 +881,7 @@ void lru_cache_disable(void)
+ * lru_disable_count = 0 will have exited the critical
+ * section when synchronize_rcu() returns.
+ */
+- synchronize_rcu();
++ synchronize_rcu_expedited();
+ #ifdef CONFIG_SMP
+ __lru_add_drain_all(true);
+ #else
+--
+2.36.1
+
--- /dev/null
+From 67f22ba7750f940bcd7e1b12720896c505c2d63f Mon Sep 17 00:00:00 2001
+From: zhenwei pi <pizhenwei@bytedance.com>
+Date: Wed, 15 Jun 2022 17:32:09 +0800
+Subject: mm/memory-failure: disable unpoison once hw error happens
+
+From: zhenwei pi <pizhenwei@bytedance.com>
+
+commit 67f22ba7750f940bcd7e1b12720896c505c2d63f upstream.
+
+Currently unpoison_memory(unsigned long pfn) is designed for soft
+poison(hwpoison-inject) only. Since 17fae1294ad9d, the KPTE gets cleared
+on a x86 platform once hardware memory corrupts.
+
+Unpoisoning a hardware corrupted page puts page back buddy only, the
+kernel has a chance to access the page with *NOT PRESENT* KPTE. This
+leads BUG during accessing on the corrupted KPTE.
+
+Suggested by David&Naoya, disable unpoison mechanism when a real HW error
+happens to avoid BUG like this:
+
+ Unpoison: Software-unpoisoned page 0x61234
+ BUG: unable to handle page fault for address: ffff888061234000
+ #PF: supervisor write access in kernel mode
+ #PF: error_code(0x0002) - not-present page
+ PGD 2c01067 P4D 2c01067 PUD 107267063 PMD 10382b063 PTE 800fffff9edcb062
+ Oops: 0002 [#1] PREEMPT SMP NOPTI
+ CPU: 4 PID: 26551 Comm: stress Kdump: loaded Tainted: G M OE 5.18.0.bm.1-amd64 #7
+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ...
+ RIP: 0010:clear_page_erms+0x7/0x10
+ Code: ...
+ RSP: 0000:ffffc90001107bc8 EFLAGS: 00010246
+ RAX: 0000000000000000 RBX: 0000000000000901 RCX: 0000000000001000
+ RDX: ffffea0001848d00 RSI: ffffea0001848d40 RDI: ffff888061234000
+ RBP: ffffea0001848d00 R08: 0000000000000901 R09: 0000000000001276
+ R10: 0000000000000003 R11: 0000000000000000 R12: 0000000000000001
+ R13: 0000000000000000 R14: 0000000000140dca R15: 0000000000000001
+ FS: 00007fd8b2333740(0000) GS:ffff88813fd00000(0000) knlGS:0000000000000000
+ CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+ CR2: ffff888061234000 CR3: 00000001023d2005 CR4: 0000000000770ee0
+ DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+ DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+ PKRU: 55555554
+ Call Trace:
+ <TASK>
+ prep_new_page+0x151/0x170
+ get_page_from_freelist+0xca0/0xe20
+ ? sysvec_apic_timer_interrupt+0xab/0xc0
+ ? asm_sysvec_apic_timer_interrupt+0x1b/0x20
+ __alloc_pages+0x17e/0x340
+ __folio_alloc+0x17/0x40
+ vma_alloc_folio+0x84/0x280
+ __handle_mm_fault+0x8d4/0xeb0
+ handle_mm_fault+0xd5/0x2a0
+ do_user_addr_fault+0x1d0/0x680
+ ? kvm_read_and_reset_apf_flags+0x3b/0x50
+ exc_page_fault+0x78/0x170
+ asm_exc_page_fault+0x27/0x30
+
+Link: https://lkml.kernel.org/r/20220615093209.259374-2-pizhenwei@bytedance.com
+Fixes: 847ce401df392 ("HWPOISON: Add unpoisoning support")
+Fixes: 17fae1294ad9d ("x86/{mce,mm}: Unmap the entire page if the whole page is affected and poisoned")
+Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
+Acked-by: David Hildenbrand <david@redhat.com>
+Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
+Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
+Reviewed-by: Oscar Salvador <osalvador@suse.de>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: <stable@vger.kernel.org> [5.8+]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/vm/hwpoison.rst | 3 ++-
+ drivers/base/memory.c | 2 +-
+ include/linux/mm.h | 1 +
+ mm/hwpoison-inject.c | 2 +-
+ mm/madvise.c | 2 +-
+ mm/memory-failure.c | 12 ++++++++++++
+ 6 files changed, 18 insertions(+), 4 deletions(-)
+
+--- a/Documentation/vm/hwpoison.rst
++++ b/Documentation/vm/hwpoison.rst
+@@ -120,7 +120,8 @@ Testing
+ unpoison-pfn
+ Software-unpoison page at PFN echoed into this file. This way
+ a page can be reused again. This only works for Linux
+- injected failures, not for real memory failures.
++ injected failures, not for real memory failures. Once any hardware
++ memory failure happens, this feature is disabled.
+
+ Note these injection interfaces are not stable and might change between
+ kernel versions
+--- a/drivers/base/memory.c
++++ b/drivers/base/memory.c
+@@ -558,7 +558,7 @@ static ssize_t hard_offline_page_store(s
+ if (kstrtoull(buf, 0, &pfn) < 0)
+ return -EINVAL;
+ pfn >>= PAGE_SHIFT;
+- ret = memory_failure(pfn, 0);
++ ret = memory_failure(pfn, MF_SW_SIMULATED);
+ if (ret == -EOPNOTSUPP)
+ ret = 0;
+ return ret ? ret : count;
+--- a/include/linux/mm.h
++++ b/include/linux/mm.h
+@@ -3188,6 +3188,7 @@ enum mf_flags {
+ MF_MUST_KILL = 1 << 2,
+ MF_SOFT_OFFLINE = 1 << 3,
+ MF_UNPOISON = 1 << 4,
++ MF_SW_SIMULATED = 1 << 5,
+ };
+ extern int memory_failure(unsigned long pfn, int flags);
+ extern void memory_failure_queue(unsigned long pfn, int flags);
+--- a/mm/hwpoison-inject.c
++++ b/mm/hwpoison-inject.c
+@@ -48,7 +48,7 @@ static int hwpoison_inject(void *data, u
+
+ inject:
+ pr_info("Injecting memory failure at pfn %#lx\n", pfn);
+- err = memory_failure(pfn, 0);
++ err = memory_failure(pfn, MF_SW_SIMULATED);
+ return (err == -EOPNOTSUPP) ? 0 : err;
+ }
+
+--- a/mm/madvise.c
++++ b/mm/madvise.c
+@@ -1101,7 +1101,7 @@ static int madvise_inject_error(int beha
+ } else {
+ pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n",
+ pfn, start);
+- ret = memory_failure(pfn, MF_COUNT_INCREASED);
++ ret = memory_failure(pfn, MF_COUNT_INCREASED | MF_SW_SIMULATED);
+ if (ret == -EOPNOTSUPP)
+ ret = 0;
+ }
+--- a/mm/memory-failure.c
++++ b/mm/memory-failure.c
+@@ -68,6 +68,8 @@ int sysctl_memory_failure_recovery __rea
+
+ atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
+
++static bool hw_memory_failure __read_mostly = false;
++
+ static bool __page_handle_poison(struct page *page)
+ {
+ int ret;
+@@ -1780,6 +1782,9 @@ int memory_failure(unsigned long pfn, in
+
+ mutex_lock(&mf_mutex);
+
++ if (!(flags & MF_SW_SIMULATED))
++ hw_memory_failure = true;
++
+ p = pfn_to_online_page(pfn);
+ if (!p) {
+ res = arch_memory_failure(pfn, flags);
+@@ -2138,6 +2143,13 @@ int unpoison_memory(unsigned long pfn)
+
+ mutex_lock(&mf_mutex);
+
++ if (hw_memory_failure) {
++ unpoison_pr_info("Unpoison: Disabled after HW memory failure %#lx\n",
++ pfn, &unpoison_rs);
++ ret = -EOPNOTSUPP;
++ goto unlock_mutex;
++ }
++
+ if (!PageHWPoison(p)) {
+ unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n",
+ pfn, &unpoison_rs);
--- /dev/null
+From 0a1355db36718178becd2bfe728a023933d73123 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Sun, 26 Jun 2022 11:50:43 +0200
+Subject: parisc: Enable ARCH_HAS_STRICT_MODULE_RWX
+
+From: Helge Deller <deller@gmx.de>
+
+commit 0a1355db36718178becd2bfe728a023933d73123 upstream.
+
+Fix a boot crash on a c8000 machine as reported by Dave. Basically it changes
+patch_map() to return an alias mapping to the to-be-patched code in order to
+prevent writing to write-protected memory.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Suggested-by: John David Anglin <dave.anglin@bell.net>
+Cc: stable@vger.kernel.org # v5.2+
+Link: https://lore.kernel.org/all/e8ec39e8-25f8-e6b4-b7ed-4cb23efc756e@bell.net/
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/parisc/Kconfig
++++ b/arch/parisc/Kconfig
+@@ -10,6 +10,7 @@ config PARISC
+ select ARCH_WANT_FRAME_POINTERS
+ select ARCH_HAS_ELF_RANDOMIZE
+ select ARCH_HAS_STRICT_KERNEL_RWX
++ select ARCH_HAS_STRICT_MODULE_RWX
+ select ARCH_HAS_UBSAN_SANITIZE_ALL
+ select ARCH_HAS_PTE_SPECIAL
+ select ARCH_NO_SG_CHAIN
--- /dev/null
+From e9ed22e6e5010997a2f922eef61ca797d0a2a246 Mon Sep 17 00:00:00 2001
+From: John David Anglin <dave.anglin@bell.net>
+Date: Sat, 18 Jun 2022 15:14:34 +0000
+Subject: parisc: Fix flush_anon_page on PA8800/PA8900
+
+From: John David Anglin <dave.anglin@bell.net>
+
+commit e9ed22e6e5010997a2f922eef61ca797d0a2a246 upstream.
+
+Anonymous pages are allocated with the shared mappings colouring,
+SHM_COLOUR. Since the alias boundary on machines with PA8800 and
+PA8900 processors is unknown, flush_user_cache_page() might not
+flush all mappings of a shared anonymous page. Flushing the whole
+data cache flushes all mappings.
+
+This won't fix all coherency issues with shared mappings but it
+seems to work well in practice. I haven't seen any random memory
+faults in almost a month on a rp3440 running as a debian buildd
+machine.
+
+There is a small preformance hit.
+
+Signed-off-by: John David Anglin <dave.anglin@bell.net>
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc: stable@vger.kernel.org # v5.18+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/cache.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/arch/parisc/kernel/cache.c
++++ b/arch/parisc/kernel/cache.c
+@@ -722,7 +722,10 @@ void flush_anon_page(struct vm_area_stru
+ return;
+
+ if (parisc_requires_coherency()) {
+- flush_user_cache_page(vma, vmaddr);
++ if (vma->vm_flags & VM_SHARED)
++ flush_data_cache();
++ else
++ flush_user_cache_page(vma, vmaddr);
+ return;
+ }
+
--- /dev/null
+From 1d0811b03eb30b2f0793acaa96c6ce90b8b9c87a Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Tue, 7 Jun 2022 12:57:58 +0200
+Subject: parisc/stifb: Fix fb_is_primary_device() only available with CONFIG_FB_STI
+
+From: Helge Deller <deller@gmx.de>
+
+commit 1d0811b03eb30b2f0793acaa96c6ce90b8b9c87a upstream.
+
+Fix this build error noticed by the kernel test robot:
+
+drivers/video/console/sticore.c:1132:5: error: redefinition of 'fb_is_primary_device'
+ arch/parisc/include/asm/fb.h:18:19: note: previous definition of 'fb_is_primary_device'
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Reported-by: kernel test robot <lkp@intel.com>
+Cc: stable@vger.kernel.org # v5.10+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/include/asm/fb.h | 2 +-
+ drivers/video/console/sticore.c | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/parisc/include/asm/fb.h
++++ b/arch/parisc/include/asm/fb.h
+@@ -12,7 +12,7 @@ static inline void fb_pgprotect(struct f
+ pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
+ }
+
+-#if defined(CONFIG_STI_CONSOLE) || defined(CONFIG_FB_STI)
++#if defined(CONFIG_FB_STI)
+ int fb_is_primary_device(struct fb_info *info);
+ #else
+ static inline int fb_is_primary_device(struct fb_info *info)
+--- a/drivers/video/console/sticore.c
++++ b/drivers/video/console/sticore.c
+@@ -1127,6 +1127,7 @@ int sti_call(const struct sti_struct *st
+ return ret;
+ }
+
++#if defined(CONFIG_FB_STI)
+ /* check if given fb_info is the primary device */
+ int fb_is_primary_device(struct fb_info *info)
+ {
+@@ -1142,6 +1143,7 @@ int fb_is_primary_device(struct fb_info
+ return (sti->info == info);
+ }
+ EXPORT_SYMBOL(fb_is_primary_device);
++#endif
+
+ MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer");
+ MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
--- /dev/null
+From ec6d0dde71d760aa60316f8d1c9a1b0d99213529 Mon Sep 17 00:00:00 2001
+From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
+Date: Thu, 9 Jun 2022 16:03:28 +0530
+Subject: powerpc: Enable execve syscall exit tracepoint
+
+From: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+
+commit ec6d0dde71d760aa60316f8d1c9a1b0d99213529 upstream.
+
+On execve[at], we are zero'ing out most of the thread register state
+including gpr[0], which contains the syscall number. Due to this, we
+fail to trigger the syscall exit tracepoint properly. Fix this by
+retaining gpr[0] in the thread register state.
+
+Before this patch:
+ # tail /sys/kernel/debug/tracing/trace
+ cat-123 [000] ..... 61.449351: sys_execve(filename:
+ 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8)
+ cat-124 [000] ..... 62.428481: sys_execve(filename:
+ 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8)
+ echo-125 [000] ..... 65.813702: sys_execve(filename:
+ 7fffa6b23378, argv: 7fffa6b233a0, envp: 7fffa6b233b0)
+ echo-125 [000] ..... 65.822214: sys_execveat(fd: 0,
+ filename: 1009ac48, argv: 7ffff65d0c98, envp: 7ffff65d0ca8, flags: 0)
+
+After this patch:
+ # tail /sys/kernel/debug/tracing/trace
+ cat-127 [000] ..... 100.416262: sys_execve(filename:
+ 7fffa41b3448, argv: 7fffa41b33e0, envp: 7fffa41b33f8)
+ cat-127 [000] ..... 100.418203: sys_execve -> 0x0
+ echo-128 [000] ..... 103.873968: sys_execve(filename:
+ 7fffa41b3378, argv: 7fffa41b33a0, envp: 7fffa41b33b0)
+ echo-128 [000] ..... 103.875102: sys_execve -> 0x0
+ echo-128 [000] ..... 103.882097: sys_execveat(fd: 0,
+ filename: 1009ac48, argv: 7fffd10d2148, envp: 7fffd10d2158, flags: 0)
+ echo-128 [000] ..... 103.883225: sys_execveat -> 0x0
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+Tested-by: Sumit Dubey2 <Sumit.Dubey2@ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20220609103328.41306-1-naveen.n.rao@linux.vnet.ibm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/kernel/process.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/powerpc/kernel/process.c
++++ b/arch/powerpc/kernel/process.c
+@@ -1857,7 +1857,7 @@ void start_thread(struct pt_regs *regs,
+ tm_reclaim_current(0);
+ #endif
+
+- memset(regs->gpr, 0, sizeof(regs->gpr));
++ memset(®s->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
+ regs->ctr = 0;
+ regs->link = 0;
+ regs->xer = 0;
--- /dev/null
+From 20a9689b3607456d92c6fb764501f6a95950b098 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Sat, 11 Jun 2022 17:10:13 +0200
+Subject: powerpc/microwatt: wire up rng during setup_arch()
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+commit 20a9689b3607456d92c6fb764501f6a95950b098 upstream.
+
+The platform's RNG must be available before random_init() in order to be
+useful for initial seeding, which in turn means that it needs to be
+called from setup_arch(), rather than from an init call. Fortunately,
+each platform already has a setup_arch function pointer, which means
+it's easy to wire this up. This commit also removes some noisy log
+messages that don't add much.
+
+Fixes: c25769fddaec ("powerpc/microwatt: Add support for hardware random number generator")
+Cc: stable@vger.kernel.org # v5.14+
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20220611151015.548325-2-Jason@zx2c4.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/platforms/microwatt/microwatt.h | 7 +++++++
+ arch/powerpc/platforms/microwatt/rng.c | 10 +++-------
+ arch/powerpc/platforms/microwatt/setup.c | 8 ++++++++
+ 3 files changed, 18 insertions(+), 7 deletions(-)
+ create mode 100644 arch/powerpc/platforms/microwatt/microwatt.h
+
+--- /dev/null
++++ b/arch/powerpc/platforms/microwatt/microwatt.h
+@@ -0,0 +1,7 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef _MICROWATT_H
++#define _MICROWATT_H
++
++void microwatt_rng_init(void);
++
++#endif /* _MICROWATT_H */
+--- a/arch/powerpc/platforms/microwatt/rng.c
++++ b/arch/powerpc/platforms/microwatt/rng.c
+@@ -11,6 +11,7 @@
+ #include <asm/archrandom.h>
+ #include <asm/cputable.h>
+ #include <asm/machdep.h>
++#include "microwatt.h"
+
+ #define DARN_ERR 0xFFFFFFFFFFFFFFFFul
+
+@@ -29,7 +30,7 @@ static int microwatt_get_random_darn(uns
+ return 1;
+ }
+
+-static __init int rng_init(void)
++void __init microwatt_rng_init(void)
+ {
+ unsigned long val;
+ int i;
+@@ -37,12 +38,7 @@ static __init int rng_init(void)
+ for (i = 0; i < 10; i++) {
+ if (microwatt_get_random_darn(&val)) {
+ ppc_md.get_random_seed = microwatt_get_random_darn;
+- return 0;
++ return;
+ }
+ }
+-
+- pr_warn("Unable to use DARN for get_random_seed()\n");
+-
+- return -EIO;
+ }
+-machine_subsys_initcall(, rng_init);
+--- a/arch/powerpc/platforms/microwatt/setup.c
++++ b/arch/powerpc/platforms/microwatt/setup.c
+@@ -16,6 +16,8 @@
+ #include <asm/xics.h>
+ #include <asm/udbg.h>
+
++#include "microwatt.h"
++
+ static void __init microwatt_init_IRQ(void)
+ {
+ xics_init();
+@@ -32,10 +34,16 @@ static int __init microwatt_populate(voi
+ }
+ machine_arch_initcall(microwatt, microwatt_populate);
+
++static void __init microwatt_setup_arch(void)
++{
++ microwatt_rng_init();
++}
++
+ define_machine(microwatt) {
+ .name = "microwatt",
+ .probe = microwatt_probe,
+ .init_IRQ = microwatt_init_IRQ,
++ .setup_arch = microwatt_setup_arch,
+ .progress = udbg_progress,
+ .calibrate_decr = generic_calibrate_decr,
+ };
--- /dev/null
+From f3eac426657d985b97c92fa5f7ae1d43f04721f3 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Tue, 21 Jun 2022 16:08:49 +0200
+Subject: powerpc/powernv: wire up rng during setup_arch
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+commit f3eac426657d985b97c92fa5f7ae1d43f04721f3 upstream.
+
+The platform's RNG must be available before random_init() in order to be
+useful for initial seeding, which in turn means that it needs to be
+called from setup_arch(), rather than from an init call.
+
+Complicating things, however, is that POWER8 systems need some per-cpu
+state and kmalloc, which isn't available at this stage. So we split
+things up into an early phase and a later opportunistic phase. This
+commit also removes some noisy log messages that don't add much.
+
+Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv")
+Cc: stable@vger.kernel.org # v3.13+
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
+[mpe: Add of_node_put(), use pnv naming, minor change log editing]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20220621140849.127227-1-Jason@zx2c4.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/platforms/powernv/powernv.h | 2 +
+ arch/powerpc/platforms/powernv/rng.c | 52 +++++++++++++++++++++----------
+ arch/powerpc/platforms/powernv/setup.c | 2 +
+ 3 files changed, 40 insertions(+), 16 deletions(-)
+
+--- a/arch/powerpc/platforms/powernv/powernv.h
++++ b/arch/powerpc/platforms/powernv/powernv.h
+@@ -42,4 +42,6 @@ ssize_t memcons_copy(struct memcons *mc,
+ u32 __init memcons_get_size(struct memcons *mc);
+ struct memcons *__init memcons_init(struct device_node *node, const char *mc_prop_name);
+
++void pnv_rng_init(void);
++
+ #endif /* _POWERNV_H */
+--- a/arch/powerpc/platforms/powernv/rng.c
++++ b/arch/powerpc/platforms/powernv/rng.c
+@@ -17,6 +17,7 @@
+ #include <asm/prom.h>
+ #include <asm/machdep.h>
+ #include <asm/smp.h>
++#include "powernv.h"
+
+ #define DARN_ERR 0xFFFFFFFFFFFFFFFFul
+
+@@ -28,7 +29,6 @@ struct powernv_rng {
+
+ static DEFINE_PER_CPU(struct powernv_rng *, powernv_rng);
+
+-
+ int powernv_hwrng_present(void)
+ {
+ struct powernv_rng *rng;
+@@ -98,9 +98,6 @@ static int __init initialise_darn(void)
+ return 0;
+ }
+ }
+-
+- pr_warn("Unable to use DARN for get_random_seed()\n");
+-
+ return -EIO;
+ }
+
+@@ -163,32 +160,55 @@ static __init int rng_create(struct devi
+
+ rng_init_per_cpu(rng, dn);
+
+- pr_info_once("Registering arch random hook.\n");
+-
+ ppc_md.get_random_seed = powernv_get_random_long;
+
+ return 0;
+ }
+
+-static __init int rng_init(void)
++static int __init pnv_get_random_long_early(unsigned long *v)
+ {
+ struct device_node *dn;
+- int rc;
++
++ if (!slab_is_available())
++ return 0;
++
++ if (cmpxchg(&ppc_md.get_random_seed, pnv_get_random_long_early,
++ NULL) != pnv_get_random_long_early)
++ return 0;
+
+ for_each_compatible_node(dn, NULL, "ibm,power-rng") {
+- rc = rng_create(dn);
+- if (rc) {
+- pr_err("Failed creating rng for %pOF (%d).\n",
+- dn, rc);
++ if (rng_create(dn))
+ continue;
+- }
+-
+ /* Create devices for hwrng driver */
+ of_platform_device_create(dn, NULL, NULL);
+ }
+
+- initialise_darn();
++ if (!ppc_md.get_random_seed)
++ return 0;
++ return ppc_md.get_random_seed(v);
++}
++
++void __init pnv_rng_init(void)
++{
++ struct device_node *dn;
+
++ /* Prefer darn over the rest. */
++ if (!initialise_darn())
++ return;
++
++ dn = of_find_compatible_node(NULL, NULL, "ibm,power-rng");
++ if (dn)
++ ppc_md.get_random_seed = pnv_get_random_long_early;
++
++ of_node_put(dn);
++}
++
++static int __init pnv_rng_late_init(void)
++{
++ unsigned long v;
++ /* In case it wasn't called during init for some other reason. */
++ if (ppc_md.get_random_seed == pnv_get_random_long_early)
++ pnv_get_random_long_early(&v);
+ return 0;
+ }
+-machine_subsys_initcall(powernv, rng_init);
++machine_subsys_initcall(powernv, pnv_rng_late_init);
+--- a/arch/powerpc/platforms/powernv/setup.c
++++ b/arch/powerpc/platforms/powernv/setup.c
+@@ -203,6 +203,8 @@ static void __init pnv_setup_arch(void)
+ pnv_check_guarded_cores();
+
+ /* XXX PMCS */
++
++ pnv_rng_init();
+ }
+
+ static void __init pnv_init(void)
--- /dev/null
+From 7bc08056a6dabc3a1442216daf527edf61ac24b6 Mon Sep 17 00:00:00 2001
+From: Andrew Donnellan <ajd@linux.ibm.com>
+Date: Tue, 14 Jun 2022 23:49:52 +1000
+Subject: powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address
+
+From: Andrew Donnellan <ajd@linux.ibm.com>
+
+commit 7bc08056a6dabc3a1442216daf527edf61ac24b6 upstream.
+
+Add a special case to block_rtas_call() to allow the ibm,platform-dump RTAS
+call through the RTAS filter if the buffer address is 0.
+
+According to PAPR, ibm,platform-dump is called with a null buffer address
+to notify the platform firmware that processing of a particular dump is
+finished.
+
+Without this, on a pseries machine with CONFIG_PPC_RTAS_FILTER enabled, an
+application such as rtas_errd that is attempting to retrieve a dump will
+encounter an error at the end of the retrieval process.
+
+Fixes: bd59380c5ba4 ("powerpc/rtas: Restrict RTAS requests from userspace")
+Cc: stable@vger.kernel.org
+Reported-by: Sathvika Vasireddy <sathvika@linux.ibm.com>
+Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
+Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
+Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20220614134952.156010-1-ajd@linux.ibm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/kernel/rtas.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/kernel/rtas.c
++++ b/arch/powerpc/kernel/rtas.c
+@@ -1061,7 +1061,7 @@ static struct rtas_filter rtas_filters[]
+ { "get-time-of-day", -1, -1, -1, -1, -1 },
+ { "ibm,get-vpd", -1, 0, -1, 1, 2 },
+ { "ibm,lpar-perftools", -1, 2, 3, -1, -1 },
+- { "ibm,platform-dump", -1, 4, 5, -1, -1 },
++ { "ibm,platform-dump", -1, 4, 5, -1, -1 }, /* Special cased */
+ { "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 },
+ { "ibm,scan-log-dump", -1, 0, 1, -1, -1 },
+ { "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 },
+@@ -1110,6 +1110,15 @@ static bool block_rtas_call(int token, i
+ size = 1;
+
+ end = base + size - 1;
++
++ /*
++ * Special case for ibm,platform-dump - NULL buffer
++ * address is used to indicate end of dump processing
++ */
++ if (!strcmp(f->name, "ibm,platform-dump") &&
++ base == 0)
++ return false;
++
+ if (!in_rmo_buf(base, end))
+ goto err;
+ }
iio-adc-stm32-fix-adcs-iteration-in-irq-handler.patch
iio-adc-stm32-fix-irqs-on-stm32f4-by-removing-custom-spurious-irqs-message.patch
iio-adc-stm32-fix-vrefint-wrong-calibration-value-handling.patch
+iio-adc-axp288-override-ts-pin-bias-current-for-some-models.patch
+iio-adc-rzg2l_adc-add-missing-fwnode_handle_put-in-rzg2l_adc_parse_properties.patch
+iio-adc-adi-axi-adc-fix-refcount-leak-in-adi_axi_adc_attach_client.patch
+iio-adc-ti-ads131e08-add-missing-fwnode_handle_put-in-ads131e08_alloc_channels.patch
+xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch
+xtensa-fix-refcount-leak-bug-in-time.c.patch
+parisc-stifb-fix-fb_is_primary_device-only-available-with-config_fb_sti.patch
+parisc-fix-flush_anon_page-on-pa8800-pa8900.patch
+parisc-enable-arch_has_strict_module_rwx.patch
+arm64-dts-ti-k3-j721s2-fix-overlapping-gicd-memory-region.patch
+powerpc-microwatt-wire-up-rng-during-setup_arch.patch
+powerpc-enable-execve-syscall-exit-tracepoint.patch
+powerpc-rtas-allow-ibm-platform-dump-rtas-call-with-null-buffer-address.patch
+powerpc-powernv-wire-up-rng-during-setup_arch.patch
+mm-memory-failure-disable-unpoison-once-hw-error-happens.patch
+mm-lru_cache_disable-use-synchronize_rcu_expedited.patch
--- /dev/null
+From a0117dc956429f2ede17b323046e1968d1849150 Mon Sep 17 00:00:00 2001
+From: Liang He <windhl@126.com>
+Date: Fri, 17 Jun 2022 20:44:32 +0800
+Subject: xtensa: Fix refcount leak bug in time.c
+
+From: Liang He <windhl@126.com>
+
+commit a0117dc956429f2ede17b323046e1968d1849150 upstream.
+
+In calibrate_ccount(), of_find_compatible_node() will return a node
+pointer with refcount incremented. We should use of_node_put() when
+it is not used anymore.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Liang He <windhl@126.com>
+Message-Id: <20220617124432.4049006-1-windhl@126.com>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/xtensa/kernel/time.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/xtensa/kernel/time.c
++++ b/arch/xtensa/kernel/time.c
+@@ -154,6 +154,7 @@ static void __init calibrate_ccount(void
+ cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
+ if (cpu) {
+ clk = of_clk_get(cpu, 0);
++ of_node_put(cpu);
+ if (!IS_ERR(clk)) {
+ ccount_freq = clk_get_rate(clk);
+ return;
--- /dev/null
+From 173940b3ae40114d4179c251a98ee039dc9cd5b3 Mon Sep 17 00:00:00 2001
+From: Liang He <windhl@126.com>
+Date: Fri, 17 Jun 2022 19:53:23 +0800
+Subject: xtensa: xtfpga: Fix refcount leak bug in setup
+
+From: Liang He <windhl@126.com>
+
+commit 173940b3ae40114d4179c251a98ee039dc9cd5b3 upstream.
+
+In machine_setup(), of_find_compatible_node() will return a node
+pointer with refcount incremented. We should use of_node_put() when
+it is not used anymore.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Liang He <windhl@126.com>
+Message-Id: <20220617115323.4046905-1-windhl@126.com>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/xtensa/platforms/xtfpga/setup.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/xtensa/platforms/xtfpga/setup.c
++++ b/arch/xtensa/platforms/xtfpga/setup.c
+@@ -133,6 +133,7 @@ static int __init machine_setup(void)
+
+ if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
+ update_local_mac(eth);
++ of_node_put(eth);
+ return 0;
+ }
+ arch_initcall(machine_setup);