summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-pci.c
diff options
context:
space:
mode:
authorNiklas Neronin <niklas.neronin@linux.intel.com>2023-12-01 18:06:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-04 09:50:40 +0300
commitdfbf4441f2d31d21e0a98c5fcff6dae8b57b79dd (patch)
treea9d028f15e764f5437a91fa990ff0d163d4fa694 /drivers/usb/host/xhci-pci.c
parenta795f708b2844054a7d12aae72397bf51d0f87b3 (diff)
downloadlinux-dfbf4441f2d31d21e0a98c5fcff6dae8b57b79dd.tar.xz
xhci: change 'msix_count' to encompass MSI or MSI-X vectors
Instead of variable 'msix_count' containing the number of MSI-X vectors, now it can contains MSI or MSI-X vector amount. Because both interrupt methods allow several vectors. Thus, 'msix_count' is renamed to 'nvecs'. Additionally, instead of storing the maximum possible vector amount, now it stores the amount of successfully allocated vectors, or negative integer on allocation failure. Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20231201150647.1307406-16-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-pci.c')
-rw-r--r--drivers/usb/host/xhci-pci.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index dbec0a315566..2307164a1e81 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -142,12 +142,12 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
* - num_online_cpus: maximum MSI-X vectors per CPUs core.
* Add additional 1 vector to ensure always available interrupt.
*/
- xhci->msix_count = min(num_online_cpus() + 1,
- HCS_MAX_INTRS(xhci->hcs_params1));
+ xhci->nvecs = min(num_online_cpus() + 1,
+ HCS_MAX_INTRS(xhci->hcs_params1));
- ret = pci_alloc_irq_vectors(pdev, xhci->msix_count, xhci->msix_count,
- PCI_IRQ_MSIX);
- if (ret < 0) {
+ xhci->nvecs = pci_alloc_irq_vectors(pdev, xhci->nvecs, xhci->nvecs,
+ PCI_IRQ_MSIX);
+ if (xhci->nvecs < 0) {
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Failed to enable MSI-X");
goto setup_msi;
}
@@ -166,8 +166,8 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
setup_msi:
/* TODO: Check with MSI Soc for sysdev */
- ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
- if (ret < 0) {
+ xhci->nvecs = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
+ if (xhci->nvecs < 0) {
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "failed to allocate MSI entry");
goto legacy_irq;
}