From afbff286ceef1d94d8d465d7e0c14877dadf9d7d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 Nov 2023 11:40:47 +0000 Subject: [PATCH] 5.10-stable patches added patches: parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch parisc-power-fix-power-soft-off-when-running-on-qemu.patch parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch xhci-enable-rpm-on-controllers-that-support-low-power-states.patch --- ...r-5-address-bits-of-physical-address.patch | 49 +++++++++++++++++++ ...-power-soft-off-when-running-on-qemu.patch | 31 ++++++++++++ ...ing-64-bit-kernels-on-pa1.x-machines.patch | 35 +++++++++++++ queue-5.10/series | 4 ++ ...ollers-that-support-low-power-states.patch | 37 ++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 queue-5.10/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch create mode 100644 queue-5.10/parisc-power-fix-power-soft-off-when-running-on-qemu.patch create mode 100644 queue-5.10/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch create mode 100644 queue-5.10/xhci-enable-rpm-on-controllers-that-support-low-power-states.patch diff --git a/queue-5.10/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch b/queue-5.10/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch new file mode 100644 index 00000000000..425edefd797 --- /dev/null +++ b/queue-5.10/parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch @@ -0,0 +1,49 @@ +From 166b0110d1ee53290bd11618df6e3991c117495a Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Tue, 7 Nov 2023 14:33:32 +0100 +Subject: parisc/pgtable: Do not drop upper 5 address bits of physical address + +From: Helge Deller + +commit 166b0110d1ee53290bd11618df6e3991c117495a upstream. + +When calculating the pfn for the iitlbt/idtlbt instruction, do not +drop the upper 5 address bits. This doesn't seem to have an effect +on physical hardware which uses less physical address bits, but in +qemu the missing bits are visible. + +Signed-off-by: Helge Deller +Cc: +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/entry.S | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/arch/parisc/kernel/entry.S ++++ b/arch/parisc/kernel/entry.S +@@ -497,13 +497,13 @@ + * to a CPU TLB 4k PFN (4k => 12 bits to shift) */ + #define PAGE_ADD_SHIFT (PAGE_SHIFT-12) + #define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12) ++ #define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT) + + /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ + .macro convert_for_tlb_insert20 pte,tmp + #ifdef CONFIG_HUGETLB_PAGE + copy \pte,\tmp +- extrd,u \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ +- 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte ++ extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte + + depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ + (63-58)+PAGE_ADD_SHIFT,\pte +@@ -511,8 +511,7 @@ + depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\ + (63-58)+PAGE_ADD_HUGE_SHIFT,\pte + #else /* Huge pages disabled */ +- extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ +- 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte ++ extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte + depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ + (63-58)+PAGE_ADD_SHIFT,\pte + #endif diff --git a/queue-5.10/parisc-power-fix-power-soft-off-when-running-on-qemu.patch b/queue-5.10/parisc-power-fix-power-soft-off-when-running-on-qemu.patch new file mode 100644 index 00000000000..1ed60ef366d --- /dev/null +++ b/queue-5.10/parisc-power-fix-power-soft-off-when-running-on-qemu.patch @@ -0,0 +1,31 @@ +From 6ad6e15a9c46b8f0932cd99724f26f3db4db1cdf Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 17 Nov 2023 16:43:52 +0100 +Subject: parisc/power: Fix power soft-off when running on qemu + +From: Helge Deller + +commit 6ad6e15a9c46b8f0932cd99724f26f3db4db1cdf upstream. + +Firmware returns the physical address of the power switch, +so need to use gsc_writel() instead of direct memory access. + +Fixes: d0c219472980 ("parisc/power: Add power soft-off when running on qemu") +Signed-off-by: Helge Deller +Cc: stable@vger.kernel.org # v6.0+ +Signed-off-by: Greg Kroah-Hartman +--- + drivers/parisc/power.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/parisc/power.c ++++ b/drivers/parisc/power.c +@@ -196,7 +196,7 @@ static struct notifier_block parisc_pani + static int qemu_power_off(struct sys_off_data *data) + { + /* this turns the system off via SeaBIOS */ +- *(int *)data->cb_data = 0; ++ gsc_writel(0, (unsigned long) data->cb_data); + pdc_soft_power_button(1); + return NOTIFY_DONE; + } diff --git a/queue-5.10/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch b/queue-5.10/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch new file mode 100644 index 00000000000..d7901c24cbb --- /dev/null +++ b/queue-5.10/parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch @@ -0,0 +1,35 @@ +From a406b8b424fa01f244c1aab02ba186258448c36b Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 10 Nov 2023 16:13:15 +0100 +Subject: parisc: Prevent booting 64-bit kernels on PA1.x machines + +From: Helge Deller + +commit a406b8b424fa01f244c1aab02ba186258448c36b upstream. + +Bail out early with error message when trying to boot a 64-bit kernel on +32-bit machines. This fixes the previous commit to include the check for +true 64-bit kernels as well. + +Signed-off-by: Helge Deller +Fixes: 591d2108f3abc ("parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines") +Cc: # v6.0+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/head.S | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/arch/parisc/kernel/head.S ++++ b/arch/parisc/kernel/head.S +@@ -69,9 +69,8 @@ $bss_loop: + stw,ma %arg2,4(%r1) + stw,ma %arg3,4(%r1) + +-#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20) +- /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU +- * and halt kernel if we detect a PA1.x CPU. */ ++#if defined(CONFIG_PA20) ++ /* check for 64-bit capable CPU as required by current kernel */ + ldi 32,%r10 + mtctl %r10,%cr11 + .level 2.0 diff --git a/queue-5.10/series b/queue-5.10/series index c74b63c7344..ebef35605ec 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -138,6 +138,10 @@ mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch mtd-cfi_cmdset_0001-byte-swap-otp-info.patch i3c-master-cdns-fix-reading-status-register.patch +parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch +parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch +parisc-power-fix-power-soft-off-when-running-on-qemu.patch +xhci-enable-rpm-on-controllers-that-support-low-power-states.patch serial-meson-remove-redundant-initialization-of-vari.patch tty-serial-meson-retrieve-port-fifo-size-from-dt.patch serial-meson-use-platform_get_irq-to-get-the-interru.patch diff --git a/queue-5.10/xhci-enable-rpm-on-controllers-that-support-low-power-states.patch b/queue-5.10/xhci-enable-rpm-on-controllers-that-support-low-power-states.patch new file mode 100644 index 00000000000..5544c178dd9 --- /dev/null +++ b/queue-5.10/xhci-enable-rpm-on-controllers-that-support-low-power-states.patch @@ -0,0 +1,37 @@ +From a5d6264b638efeca35eff72177fd28d149e0764b Mon Sep 17 00:00:00 2001 +From: Basavaraj Natikar +Date: Thu, 19 Oct 2023 13:29:20 +0300 +Subject: xhci: Enable RPM on controllers that support low-power states + +From: Basavaraj Natikar + +commit a5d6264b638efeca35eff72177fd28d149e0764b upstream. + +Use the low-power states of the underlying platform to enable runtime PM. +If the platform doesn't support runtime D3, then enabling default RPM will +result in the controller malfunctioning, as in the case of hotplug devices +not being detected because of a failed interrupt generation. + +Cc: Mario Limonciello +Signed-off-by: Basavaraj Natikar +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20231019102924.2797346-16-mathias.nyman@linux.intel.com +Cc: Oleksandr Natalenko +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -505,7 +505,9 @@ static int xhci_pci_probe(struct pci_dev + /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ + pm_runtime_put_noidle(&dev->dev); + +- if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) ++ if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0) ++ pm_runtime_forbid(&dev->dev); ++ else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) + pm_runtime_allow(&dev->dev); + + dma_set_max_seg_size(&dev->dev, UINT_MAX); -- 2.47.3