xhci: add handler for only one interrupt line

Current xHCI driver only supports one "interrupter", meaning we will
only use one MSI/MSI-X interrupt line. Thus, add handler only to the
first interrupt line.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Co-developed-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231201150647.1307406-13-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Niklas Neronin 2023-12-01 17:06:40 +02:00 committed by Greg Kroah-Hartman
parent 5080ef2d37
commit f977f4c930

View File

@ -95,10 +95,9 @@ static void xhci_msix_sync_irqs(struct xhci_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));
/* for now, the driver only supports one primary interrupter */
synchronize_irq(pci_irq_vector(pdev, 0));
}
}
@ -112,15 +111,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
if (hcd->irq > 0)
return;
if (hcd->msix_enabled) {
int i;
for (i = 0; i < xhci->msix_count; i++)
free_irq(pci_irq_vector(pdev, i), xhci_to_hcd(xhci));
} else {
free_irq(pci_irq_vector(pdev, 0), xhci_to_hcd(xhci));
}
free_irq(pci_irq_vector(pdev, 0), xhci_to_hcd(xhci));
pci_free_irq_vectors(pdev);
hcd->msix_enabled = 0;
}
@ -159,9 +150,9 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
*/
static int xhci_setup_msix(struct xhci_hcd *xhci)
{
int i, ret;
struct usb_hcd *hcd = xhci_to_hcd(xhci);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
int ret;
/*
* calculate number of msi-x vectors supported.
@ -181,22 +172,16 @@ static int xhci_setup_msix(struct xhci_hcd *xhci)
return ret;
}
for (i = 0; i < xhci->msix_count; i++) {
ret = request_irq(pci_irq_vector(pdev, i), xhci_msi_irq, 0,
"xhci_hcd", xhci_to_hcd(xhci));
if (ret)
goto disable_msix;
ret = request_irq(pci_irq_vector(pdev, 0), xhci_msi_irq, 0, "xhci_hcd",
xhci_to_hcd(xhci));
if (ret) {
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "disable MSI-X interrupt");
pci_free_irq_vectors(pdev);
return ret;
}
hcd->msix_enabled = 1;
return ret;
disable_msix:
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "disable MSI-X interrupt");
while (--i >= 0)
free_irq(pci_irq_vector(pdev, i), xhci_to_hcd(xhci));
pci_free_irq_vectors(pdev);
return ret;
}
static int xhci_try_enable_msi(struct usb_hcd *hcd)