Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xhci: Move xhci MSI sync function to to xhci-pci

Move function to sync MSI from xhci.c to xhci-pci.c to decouple PCI
specific code from generic xhci code.

No functional changes, function is an exact copy

[commit message rewording -Mathias]

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230317154715.535523-15-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Josue David Hernandez Gutierrez and committed by
Greg Kroah-Hartman
9abe15d5 0c540438

+13 -25
+13 -1
drivers/usb/host/xhci-pci.c
··· 88 88 .update_hub_device = xhci_pci_update_hub_device, 89 89 }; 90 90 91 + static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 92 + { 93 + struct usb_hcd *hcd = xhci_to_hcd(xhci); 94 + 95 + if (hcd->msix_enabled) { 96 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 97 + int i; 98 + 99 + for (i = 0; i < xhci->msix_count; i++) 100 + synchronize_irq(pci_irq_vector(pdev, i)); 101 + } 102 + } 103 + 91 104 /* Free any IRQs and disable MSI-X */ 92 105 static void xhci_cleanup_msix(struct xhci_hcd *xhci) 93 106 { ··· 792 779 writel(reg, hcd->regs + SPARSE_CNTL_ENABLE); 793 780 } 794 781 795 - extern void xhci_msix_sync_irqs(struct xhci_hcd *xhci); 796 782 static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) 797 783 { 798 784 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-24
drivers/usb/host/xhci.c
··· 318 318 return 0; 319 319 } 320 320 321 - #ifdef CONFIG_USB_PCI 322 - 323 - void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 324 - { 325 - struct usb_hcd *hcd = xhci_to_hcd(xhci); 326 - 327 - if (hcd->msix_enabled) { 328 - struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 329 - int i; 330 - 331 - for (i = 0; i < xhci->msix_count; i++) 332 - synchronize_irq(pci_irq_vector(pdev, i)); 333 - } 334 - } 335 - EXPORT_SYMBOL_GPL(xhci_msix_sync_irqs); 336 - 337 - #else 338 - 339 - static inline void xhci_msix_sync_irqs(struct xhci_hcd *xhci) 340 - { 341 - } 342 - 343 - #endif 344 - 345 321 static void compliance_mode_recovery(struct timer_list *t) 346 322 { 347 323 struct xhci_hcd *xhci;