diff options
author | Sasha Levin <sashal@kernel.org> | 2024-05-07 07:49:16 -0400 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2024-05-07 07:49:16 -0400 |
commit | 02c79caef9ae14e9a0e17356ab1a0dc2593b4387 (patch) | |
tree | cebbdd257f6bd0c34e93a66458ec30cecf8b697c | |
parent | 485763495f7bc8a5f3a30481a7f6dc48a66b9cc1 (diff) | |
download | stable-queue-02c79caef9ae14e9a0e17356ab1a0dc2593b4387.tar.gz |
Fixes for 6.8
Signed-off-by: Sasha Levin <sashal@kernel.org>
7 files changed, 383 insertions, 0 deletions
diff --git a/queue-6.8/clk-qcom-smd-rpm-restore-msm8976-num_clk.patch b/queue-6.8/clk-qcom-smd-rpm-restore-msm8976-num_clk.patch new file mode 100644 index 0000000000..672db6825b --- /dev/null +++ b/queue-6.8/clk-qcom-smd-rpm-restore-msm8976-num_clk.patch @@ -0,0 +1,36 @@ +From 49d40f39f39d9b5caa2e32de5f982e392c64580a Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Mon, 1 Apr 2024 19:16:39 +0200 +Subject: clk: qcom: smd-rpm: Restore msm8976 num_clk + +From: Adam Skladowski <a39.skl@gmail.com> + +[ Upstream commit 0d4ce2458cd7d1d66a5ee2f3c036592fb663d5bc ] + +During rework somehow msm8976 num_clk got removed, restore it. + +Fixes: d6edc31f3a68 ("clk: qcom: smd-rpm: Separate out interconnect bus clocks") +Signed-off-by: Adam Skladowski <a39.skl@gmail.com> +Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> +Link: https://lore.kernel.org/r/20240401171641.8979-1-a39.skl@gmail.com +Signed-off-by: Bjorn Andersson <andersson@kernel.org> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + drivers/clk/qcom/clk-smd-rpm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c +index 8602c02047d04..45c5255bcd11b 100644 +--- a/drivers/clk/qcom/clk-smd-rpm.c ++++ b/drivers/clk/qcom/clk-smd-rpm.c +@@ -768,6 +768,7 @@ static struct clk_smd_rpm *msm8976_clks[] = { + + static const struct rpm_smd_clk_desc rpm_clk_msm8976 = { + .clks = msm8976_clks, ++ .num_clks = ARRAY_SIZE(msm8976_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), + }; +-- +2.43.0 + diff --git a/queue-6.8/clk-sunxi-ng-h6-reparent-cpux-during-pll-cpux-rate-c.patch b/queue-6.8/clk-sunxi-ng-h6-reparent-cpux-during-pll-cpux-rate-c.patch new file mode 100644 index 0000000000..8840ba83f9 --- /dev/null +++ b/queue-6.8/clk-sunxi-ng-h6-reparent-cpux-during-pll-cpux-rate-c.patch @@ -0,0 +1,72 @@ +From 980e6690947bc799e2e649a20f956cf5d65e7306 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Fri, 13 Oct 2023 20:17:12 +0200 +Subject: clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change + +From: Jernej Skrabec <jernej.skrabec@gmail.com> + +[ Upstream commit 7e91ed763dc07437777bd012af7a2bd4493731ff ] + +While PLL CPUX clock rate change when CPU is running from it works in +vast majority of cases, now and then it causes instability. This leads +to system crashes and other undefined behaviour. After a lot of testing +(30+ hours) while also doing a lot of frequency switches, we can't +observe any instability issues anymore when doing reparenting to stable +clock like 24 MHz oscillator. + +Fixes: 524353ea480b ("clk: sunxi-ng: add support for the Allwinner H6 CCU") +Reported-by: Chad Wagner <wagnerch42@gmail.com> +Link: https://forum.libreelec.tv/thread/27295-orange-pi-3-lts-freezes/ +Tested-by: Chad Wagner <wagnerch42@gmail.com> +Reviewed-by: Chen-Yu Tsai <wens@csie.org> +Link: https://lore.kernel.org/r/20231013181712.2128037-1-jernej.skrabec@gmail.com +Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +index 42568c6161814..892df807275c8 100644 +--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c ++++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +@@ -1181,11 +1181,18 @@ static const u32 usb2_clk_regs[] = { + SUN50I_H6_USB3_CLK_REG, + }; + ++static struct ccu_mux_nb sun50i_h6_cpu_nb = { ++ .common = &cpux_clk.common, ++ .cm = &cpux_clk.mux, ++ .delay_us = 1, ++ .bypass_index = 0, /* index of 24 MHz oscillator */ ++}; ++ + static int sun50i_h6_ccu_probe(struct platform_device *pdev) + { + void __iomem *reg; ++ int i, ret; + u32 val; +- int i; + + reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(reg)) +@@ -1252,7 +1259,15 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev) + val |= BIT(24); + writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG); + +- return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_h6_ccu_desc); ++ ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_h6_ccu_desc); ++ if (ret) ++ return ret; ++ ++ /* Reparent CPU during PLL CPUX rate changes */ ++ ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk, ++ &sun50i_h6_cpu_nb); ++ ++ return 0; + } + + static const struct of_device_id sun50i_h6_ccu_ids[] = { +-- +2.43.0 + diff --git a/queue-6.8/edac-versal-do-not-log-total-error-counts.patch b/queue-6.8/edac-versal-do-not-log-total-error-counts.patch new file mode 100644 index 0000000000..96e33b0e07 --- /dev/null +++ b/queue-6.8/edac-versal-do-not-log-total-error-counts.patch @@ -0,0 +1,48 @@ +From 1bcf1eb23bdd412477d858ed871b45ffc98fc139 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Thu, 25 Apr 2024 17:49:42 +0530 +Subject: EDAC/versal: Do not log total error counts + +From: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com> + +[ Upstream commit 1a24733e80771d8eef656e515306a560519856a9 ] + +When logging errors, the driver currently logs the total error count. +However, it should log the current error only. Fix it. + + [ bp: Rewrite text. ] + +Fixes: 6f15b178cd63 ("EDAC/versal: Add a Xilinx Versal memory controller driver") +Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com> +Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> +Link: https://lore.kernel.org/r/20240425121942.26378-4-shubhrajyoti.datta@amd.com +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + drivers/edac/versal_edac.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/edac/versal_edac.c b/drivers/edac/versal_edac.c +index 62caf454b5670..a840c6922e5b9 100644 +--- a/drivers/edac/versal_edac.c ++++ b/drivers/edac/versal_edac.c +@@ -423,7 +423,7 @@ static void handle_error(struct mem_ctl_info *mci, struct ecc_status *stat) + convert_to_physical(priv, pinf), pinf.burstpos); + + edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, +- priv->ce_cnt, 0, 0, 0, 0, 0, -1, ++ 1, 0, 0, 0, 0, 0, -1, + priv->message, ""); + } + +@@ -436,7 +436,7 @@ static void handle_error(struct mem_ctl_info *mci, struct ecc_status *stat) + convert_to_physical(priv, pinf), pinf.burstpos); + + edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, +- priv->ue_cnt, 0, 0, 0, 0, 0, -1, ++ 1, 0, 0, 0, 0, 0, -1, + priv->message, ""); + } + +-- +2.43.0 + diff --git a/queue-6.8/powerpc-pseries-iommu-lpar-panics-during-boot-up-wit.patch b/queue-6.8/powerpc-pseries-iommu-lpar-panics-during-boot-up-wit.patch new file mode 100644 index 0000000000..6242f3218b --- /dev/null +++ b/queue-6.8/powerpc-pseries-iommu-lpar-panics-during-boot-up-wit.patch @@ -0,0 +1,83 @@ +From 286fb5de6fa91b2cde59be5fd24ad8f1fbbf08e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Mon, 22 Apr 2024 15:51:41 -0500 +Subject: powerpc/pseries/iommu: LPAR panics during boot up with a frozen PE + +From: Gaurav Batra <gbatra@linux.ibm.com> + +[ Upstream commit 49a940dbdc3107fecd5e6d3063dc07128177e058 ] + +At the time of LPAR boot up, partition firmware provides Open Firmware +property ibm,dma-window for the PE. This property is provided on the PCI +bus the PE is attached to. + +There are execptions where the partition firmware might not provide this +property for the PE at the time of LPAR boot up. One of the scenario is +where the firmware has frozen the PE due to some error condition. This +PE is frozen for 24 hours or unless the whole system is reinitialized. + +Within this time frame, if the LPAR is booted, the frozen PE will be +presented to the LPAR but ibm,dma-window property could be missing. + +Today, under these circumstances, the LPAR oopses with NULL pointer +dereference, when configuring the PCI bus the PE is attached to. + + BUG: Kernel NULL pointer dereference on read at 0x000000c8 + Faulting instruction address: 0xc0000000001024c0 + Oops: Kernel access of bad area, sig: 7 [#1] + LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries + Modules linked in: + Supported: Yes + CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-150600.9-default #1 + Hardware name: IBM,9043-MRX POWER10 (raw) 0x800200 0xf000006 of:IBM,FW1060.00 (NM1060_023) hv:phyp pSeries + NIP: c0000000001024c0 LR: c0000000001024b0 CTR: c000000000102450 + REGS: c0000000037db5c0 TRAP: 0300 Not tainted (6.4.0-150600.9-default) + MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 28000822 XER: 00000000 + CFAR: c00000000010254c DAR: 00000000000000c8 DSISR: 00080000 IRQMASK: 0 + ... + NIP [c0000000001024c0] pci_dma_bus_setup_pSeriesLP+0x70/0x2a0 + LR [c0000000001024b0] pci_dma_bus_setup_pSeriesLP+0x60/0x2a0 + Call Trace: + pci_dma_bus_setup_pSeriesLP+0x60/0x2a0 (unreliable) + pcibios_setup_bus_self+0x1c0/0x370 + __of_scan_bus+0x2f8/0x330 + pcibios_scan_phb+0x280/0x3d0 + pcibios_init+0x88/0x12c + do_one_initcall+0x60/0x320 + kernel_init_freeable+0x344/0x3e4 + kernel_init+0x34/0x1d0 + ret_from_kernel_user_thread+0x14/0x1c + +Fixes: b1fc44eaa9ba ("pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window") +Signed-off-by: Gaurav Batra <gbatra@linux.ibm.com> +Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> +Link: https://msgid.link/20240422205141.10662-1-gbatra@linux.ibm.com +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + arch/powerpc/platforms/pseries/iommu.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c +index e8c4129697b14..b1e6d275cda9e 100644 +--- a/arch/powerpc/platforms/pseries/iommu.c ++++ b/arch/powerpc/platforms/pseries/iommu.c +@@ -786,8 +786,16 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) + * parent bus. During reboot, there will be ibm,dma-window property to + * define DMA window. For kdump, there will at least be default window or DDW + * or both. ++ * There is an exception to the above. In case the PE goes into frozen ++ * state, firmware may not provide ibm,dma-window property at the time ++ * of LPAR boot up. + */ + ++ if (!pdn) { ++ pr_debug(" no ibm,dma-window property !\n"); ++ return; ++ } ++ + ppci = PCI_DN(pdn); + + pr_debug(" parent is %pOF, iommu_table: 0x%p\n", +-- +2.43.0 + diff --git a/queue-6.8/powerpc-pseries-make-max-polling-consistent-for-long.patch b/queue-6.8/powerpc-pseries-make-max-polling-consistent-for-long.patch new file mode 100644 index 0000000000..322208d266 --- /dev/null +++ b/queue-6.8/powerpc-pseries-make-max-polling-consistent-for-long.patch @@ -0,0 +1,76 @@ +From 4e7e86a87bc2907cb0c352c01a9c164f6c665d24 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Wed, 17 Apr 2024 23:12:30 -0400 +Subject: powerpc/pseries: make max polling consistent for longer H_CALLs + +From: Nayna Jain <nayna@linux.ibm.com> + +[ Upstream commit 784354349d2c988590c63a5a001ca37b2a6d4da1 ] + +Currently, plpks_confirm_object_flushed() function polls for 5msec in +total instead of 5sec. + +Keep max polling time consistent for all the H_CALLs, which take longer +than expected, to be 5sec. Also, make use of fsleep() everywhere to +insert delay. + +Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com> +Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore") +Signed-off-by: Nayna Jain <nayna@linux.ibm.com> +Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com> +Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> +Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> +Link: https://msgid.link/20240418031230.170954-1-nayna@linux.ibm.com +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + arch/powerpc/include/asm/plpks.h | 5 ++--- + arch/powerpc/platforms/pseries/plpks.c | 10 +++++----- + 2 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h +index 23b77027c9163..7a84069759b03 100644 +--- a/arch/powerpc/include/asm/plpks.h ++++ b/arch/powerpc/include/asm/plpks.h +@@ -44,9 +44,8 @@ + #define PLPKS_MAX_DATA_SIZE 4000 + + // Timeouts for PLPKS operations +-#define PLPKS_MAX_TIMEOUT 5000 // msec +-#define PLPKS_FLUSH_SLEEP 10 // msec +-#define PLPKS_FLUSH_SLEEP_RANGE 400 ++#define PLPKS_MAX_TIMEOUT (5 * USEC_PER_SEC) ++#define PLPKS_FLUSH_SLEEP 10000 // usec + + struct plpks_var { + char *component; +diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c +index febe18f251d0c..4a595493d28ae 100644 +--- a/arch/powerpc/platforms/pseries/plpks.c ++++ b/arch/powerpc/platforms/pseries/plpks.c +@@ -415,8 +415,7 @@ static int plpks_confirm_object_flushed(struct label *label, + break; + } + +- usleep_range(PLPKS_FLUSH_SLEEP, +- PLPKS_FLUSH_SLEEP + PLPKS_FLUSH_SLEEP_RANGE); ++ fsleep(PLPKS_FLUSH_SLEEP); + timeout = timeout + PLPKS_FLUSH_SLEEP; + } while (timeout < PLPKS_MAX_TIMEOUT); + +@@ -464,9 +463,10 @@ int plpks_signed_update_var(struct plpks_var *var, u64 flags) + + continuetoken = retbuf[0]; + if (pseries_status_to_err(rc) == -EBUSY) { +- int delay_ms = get_longbusy_msecs(rc); +- mdelay(delay_ms); +- timeout += delay_ms; ++ int delay_us = get_longbusy_msecs(rc) * 1000; ++ ++ fsleep(delay_us); ++ timeout += delay_us; + } + rc = pseries_status_to_err(rc); + } while (rc == -EBUSY && timeout < PLPKS_MAX_TIMEOUT); +-- +2.43.0 + diff --git a/queue-6.8/series b/queue-6.8/series index a67e674ad2..07e55fc3f1 100644 --- a/queue-6.8/series +++ b/queue-6.8/series @@ -85,3 +85,9 @@ ipv4-fix-uninit-value-access-in-__ip_make_skb.patch net-gro-fix-udp-bad-offset-in-socket-lookup-by-addin.patch net-gro-add-flush-check-in-udp_gro_receive_segment.patch drm-xe-display-fix-adl-n-detection.patch +clk-qcom-smd-rpm-restore-msm8976-num_clk.patch +clk-sunxi-ng-h6-reparent-cpux-during-pll-cpux-rate-c.patch +powerpc-pseries-make-max-polling-consistent-for-long.patch +powerpc-pseries-iommu-lpar-panics-during-boot-up-wit.patch +edac-versal-do-not-log-total-error-counts.patch +swiotlb-initialise-restricted-pool-list_head-when-sw.patch diff --git a/queue-6.8/swiotlb-initialise-restricted-pool-list_head-when-sw.patch b/queue-6.8/swiotlb-initialise-restricted-pool-list_head-when-sw.patch new file mode 100644 index 0000000000..8c4fc97beb --- /dev/null +++ b/queue-6.8/swiotlb-initialise-restricted-pool-list_head-when-sw.patch @@ -0,0 +1,62 @@ +From 4459506723575d5d77e94e6e95583bc3c7a71506 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Thu, 2 May 2024 10:37:23 +0100 +Subject: swiotlb: initialise restricted pool list_head when SWIOTLB_DYNAMIC=y + +From: Will Deacon <will@kernel.org> + +[ Upstream commit 75961ffb5cb3e5196f19cae7683f35cc88b50800 ] + +Using restricted DMA pools (CONFIG_DMA_RESTRICTED_POOL=y) in conjunction +with dynamic SWIOTLB (CONFIG_SWIOTLB_DYNAMIC=y) leads to the following +crash when initialising the restricted pools at boot-time: + + | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 + | Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP + | pc : rmem_swiotlb_device_init+0xfc/0x1ec + | lr : rmem_swiotlb_device_init+0xf0/0x1ec + | Call trace: + | rmem_swiotlb_device_init+0xfc/0x1ec + | of_reserved_mem_device_init_by_idx+0x18c/0x238 + | of_dma_configure_id+0x31c/0x33c + | platform_dma_configure+0x34/0x80 + +faddr2line reveals that the crash is in the list validation code: + + include/linux/list.h:83 + include/linux/rculist.h:79 + include/linux/rculist.h:106 + kernel/dma/swiotlb.c:306 + kernel/dma/swiotlb.c:1695 + +because add_mem_pool() is trying to list_add_rcu() to a NULL +'mem->pools'. + +Fix the crash by initialising the 'mem->pools' list_head in +rmem_swiotlb_device_init() before calling add_mem_pool(). + +Reported-by: Nikita Ioffe <ioffe@google.com> +Tested-by: Nikita Ioffe <ioffe@google.com> +Fixes: 1aaa736815eb ("swiotlb: allocate a new memory pool when existing pools are full") +Signed-off-by: Will Deacon <will@kernel.org> +Signed-off-by: Christoph Hellwig <hch@lst.de> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + kernel/dma/swiotlb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c +index 877c4b8fad195..1955b42f42fc9 100644 +--- a/kernel/dma/swiotlb.c ++++ b/kernel/dma/swiotlb.c +@@ -1717,6 +1717,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem, + mem->for_alloc = true; + #ifdef CONFIG_SWIOTLB_DYNAMIC + spin_lock_init(&mem->lock); ++ INIT_LIST_HEAD_RCU(&mem->pools); + #endif + add_mem_pool(mem, pool); + +-- +2.43.0 + |