From: Greg Kroah-Hartman Date: Fri, 31 Jan 2025 08:56:42 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v6.13.1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f887fd21cea080cad7b9638d31589425a2e81e4;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: partial-revert-of-xhci-use-pm_ptr-instead-ifdef-for-config_pm-conditionals.patch xhci-use-pm_ptr-instead-of-ifdef-for-config_pm-conditionals.patch --- diff --git a/queue-5.4/partial-revert-of-xhci-use-pm_ptr-instead-ifdef-for-config_pm-conditionals.patch b/queue-5.4/partial-revert-of-xhci-use-pm_ptr-instead-ifdef-for-config_pm-conditionals.patch new file mode 100644 index 0000000000..60cb5b3d4c --- /dev/null +++ b/queue-5.4/partial-revert-of-xhci-use-pm_ptr-instead-ifdef-for-config_pm-conditionals.patch @@ -0,0 +1,61 @@ +From 448fe5a1a4b538b235a43e57863c3a078bd13b01 Mon Sep 17 00:00:00 2001 +From: Ron Economos +Date: Sat, 18 Jan 2025 04:24:09 -0800 +Subject: Partial revert of xhci: use pm_ptr() instead #ifdef for CONFIG_PM conditionals + +From: Ron Economos + +commit 448fe5a1a4b538b235a43e57863c3a078bd13b01 upstream. + +commit 9734fd7a2777 ("xhci: use pm_ptr() instead of #ifdef for CONFIG_PM +conditionals") did not quite work properly in the 5.15.y branch where it was +applied to fix a build error when CONFIG_PM was set as it left the following +build errors still present: + + ERROR: modpost: "xhci_suspend" [drivers/usb/host/xhci-pci.ko] undefined! + ERROR: modpost: "xhci_resume" [drivers/usb/host/xhci-pci.ko] undefined! + +Fix this up by properly placing the #ifdef CONFIG_PM in the xhci-pci.c and +hcd.h files to handle this correctly. + +Link: https://lore.kernel.org/r/133dbfa0-4a37-4ae0-bb95-1a35f668ec11@w6rz.net +Signed-off-by: Ron Economos +Link: https://lore.kernel.org/r/d0919169-ee06-4bdd-b2e3-2f776db90971@roeck-us.net +Reported-by: Guenter Roeck +[ Trimmed the partial revert down to an even smaller bit to only be what + is required to fix the build error - gregkh] +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -518,6 +518,7 @@ static void xhci_pci_remove(struct pci_d + usb_hcd_pci_remove(dev); + } + ++#ifdef CONFIG_PM + /* + * In some Intel xHCI controllers, in order to get D3 working, + * through a vendor specific SSIC CONFIG register at offset 0x883c, +@@ -658,6 +659,7 @@ static void xhci_pci_shutdown(struct usb + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) + pci_set_power_state(pdev, PCI_D3hot); + } ++#endif /* CONFIG_PM */ + + /*-------------------------------------------------------------------------*/ + +@@ -689,9 +691,11 @@ static struct pci_driver xhci_pci_driver + static int __init xhci_pci_init(void) + { + xhci_init_driver(&xhci_pci_hc_driver, &xhci_pci_overrides); ++#ifdef CONFIG_PM + xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend; + xhci_pci_hc_driver.pci_resume = xhci_pci_resume; + xhci_pci_hc_driver.shutdown = xhci_pci_shutdown; ++#endif + return pci_register_driver(&xhci_pci_driver); + } + module_init(xhci_pci_init); diff --git a/queue-5.4/series b/queue-5.4/series index f429096b3c..d081455190 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -90,3 +90,5 @@ input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch input-xpad-add-support-for-wooting-two-he-arm.patch drm-v3d-assign-job-pointer-to-null-before-signaling-the-fence.patch +xhci-use-pm_ptr-instead-of-ifdef-for-config_pm-conditionals.patch +partial-revert-of-xhci-use-pm_ptr-instead-ifdef-for-config_pm-conditionals.patch diff --git a/queue-5.4/xhci-use-pm_ptr-instead-of-ifdef-for-config_pm-conditionals.patch b/queue-5.4/xhci-use-pm_ptr-instead-of-ifdef-for-config_pm-conditionals.patch new file mode 100644 index 0000000000..61bfc7e52d --- /dev/null +++ b/queue-5.4/xhci-use-pm_ptr-instead-of-ifdef-for-config_pm-conditionals.patch @@ -0,0 +1,106 @@ +From 0bd4efe3226d229189573d9881aec868700d9293 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 28 Mar 2023 15:10:43 +0200 +Subject: xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals + +From: Arnd Bergmann + +commit 130eac4170859fb368681e00d390f20f44bbf27b upstream. + +A recent patch caused an unused-function warning in builds with +CONFIG_PM disabled, after the function became marked 'static': + +drivers/usb/host/xhci-pci.c:91:13: error: 'xhci_msix_sync_irqs' defined but not used [-Werror=unused-function] + 91 | static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) + | ^~~~~~~~~~~~~~~~~~~ + +This could be solved by adding another #ifdef, but as there is +a trend towards removing CONFIG_PM checks in favor of helper +macros, do the same conversion here and use pm_ptr() to get +either a function pointer or NULL but avoid the warning. + +As the hidden functions reference some other symbols, make +sure those are visible at compile time, at the minimal cost of +a few extra bytes for 'struct usb_device'. + +Fixes: 9abe15d55dcc ("xhci: Move xhci MSI sync function to to xhci-pci") +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20230328131114.1296430-1-arnd@kernel.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 8 +------- + include/linux/usb.h | 3 +-- + include/linux/usb/hcd.h | 2 -- + 3 files changed, 2 insertions(+), 11 deletions(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -518,7 +518,6 @@ static void xhci_pci_remove(struct pci_d + usb_hcd_pci_remove(dev); + } + +-#ifdef CONFIG_PM + /* + * In some Intel xHCI controllers, in order to get D3 working, + * through a vendor specific SSIC CONFIG register at offset 0x883c, +@@ -659,7 +658,6 @@ static void xhci_pci_shutdown(struct usb + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) + pci_set_power_state(pdev, PCI_D3hot); + } +-#endif /* CONFIG_PM */ + + /*-------------------------------------------------------------------------*/ + +@@ -683,21 +681,17 @@ static struct pci_driver xhci_pci_driver + /* suspend and resume implemented later */ + + .shutdown = usb_hcd_pci_shutdown, +-#ifdef CONFIG_PM + .driver = { +- .pm = &usb_hcd_pci_pm_ops ++ .pm = pm_ptr(&usb_hcd_pci_pm_ops), + }, +-#endif + }; + + static int __init xhci_pci_init(void) + { + xhci_init_driver(&xhci_pci_hc_driver, &xhci_pci_overrides); +-#ifdef CONFIG_PM + xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend; + xhci_pci_hc_driver.pci_resume = xhci_pci_resume; + xhci_pci_hc_driver.shutdown = xhci_pci_shutdown; +-#endif + return pci_register_driver(&xhci_pci_driver); + } + module_init(xhci_pci_init); +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -699,13 +699,12 @@ struct usb_device { + + unsigned long active_duration; + +-#ifdef CONFIG_PM + unsigned long connect_time; + + unsigned do_remote_wakeup:1; + unsigned reset_resume:1; + unsigned port_is_suspended:1; +-#endif ++ + struct wusb_dev *wusb_dev; + int slot_id; + enum usb_device_removable removable; +--- a/include/linux/usb/hcd.h ++++ b/include/linux/usb/hcd.h +@@ -488,9 +488,7 @@ extern void usb_hcd_pci_shutdown(struct + + extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); + +-#ifdef CONFIG_PM + extern const struct dev_pm_ops usb_hcd_pci_pm_ops; +-#endif + #endif /* CONFIG_USB_PCI */ + + /* pci-ish (pdev null is ok) buffer alloc/mapping support */