Commit f977f4c9 authored by Niklas Neronin's avatar Niklas Neronin Committed by Greg Kroah-Hartman

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: default avatarNiklas Neronin <niklas.neronin@linux.intel.com>
Co-developed-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231201150647.1307406-13-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5080ef2d
...@@ -95,10 +95,9 @@ static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) ...@@ -95,10 +95,9 @@ static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
if (hcd->msix_enabled) { if (hcd->msix_enabled) {
struct pci_dev *pdev = to_pci_dev(hcd->self.controller); struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
int i;
for (i = 0; i < xhci->msix_count; i++) /* for now, the driver only supports one primary interrupter */
synchronize_irq(pci_irq_vector(pdev, i)); synchronize_irq(pci_irq_vector(pdev, 0));
} }
} }
...@@ -112,15 +111,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) ...@@ -112,15 +111,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
if (hcd->irq > 0) if (hcd->irq > 0)
return; return;
if (hcd->msix_enabled) { free_irq(pci_irq_vector(pdev, 0), xhci_to_hcd(xhci));
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));
}
pci_free_irq_vectors(pdev); pci_free_irq_vectors(pdev);
hcd->msix_enabled = 0; hcd->msix_enabled = 0;
} }
...@@ -159,9 +150,9 @@ static int xhci_setup_msi(struct xhci_hcd *xhci) ...@@ -159,9 +150,9 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
*/ */
static int xhci_setup_msix(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 usb_hcd *hcd = xhci_to_hcd(xhci);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller); struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
int ret;
/* /*
* calculate number of msi-x vectors supported. * calculate number of msi-x vectors supported.
...@@ -181,22 +172,16 @@ static int xhci_setup_msix(struct xhci_hcd *xhci) ...@@ -181,22 +172,16 @@ static int xhci_setup_msix(struct xhci_hcd *xhci)
return ret; return ret;
} }
for (i = 0; i < xhci->msix_count; i++) { ret = request_irq(pci_irq_vector(pdev, 0), xhci_msi_irq, 0, "xhci_hcd",
ret = request_irq(pci_irq_vector(pdev, i), xhci_msi_irq, 0, xhci_to_hcd(xhci));
"xhci_hcd", xhci_to_hcd(xhci)); if (ret) {
if (ret) xhci_dbg_trace(xhci, trace_xhci_dbg_init, "disable MSI-X interrupt");
goto disable_msix; pci_free_irq_vectors(pdev);
return ret;
} }
hcd->msix_enabled = 1; hcd->msix_enabled = 1;
return ret; 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) static int xhci_try_enable_msi(struct usb_hcd *hcd)
......
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