Commit 0c540438 authored by Josue David Hernandez Gutierrez's avatar Josue David Hernandez Gutierrez Committed by Greg Kroah-Hartman

xhci: Call MSI sync function from xhci-pci instead of generic xhci code

Call function to sync MSI interrupts from pci specific xhci_pci_suspend()
function in xhci-pci.c instead of from generic xhci_suspend()

[commit message rewording -Mathias]
Signed-off-by: default avatarJosue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230317154715.535523-14-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba47b1aa
...@@ -779,6 +779,7 @@ static void xhci_sparse_control_quirk(struct usb_hcd *hcd) ...@@ -779,6 +779,7 @@ static void xhci_sparse_control_quirk(struct usb_hcd *hcd)
writel(reg, hcd->regs + SPARSE_CNTL_ENABLE); writel(reg, hcd->regs + SPARSE_CNTL_ENABLE);
} }
extern void xhci_msix_sync_irqs(struct xhci_hcd *xhci);
static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
{ {
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
...@@ -802,6 +803,10 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) ...@@ -802,6 +803,10 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
xhci_sparse_control_quirk(hcd); xhci_sparse_control_quirk(hcd);
ret = xhci_suspend(xhci, do_wakeup); ret = xhci_suspend(xhci, do_wakeup);
/* synchronize irq when using MSI-X */
xhci_msix_sync_irqs(xhci);
if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED)) if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED))
xhci_ssic_port_unused_quirk(hcd, false); xhci_ssic_port_unused_quirk(hcd, false);
......
...@@ -320,7 +320,7 @@ static int xhci_disable_interrupter(struct xhci_interrupter *ir) ...@@ -320,7 +320,7 @@ static int xhci_disable_interrupter(struct xhci_interrupter *ir)
#ifdef CONFIG_USB_PCI #ifdef CONFIG_USB_PCI
static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
{ {
struct usb_hcd *hcd = xhci_to_hcd(xhci); struct usb_hcd *hcd = xhci_to_hcd(xhci);
...@@ -332,6 +332,7 @@ static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) ...@@ -332,6 +332,7 @@ static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci)
synchronize_irq(pci_irq_vector(pdev, i)); synchronize_irq(pci_irq_vector(pdev, i));
} }
} }
EXPORT_SYMBOL_GPL(xhci_msix_sync_irqs);
#else #else
...@@ -969,10 +970,6 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) ...@@ -969,10 +970,6 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
__func__); __func__);
} }
/* step 5: remove core well power */
/* synchronize irq when using MSI-X */
xhci_msix_sync_irqs(xhci);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(xhci_suspend); EXPORT_SYMBOL_GPL(xhci_suspend);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment