ath11k: supports one MSI vector
PATCH 5/7 ath11k: supports one MSI vector
From: Carl Huang <[email protected]>
On some platforms it's not possible to allocate 32 MSI vectors for various reasons, be it kernel configuration, VT-d disabled, buggy BIOS etc. So ath11k was not able to use QCA6390 PCI devices on those platforms. Add support for one MSI vector to solve that.
In case of one MSI vector, interrupt migration needs to be disabled. This is because when interrupt migration happens, the msi_data may change. However, msi_data is already programmed to rings during initial phase and ath11k has no way to know that msi_data is changed during run time and reprogram again.
In case of one MSI vector, MHI subsystem should not use IRQF_NO_SUSPEND as QCA6390 doesn't set this flag too. Ath11k doesn't need to leave IRQ enabled in suspend state.
Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
--- drivers/net/wireless/ath/ath11k/mhi.c | 14 ++++++-- drivers/net/wireless/ath/ath11k/pci.c | 52 ++++++++++++++++++++------- 2 files changed, 51 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath11k/mhi.c +12 -2
@@ -248,6 +248,7 @@ static int ath11k_mhi_get_msi(struct ath11k_pci *ab_pci)u32 user_base_data, base_vector;int ret, num_vectors, i;int *irq; +unsigned int msi_data; ret = ath11k_pci_get_user_msi_assignment(ab_pci, "MHI", &num_vectors,
@@ -262,9 +263,15 @@ static int ath11k_mhi_get_msi(struct ath11k_pci *ab_pci)if (!irq)return -ENOMEM ; -for (i =0 ; i < num_vectors; i++) +for (i =0 ; i < num_vectors; i++) { + msi_data = base_vector; + +if (test_bit (ATH11K_PCI_FLAG_MULTI_MSI_VECTORS , &ab_pci->flags)) + msi_data += i; + irq[i] =ath11k_pci_get_msi_irq (ab->dev, - base_vector + i); + msi_data); + } ab_pci->mhi_ctrl->irq = irq; ab_pci->mhi_ctrl->nr_irqs = num_vectors;
@@ -339,6 +346,9 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)return ret; } +if (!test_bit (ATH11K_PCI_FLAG_MULTI_MSI_VECTORS , &ab_pci->flags)) + mhi_ctrl->irq_flags =IRQF_SHARED |IRQF_NOBALANCING ; + mhi_ctrl->iova_start =0 ; mhi_ctrl->iova_stop =0xffffffff ; mhi_ctrl->sbl_size =SZ_512K ;
drivers/net/wireless/ath/ath11k/pci.c +39 -13
116 lines not on this page · raw message
Signature · 1 line
2.25.1