From: Sasha Levin Date: Mon, 22 Nov 2021 01:54:50 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v5.15.5~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5367d72fd44f8b336b5f9bb3619d57f7c33064d2;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/blk-cgroup-fix-missing-put-device-in-error-path-from.patch b/queue-5.15/blk-cgroup-fix-missing-put-device-in-error-path-from.patch new file mode 100644 index 00000000000..96de739b295 --- /dev/null +++ b/queue-5.15/blk-cgroup-fix-missing-put-device-in-error-path-from.patch @@ -0,0 +1,67 @@ +From dab36e7feab2921e41915fb27f6490f0838af56f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 2 Nov 2021 10:07:05 +0800 +Subject: blk-cgroup: fix missing put device in error path from + blkg_conf_pref() + +From: Yu Kuai + +[ Upstream commit 15c30104965101b8e76b24d27035569d6613a7d6 ] + +If blk_queue_enter() failed due to queue is dying, the +blkdev_put_no_open() is needed because blkcg_conf_open_bdev() succeeded. + +Fixes: 0c9d338c8443 ("blk-cgroup: synchronize blkg creation against policy deactivation") +Signed-off-by: Yu Kuai +Acked-by: Tejun Heo +Link: https://lore.kernel.org/r/20211102020705.2321858-1-yukuai3@huawei.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/blk-cgroup.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c +index ebff1af402e5b..0eec59e4df65c 100644 +--- a/block/blk-cgroup.c ++++ b/block/blk-cgroup.c +@@ -639,7 +639,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, + */ + ret = blk_queue_enter(q, 0); + if (ret) +- return ret; ++ goto fail; + + rcu_read_lock(); + spin_lock_irq(&q->queue_lock); +@@ -675,13 +675,13 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, + new_blkg = blkg_alloc(pos, q, GFP_KERNEL); + if (unlikely(!new_blkg)) { + ret = -ENOMEM; +- goto fail; ++ goto fail_exit_queue; + } + + if (radix_tree_preload(GFP_KERNEL)) { + blkg_free(new_blkg); + ret = -ENOMEM; +- goto fail; ++ goto fail_exit_queue; + } + + rcu_read_lock(); +@@ -721,9 +721,10 @@ fail_preloaded: + fail_unlock: + spin_unlock_irq(&q->queue_lock); + rcu_read_unlock(); ++fail_exit_queue: ++ blk_queue_exit(q); + fail: + blkdev_put_no_open(bdev); +- blk_queue_exit(q); + /* + * If queue was bypassing, we should retry. Do so after a + * short msleep(). It isn't strictly necessary but queue +-- +2.33.0 + diff --git a/queue-5.15/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch b/queue-5.15/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch new file mode 100644 index 00000000000..e839e6ef4d9 --- /dev/null +++ b/queue-5.15/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch @@ -0,0 +1,64 @@ +From d44ba74947ed37fbf7a64b26bc9f1c3d60e3f6f0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 24 Sep 2021 01:10:31 +1000 +Subject: KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr() + +From: Michael Ellerman + +[ Upstream commit dae581864609d36fb58855fd59880b4941ce9d14 ] + +kvmppc_h_set_dabr(), and kvmppc_h_set_xdabr() which jumps into +it, need to use _GLOBAL_TOC to setup the kernel TOC pointer, because +kvmppc_h_set_dabr() uses LOAD_REG_ADDR() to load dawr_force_enable. + +When called from hcall_try_real_mode() we have the kernel TOC in r2, +established near the start of kvmppc_interrupt_hv(), so there is no +issue. + +But they can also be called from kvmppc_pseries_do_hcall() which is +module code, so the access ends up happening with the kvm-hv module's +r2, which will not point at dawr_force_enable and could even cause a +fault. + +With the current code layout and compilers we haven't observed a fault +in practice, the load hits somewhere in kvm-hv.ko and silently returns +some bogus value. + +Note that we we expect p8/p9 guests to use the DAWR, but SLOF uses +h_set_dabr() to test if sc1 works correctly, see SLOF's +lib/libhvcall/brokensc1.c. + +Fixes: c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 option") +Signed-off-by: Michael Ellerman +Reviewed-by: Daniel Axtens +Link: https://lore.kernel.org/r/20210923151031.72408-1-mpe@ellerman.id.au +Signed-off-by: Sasha Levin +--- + arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S +index eb776d0c5d8e9..32a4b4d412b92 100644 +--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S ++++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S +@@ -2005,7 +2005,7 @@ hcall_real_table: + .globl hcall_real_table_end + hcall_real_table_end: + +-_GLOBAL(kvmppc_h_set_xdabr) ++_GLOBAL_TOC(kvmppc_h_set_xdabr) + EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr) + andi. r0, r5, DABRX_USER | DABRX_KERNEL + beq 6f +@@ -2015,7 +2015,7 @@ EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr) + 6: li r3, H_PARAMETER + blr + +-_GLOBAL(kvmppc_h_set_dabr) ++_GLOBAL_TOC(kvmppc_h_set_dabr) + EXPORT_SYMBOL_GPL(kvmppc_h_set_dabr) + li r5, DABRX_USER | DABRX_KERNEL + 3: +-- +2.33.0 + diff --git a/queue-5.15/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch b/queue-5.15/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch new file mode 100644 index 00000000000..9f04c922b07 --- /dev/null +++ b/queue-5.15/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch @@ -0,0 +1,41 @@ +From ac0f55438ce6e8956c63621a42e2fed010c9dd30 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Nov 2021 12:03:32 +0300 +Subject: perf/x86/intel/uncore: Fix filter_tid mask for CHA events on Skylake + Server + +From: Alexander Antonov + +[ Upstream commit e324234e0aa881b7841c7c713306403e12b069ff ] + +According Uncore Reference Manual: any of the CHA events may be filtered +by Thread/Core-ID by using tid modifier in CHA Filter 0 Register. +Update skx_cha_hw_config() to follow Uncore Guide. + +Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20211115090334.3789-2-alexander.antonov@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index eb2c6cea9d0d5..e5ee6bb62ef50 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -3608,6 +3608,9 @@ static int skx_cha_hw_config(struct intel_uncore_box *box, struct perf_event *ev + struct hw_perf_event_extra *reg1 = &event->hw.extra_reg; + struct extra_reg *er; + int idx = 0; ++ /* Any of the CHA events may be filtered by Thread/Core-ID.*/ ++ if (event->hw.config & SNBEP_CBO_PMON_CTL_TID_EN) ++ idx = SKX_CHA_MSR_PMON_BOX_FILTER_TID; + + for (er = skx_uncore_cha_extra_regs; er->msr; er++) { + if (er->event != (event->hw.config & er->config_mask)) +-- +2.33.0 + diff --git a/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch b/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch new file mode 100644 index 00000000000..5a3c5bdd6ae --- /dev/null +++ b/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch @@ -0,0 +1,38 @@ +From fc0e5412d68fe2bd2b4526d555ac333e0ce86b86 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Nov 2021 12:03:33 +0300 +Subject: perf/x86/intel/uncore: Fix IIO event constraints for Skylake Server + +From: Alexander Antonov + +[ Upstream commit 3866ae319c846a612109c008f43cba80b8c15e86 ] + +According to the latest uncore document, COMP_BUF_OCCUPANCY (0xd5) event +can be collected on 2-3 counters. Update uncore IIO event constraints for +Skylake Server. + +Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20211115090334.3789-3-alexander.antonov@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index e5ee6bb62ef50..9aba4ef77b13b 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -3678,6 +3678,7 @@ static struct event_constraint skx_uncore_iio_constraints[] = { + UNCORE_EVENT_CONSTRAINT(0xc0, 0xc), + UNCORE_EVENT_CONSTRAINT(0xc5, 0xc), + UNCORE_EVENT_CONSTRAINT(0xd4, 0xc), ++ UNCORE_EVENT_CONSTRAINT(0xd5, 0xc), + EVENT_CONSTRAINT_END + }; + +-- +2.33.0 + diff --git a/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch-26758 b/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch-26758 new file mode 100644 index 00000000000..1025c584409 --- /dev/null +++ b/queue-5.15/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch-26758 @@ -0,0 +1,52 @@ +From 4581885bb7bafed3c4e6599e6f3fdaab8870c233 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Nov 2021 12:03:34 +0300 +Subject: perf/x86/intel/uncore: Fix IIO event constraints for Snowridge + +From: Alexander Antonov + +[ Upstream commit bdc0feee05174418dec1fa68de2af19e1750b99f ] + +According to the latest uncore document, DATA_REQ_OF_CPU (0x83), +DATA_REQ_BY_CPU (0xc0) and COMP_BUF_OCCUPANCY (0xd5) events have +constraints. Add uncore IIO constraints for Snowridge. + +Fixes: 210cc5f9db7a ("perf/x86/intel/uncore: Add uncore support for Snow Ridge server") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20211115090334.3789-4-alexander.antonov@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index 9aba4ef77b13b..3660f698fb2aa 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -4529,6 +4529,13 @@ static void snr_iio_cleanup_mapping(struct intel_uncore_type *type) + pmu_iio_cleanup_mapping(type, &snr_iio_mapping_group); + } + ++static struct event_constraint snr_uncore_iio_constraints[] = { ++ UNCORE_EVENT_CONSTRAINT(0x83, 0x3), ++ UNCORE_EVENT_CONSTRAINT(0xc0, 0xc), ++ UNCORE_EVENT_CONSTRAINT(0xd5, 0xc), ++ EVENT_CONSTRAINT_END ++}; ++ + static struct intel_uncore_type snr_uncore_iio = { + .name = "iio", + .num_counters = 4, +@@ -4540,6 +4547,7 @@ static struct intel_uncore_type snr_uncore_iio = { + .event_mask_ext = SNR_IIO_PMON_RAW_EVENT_MASK_EXT, + .box_ctl = SNR_IIO_MSR_PMON_BOX_CTL, + .msr_offset = SNR_IIO_MSR_OFFSET, ++ .constraints = snr_uncore_iio_constraints, + .ops = &ivbep_uncore_msr_ops, + .format_group = &snr_uncore_iio_format_group, + .attr_update = snr_iio_attr_update, +-- +2.33.0 + diff --git a/queue-5.15/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch b/queue-5.15/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch new file mode 100644 index 00000000000..e83ab27e99b --- /dev/null +++ b/queue-5.15/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch @@ -0,0 +1,48 @@ +From f1c951732ed9d4633c66a16c751a498c4e61082e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Nov 2021 22:41:15 -0500 +Subject: pinctrl: qcom: sdm845: Enable dual edge errata + +From: Bjorn Andersson + +[ Upstream commit 3a3a100473d2f6ebf9bdfe6efedd7e18de724388 ] + +It has been observed that dual edge triggered wakeirq GPIOs on SDM845 +doesn't trigger interrupts on the falling edge. + +Enabling wakeirq_dual_edge_errata for SDM845 indicates that the PDC in +SDM845 suffers from the same problem described, and worked around, by +Doug in 'c3c0c2e18d94 ("pinctrl: qcom: Handle broken/missing PDC dual +edge IRQs on sc7180")', so enable the workaround for SDM845 as well. + +The specific problem seen without this is that gpio-keys does not detect +the falling edge of the LID gpio on the Lenovo Yoga C630 and as such +consistently reports the LID as closed. + +Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") +Signed-off-by: Bjorn Andersson +Tested-By: Steev Klimaszewski +Reviewed-by: Douglas Anderson +Reviewed-by: Stephen Boyd +Link: https://lore.kernel.org/r/20211102034115.1946036-1-bjorn.andersson@linaro.org +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/qcom/pinctrl-sdm845.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/pinctrl-sdm845.c +index c51793f6546f1..fdfd7b8f3a76d 100644 +--- a/drivers/pinctrl/qcom/pinctrl-sdm845.c ++++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c +@@ -1310,6 +1310,7 @@ static const struct msm_pinctrl_soc_data sdm845_pinctrl = { + .ngpios = 151, + .wakeirq_map = sdm845_pdc_map, + .nwakeirq_map = ARRAY_SIZE(sdm845_pdc_map), ++ .wakeirq_dual_edge_errata = true, + }; + + static const struct msm_pinctrl_soc_data sdm845_acpi_pinctrl = { +-- +2.33.0 + diff --git a/queue-5.15/pinctrl-qcom-sm8350-correct-ufs-and-sdc-offsets.patch b/queue-5.15/pinctrl-qcom-sm8350-correct-ufs-and-sdc-offsets.patch new file mode 100644 index 00000000000..be9835dc3ed --- /dev/null +++ b/queue-5.15/pinctrl-qcom-sm8350-correct-ufs-and-sdc-offsets.patch @@ -0,0 +1,48 @@ +From 0fe494bcebf34ecb34831a7063a51516e9eca28c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 4 Nov 2021 10:08:35 -0700 +Subject: pinctrl: qcom: sm8350: Correct UFS and SDC offsets + +From: Bjorn Andersson + +[ Upstream commit 62209e805b5c68577602a5803a71d8e2e11ee0d3 ] + +The downstream TLMM binding covers a group of TLMM-related hardware +blocks, but the upstream binding only captures the particular block +related to controlling the TLMM pins from an OS. In the translation of +the driver from downstream, the offset of 0x100000 was lost for the UFS +and SDC pingroups. + +Fixes: d5d348a3271f ("pinctrl: qcom: Add SM8350 pinctrl driver") +Signed-off-by: Bjorn Andersson +Reviewed-by: Vinod Koul +Reviewed-by: Vladimir Zapolskiy +Link: https://lore.kernel.org/r/20211104170835.1993686-1-bjorn.andersson@linaro.org +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/qcom/pinctrl-sm8350.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/pinctrl/qcom/pinctrl-sm8350.c b/drivers/pinctrl/qcom/pinctrl-sm8350.c +index 4d8f8636c2b39..1c042d39380c6 100644 +--- a/drivers/pinctrl/qcom/pinctrl-sm8350.c ++++ b/drivers/pinctrl/qcom/pinctrl-sm8350.c +@@ -1597,10 +1597,10 @@ static const struct msm_pingroup sm8350_groups[] = { + [200] = PINGROUP(200, qdss_gpio, _, _, _, _, _, _, _, _), + [201] = PINGROUP(201, _, _, _, _, _, _, _, _, _), + [202] = PINGROUP(202, _, _, _, _, _, _, _, _, _), +- [203] = UFS_RESET(ufs_reset, 0x1d8000), +- [204] = SDC_PINGROUP(sdc2_clk, 0x1cf000, 14, 6), +- [205] = SDC_PINGROUP(sdc2_cmd, 0x1cf000, 11, 3), +- [206] = SDC_PINGROUP(sdc2_data, 0x1cf000, 9, 0), ++ [203] = UFS_RESET(ufs_reset, 0xd8000), ++ [204] = SDC_PINGROUP(sdc2_clk, 0xcf000, 14, 6), ++ [205] = SDC_PINGROUP(sdc2_cmd, 0xcf000, 11, 3), ++ [206] = SDC_PINGROUP(sdc2_data, 0xcf000, 9, 0), + }; + + static const struct msm_gpio_wakeirq_map sm8350_pdc_map[] = { +-- +2.33.0 + diff --git a/queue-5.15/powerpc-clean-vdso32-and-vdso64-directories.patch b/queue-5.15/powerpc-clean-vdso32-and-vdso64-directories.patch new file mode 100644 index 00000000000..1f4f3aeec35 --- /dev/null +++ b/queue-5.15/powerpc-clean-vdso32-and-vdso64-directories.patch @@ -0,0 +1,38 @@ +From 18f7fbccd6f196eeea08284b72104bfda446b4d9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 Nov 2021 03:50:15 +0900 +Subject: powerpc: clean vdso32 and vdso64 directories + +From: Masahiro Yamada + +[ Upstream commit 964c33cd0be621b291b5d253d8731eb2680082cb ] + +Since commit bce74491c300 ("powerpc/vdso: fix unnecessary rebuilds of +vgettimeofday.o"), "make ARCH=powerpc clean" does not clean up the +arch/powerpc/kernel/{vdso32,vdso64} directories. + +Use the subdir- trick to let "make clean" descend into them. + +Fixes: bce74491c300 ("powerpc/vdso: fix unnecessary rebuilds of vgettimeofday.o") +Signed-off-by: Masahiro Yamada +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20211109185015.615517-1-masahiroy@kernel.org +Signed-off-by: Sasha Levin +--- + arch/powerpc/kernel/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile +index 7be36c1e1db6d..86e40db2dec56 100644 +--- a/arch/powerpc/kernel/Makefile ++++ b/arch/powerpc/kernel/Makefile +@@ -196,3 +196,6 @@ clean-files := vmlinux.lds + # Force dependency (incbin is bad) + $(obj)/vdso32_wrapper.o : $(obj)/vdso32/vdso32.so.dbg + $(obj)/vdso64_wrapper.o : $(obj)/vdso64/vdso64.so.dbg ++ ++# for cleaning ++subdir- += vdso32 vdso64 +-- +2.33.0 + diff --git a/queue-5.15/powerpc-pseries-fix-numa-form2-parsing-fallback-code.patch b/queue-5.15/powerpc-pseries-fix-numa-form2-parsing-fallback-code.patch new file mode 100644 index 00000000000..7c18a2334a5 --- /dev/null +++ b/queue-5.15/powerpc-pseries-fix-numa-form2-parsing-fallback-code.patch @@ -0,0 +1,75 @@ +From 420021eccdcb9e222774e22f715f5b2b1bc11809 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Nov 2021 16:49:00 +1000 +Subject: powerpc/pseries: Fix numa FORM2 parsing fallback code + +From: Nicholas Piggin + +[ Upstream commit 302039466f6a3b9421ecb9a6a2c528801dc24a86 ] + +In case the FORM2 distance table from firmware is not the expected size, +there is fallback code that just populates the lookup table as local vs +remote. + +However it then continues on to use the distance table. Fix. + +Fixes: 1c6b5a7e7405 ("powerpc/pseries: Add support for FORM2 associativity") +Signed-off-by: Nicholas Piggin +Reviewed-by: Aneesh Kumar K.V +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20211109064900.2041386-2-npiggin@gmail.com +Signed-off-by: Sasha Levin +--- + arch/powerpc/mm/numa.c | 28 ++++++++++++---------------- + 1 file changed, 12 insertions(+), 16 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 53e9901409163..59d3cfcd78879 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -407,30 +407,26 @@ static void initialize_form2_numa_distance_lookup_table(void) + + if (form2_distances_length != max_numa_index * max_numa_index) { + WARN(1, "Wrong NUMA distance information\n"); +- /* consider everybody else just remote. */ +- for (i = 0; i < max_numa_index; i++) { +- for (j = 0; j < max_numa_index; j++) { +- int nodeA = numa_id_index_table[i]; +- int nodeB = numa_id_index_table[j]; +- +- if (nodeA == nodeB) +- numa_distance_table[nodeA][nodeB] = LOCAL_DISTANCE; +- else +- numa_distance_table[nodeA][nodeB] = REMOTE_DISTANCE; +- } +- } ++ form2_distances = NULL; // don't use it + } +- + distance_index = 0; + for (i = 0; i < max_numa_index; i++) { + for (j = 0; j < max_numa_index; j++) { + int nodeA = numa_id_index_table[i]; + int nodeB = numa_id_index_table[j]; +- +- numa_distance_table[nodeA][nodeB] = form2_distances[distance_index++]; +- pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, numa_distance_table[nodeA][nodeB]); ++ int dist; ++ ++ if (form2_distances) ++ dist = form2_distances[distance_index++]; ++ else if (nodeA == nodeB) ++ dist = LOCAL_DISTANCE; ++ else ++ dist = REMOTE_DISTANCE; ++ numa_distance_table[nodeA][nodeB] = dist; ++ pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, dist); + } + } ++ + of_node_put(root); + } + +-- +2.33.0 + diff --git a/queue-5.15/powerpc-pseries-rename-numa_dist_table-to-form2_dist.patch b/queue-5.15/powerpc-pseries-rename-numa_dist_table-to-form2_dist.patch new file mode 100644 index 00000000000..397ab100b4f --- /dev/null +++ b/queue-5.15/powerpc-pseries-rename-numa_dist_table-to-form2_dist.patch @@ -0,0 +1,79 @@ +From d20fefbdaf7199ca586b730e7c1e7268060ef97a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Nov 2021 16:48:59 +1000 +Subject: powerpc/pseries: rename numa_dist_table to form2_distances + +From: Nicholas Piggin + +[ Upstream commit 0bd81274e3f1195ee7c820ef02d62f31077c42c3 ] + +The name of the local variable holding the "form2" property address +conflicts with the numa_distance_table global. + +This patch does 's/numa_dist_table/form2_distances/g' over the function, +which also renames numa_dist_table_length to form2_distances_length. + +Suggested-by: Michael Ellerman +Signed-off-by: Nicholas Piggin +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20211109064900.2041386-1-npiggin@gmail.com +Signed-off-by: Sasha Levin +--- + arch/powerpc/mm/numa.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 6f14c8fb6359d..53e9901409163 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -376,9 +376,9 @@ static void initialize_form2_numa_distance_lookup_table(void) + { + int i, j; + struct device_node *root; +- const __u8 *numa_dist_table; ++ const __u8 *form2_distances; + const __be32 *numa_lookup_index; +- int numa_dist_table_length; ++ int form2_distances_length; + int max_numa_index, distance_index; + + if (firmware_has_feature(FW_FEATURE_OPAL)) +@@ -392,20 +392,20 @@ static void initialize_form2_numa_distance_lookup_table(void) + max_numa_index = of_read_number(&numa_lookup_index[0], 1); + + /* first element of the array is the size and is encode-int */ +- numa_dist_table = of_get_property(root, "ibm,numa-distance-table", NULL); +- numa_dist_table_length = of_read_number((const __be32 *)&numa_dist_table[0], 1); ++ form2_distances = of_get_property(root, "ibm,numa-distance-table", NULL); ++ form2_distances_length = of_read_number((const __be32 *)&form2_distances[0], 1); + /* Skip the size which is encoded int */ +- numa_dist_table += sizeof(__be32); ++ form2_distances += sizeof(__be32); + +- pr_debug("numa_dist_table_len = %d, numa_dist_indexes_len = %d\n", +- numa_dist_table_length, max_numa_index); ++ pr_debug("form2_distances_len = %d, numa_dist_indexes_len = %d\n", ++ form2_distances_length, max_numa_index); + + for (i = 0; i < max_numa_index; i++) + /* +1 skip the max_numa_index in the property */ + numa_id_index_table[i] = of_read_number(&numa_lookup_index[i + 1], 1); + + +- if (numa_dist_table_length != max_numa_index * max_numa_index) { ++ if (form2_distances_length != max_numa_index * max_numa_index) { + WARN(1, "Wrong NUMA distance information\n"); + /* consider everybody else just remote. */ + for (i = 0; i < max_numa_index; i++) { +@@ -427,7 +427,7 @@ static void initialize_form2_numa_distance_lookup_table(void) + int nodeA = numa_id_index_table[i]; + int nodeB = numa_id_index_table[j]; + +- numa_distance_table[nodeA][nodeB] = numa_dist_table[distance_index++]; ++ numa_distance_table[nodeA][nodeB] = form2_distances[distance_index++]; + pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, numa_distance_table[nodeA][nodeB]); + } + } +-- +2.33.0 + diff --git a/queue-5.15/s390-kexec-fix-return-code-handling.patch b/queue-5.15/s390-kexec-fix-return-code-handling.patch new file mode 100644 index 00000000000..49831ab14ca --- /dev/null +++ b/queue-5.15/s390-kexec-fix-return-code-handling.patch @@ -0,0 +1,80 @@ +From 246c07dbd9cbe7e2bda27e786bf74f2e553a65fe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Nov 2021 11:06:38 +0100 +Subject: s390/kexec: fix return code handling + +From: Heiko Carstens + +[ Upstream commit 20c76e242e7025bd355619ba67beb243ba1a1e95 ] + +kexec_file_add_ipl_report ignores that ipl_report_finish may fail and +can return an error pointer instead of a valid pointer. +Fix this and simplify by returning NULL in case of an error and let +the only caller handle this case. + +Fixes: 99feaa717e55 ("s390/kexec_file: Create ipl report and pass to next kernel") +Signed-off-by: Heiko Carstens +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/ipl.c | 3 ++- + arch/s390/kernel/machine_kexec_file.c | 8 +++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c +index e2cc35775b996..5ad1dde23dc59 100644 +--- a/arch/s390/kernel/ipl.c ++++ b/arch/s390/kernel/ipl.c +@@ -2156,7 +2156,7 @@ void *ipl_report_finish(struct ipl_report *report) + + buf = vzalloc(report->size); + if (!buf) +- return ERR_PTR(-ENOMEM); ++ goto out; + ptr = buf; + + memcpy(ptr, report->ipib, report->ipib->hdr.len); +@@ -2195,6 +2195,7 @@ void *ipl_report_finish(struct ipl_report *report) + } + + BUG_ON(ptr > buf + report->size); ++out: + return buf; + } + +diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c +index f9e4baa64b675..c1090f0b1f6a6 100644 +--- a/arch/s390/kernel/machine_kexec_file.c ++++ b/arch/s390/kernel/machine_kexec_file.c +@@ -170,6 +170,7 @@ static int kexec_file_add_ipl_report(struct kimage *image, + struct kexec_buf buf; + unsigned long addr; + void *ptr, *end; ++ int ret; + + buf.image = image; + +@@ -199,7 +200,10 @@ static int kexec_file_add_ipl_report(struct kimage *image, + ptr += len; + } + ++ ret = -ENOMEM; + buf.buffer = ipl_report_finish(data->report); ++ if (!buf.buffer) ++ goto out; + buf.bufsz = data->report->size; + buf.memsz = buf.bufsz; + +@@ -209,7 +213,9 @@ static int kexec_file_add_ipl_report(struct kimage *image, + data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr); + *lc_ipl_parmblock_ptr = (__u32)buf.mem; + +- return kexec_add_buffer(&buf); ++ ret = kexec_add_buffer(&buf); ++out: ++ return ret; + } + + void *kexec_file_add_components(struct kimage *image, +-- +2.33.0 + diff --git a/queue-5.15/series b/queue-5.15/series index d8e3b474667..8ae1ce3d726 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -175,3 +175,14 @@ ptp-ocp-fix-a-couple-null-vs-is_err-checks.patch perf-bench-fix-two-memory-leaks-detected-with-asan.patch tools-build-fix-removal-of-feature-sync-compare-and-.patch riscv-fix-building-external-modules.patch +kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch +powerpc-clean-vdso32-and-vdso64-directories.patch +powerpc-pseries-rename-numa_dist_table-to-form2_dist.patch +powerpc-pseries-fix-numa-form2-parsing-fallback-code.patch +pinctrl-qcom-sdm845-enable-dual-edge-errata.patch +pinctrl-qcom-sm8350-correct-ufs-and-sdc-offsets.patch +perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch +perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch +perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch-26758 +s390-kexec-fix-return-code-handling.patch +blk-cgroup-fix-missing-put-device-in-error-path-from.patch