xhci: only define xhci_msix_sync_irqs() when CONFIG_PM is set

Message ID 20230327103103.1060696-1-mathias.nyman@linux.intel.com
State New
Headers
Series xhci: only define xhci_msix_sync_irqs() when CONFIG_PM is set |

Commit Message

Mathias Nyman March 27, 2023, 10:31 a.m. UTC
  xhci_msic_sync_irqs() function is only called during suspend, when
CONFIG_PM is set, so don't define it unconditionally.

Fixes: 9abe15d55dcc ("xhci: Move xhci MSI sync function to to xhci-pci")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-pci.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
  

Comments

Greg KH March 27, 2023, 12:02 p.m. UTC | #1
On Mon, Mar 27, 2023 at 01:31:03PM +0300, Mathias Nyman wrote:
> xhci_msic_sync_irqs() function is only called during suspend, when
> CONFIG_PM is set, so don't define it unconditionally.
> 
> Fixes: 9abe15d55dcc ("xhci: Move xhci MSI sync function to to xhci-pci")
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
> ---
>  drivers/usb/host/xhci-pci.c | 27 ++++++++++++++-------------
>  1 file changed, 14 insertions(+), 13 deletions(-)

No linux-usb?
  
Mathias Nyman March 27, 2023, 1:39 p.m. UTC | #2
On 27.3.2023 15.02, Greg KH wrote:
> On Mon, Mar 27, 2023 at 01:31:03PM +0300, Mathias Nyman wrote:
>> xhci_msic_sync_irqs() function is only called during suspend, when
>> CONFIG_PM is set, so don't define it unconditionally.
>>
>> Fixes: 9abe15d55dcc ("xhci: Move xhci MSI sync function to to xhci-pci")
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>> ---
>>   drivers/usb/host/xhci-pci.c | 27 ++++++++++++++-------------
>>   1 file changed, 14 insertions(+), 13 deletions(-)
> 
> No linux-usb?
> 

Oh, right, linux-usb was missing.
Now sent there separately as well

Thanks
Mathias
  

Patch

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index a53ecc8ff8c5..1e826a159b96 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -88,19 +88,6 @@  static const struct xhci_driver_overrides xhci_pci_overrides __initconst = {
 	.update_hub_device = xhci_pci_update_hub_device,
 };
 
-static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
-{
-	struct usb_hcd *hcd = xhci_to_hcd(xhci);
-
-	if (hcd->msix_enabled) {
-		struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
-		int i;
-
-		for (i = 0; i < xhci->msix_count; i++)
-			synchronize_irq(pci_irq_vector(pdev, i));
-	}
-}
-
 /* Free any IRQs and disable MSI-X */
 static void xhci_cleanup_msix(struct xhci_hcd *xhci)
 {
@@ -729,6 +716,20 @@  static void xhci_pci_remove(struct pci_dev *dev)
 }
 
 #ifdef CONFIG_PM
+
+static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
+{
+	struct usb_hcd *hcd = xhci_to_hcd(xhci);
+
+	if (hcd->msix_enabled) {
+		struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+		int i;
+
+		for (i = 0; i < xhci->msix_count; i++)
+			synchronize_irq(pci_irq_vector(pdev, i));
+	}
+}
+
 /*
  * In some Intel xHCI controllers, in order to get D3 working,
  * through a vendor specific SSIC CONFIG register at offset 0x883c,