Commit b8402d82 authored by Janusz Dziedzic's avatar Janusz Dziedzic Committed by Kalle Valo

ath10k: fix MSI-X registering for qca99x0

In case of qca99x0 and MSI-X supported/enabled we
failed during interrupts registering with message:

ath10k_pci 0000:04:00.0: failed to request MSI-X ce irq 50: -22

Issue/fix was reproduced/tested using Dell Latitude E6430 laptop.
Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent bd4a41e6
...@@ -413,16 +413,6 @@ enum ath10k_hw_rate_cck { ...@@ -413,16 +413,6 @@ enum ath10k_hw_rate_cck {
/* Number of Copy Engines supported */ /* Number of Copy Engines supported */
#define CE_COUNT ar->hw_values->ce_count #define CE_COUNT ar->hw_values->ce_count
/*
* Total number of PCIe MSI interrupts requested for all interrupt sources.
* PCIe standard forces this to be a power of 2.
* Some Host OS's limit MSI requests that can be granted to 8
* so for now we abide by this limit and avoid requesting more
* than that.
*/
#define MSI_NUM_REQUEST_LOG2 3
#define MSI_NUM_REQUEST (1<<MSI_NUM_REQUEST_LOG2)
/* /*
* Granted MSIs are assigned as follows: * Granted MSIs are assigned as follows:
* Firmware uses the first * Firmware uses the first
......
...@@ -2609,12 +2609,9 @@ static int ath10k_pci_request_irq(struct ath10k *ar) ...@@ -2609,12 +2609,9 @@ static int ath10k_pci_request_irq(struct ath10k *ar)
return ath10k_pci_request_irq_legacy(ar); return ath10k_pci_request_irq_legacy(ar);
case 1: case 1:
return ath10k_pci_request_irq_msi(ar); return ath10k_pci_request_irq_msi(ar);
case MSI_NUM_REQUEST: default:
return ath10k_pci_request_irq_msix(ar); return ath10k_pci_request_irq_msix(ar);
} }
ath10k_warn(ar, "unknown irq configuration upon request\n");
return -EINVAL;
} }
static void ath10k_pci_free_irq(struct ath10k *ar) static void ath10k_pci_free_irq(struct ath10k *ar)
...@@ -2657,7 +2654,7 @@ static int ath10k_pci_init_irq(struct ath10k *ar) ...@@ -2657,7 +2654,7 @@ static int ath10k_pci_init_irq(struct ath10k *ar)
/* Try MSI-X */ /* Try MSI-X */
if (ath10k_pci_irq_mode == ATH10K_PCI_IRQ_AUTO) { if (ath10k_pci_irq_mode == ATH10K_PCI_IRQ_AUTO) {
ar_pci->num_msi_intrs = MSI_NUM_REQUEST; ar_pci->num_msi_intrs = MSI_ASSIGN_CE_MAX + 1;
ret = pci_enable_msi_range(ar_pci->pdev, ar_pci->num_msi_intrs, ret = pci_enable_msi_range(ar_pci->pdev, ar_pci->num_msi_intrs,
ar_pci->num_msi_intrs); ar_pci->num_msi_intrs);
if (ret > 0) if (ret > 0)
...@@ -2705,18 +2702,13 @@ static int ath10k_pci_deinit_irq(struct ath10k *ar) ...@@ -2705,18 +2702,13 @@ static int ath10k_pci_deinit_irq(struct ath10k *ar)
switch (ar_pci->num_msi_intrs) { switch (ar_pci->num_msi_intrs) {
case 0: case 0:
ath10k_pci_deinit_irq_legacy(ar); ath10k_pci_deinit_irq_legacy(ar);
return 0; break;
case 1:
/* fall-through */
case MSI_NUM_REQUEST:
pci_disable_msi(ar_pci->pdev);
return 0;
default: default:
pci_disable_msi(ar_pci->pdev); pci_disable_msi(ar_pci->pdev);
break;
} }
ath10k_warn(ar, "unknown irq configuration upon deinit\n"); return 0;
return -EINVAL;
} }
static int ath10k_pci_wait_for_target_init(struct ath10k *ar) static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
......
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