summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorHaim Dreyfuss <haim.dreyfuss@intel.com>2016-07-26 17:03:07 +0200
committerLuca Coelho <luciano.coelho@intel.com>2016-09-16 08:10:32 +0200
commit9fb064df6d57bf09ed3f8f964c8b0789b55206e7 (patch)
tree1af50134c2a9b2d5a1c4e2b74cd6f29ef4cdd978 /drivers/net/wireless
parentiwlwifi: mvm: bump max API to 26 (diff)
downloadlinux-9fb064df6d57bf09ed3f8f964c8b0789b55206e7.tar.xz
linux-9fb064df6d57bf09ed3f8f964c8b0789b55206e7.zip
iwlwifi: pcie: replace possible_cpus() with online_cpus() in MSIX mode
In MSIX mode the number of irq depends on the number of possible cpus existing on the host. This cause to bug in case there are offline cores. Take into account only the online CPUs instead. Also save it in temporary variable. Fixes: commit 2e5d4a8f61dc ("iwlwifi: pcie: Add new configuration to enable MSIX") Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/pcie/trans.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 43c3915ed352..188b0dee542c 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -1513,13 +1513,14 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
struct iwl_trans *trans)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
- int max_irqs, num_irqs, i, ret;
+ int max_irqs, num_irqs, i, ret, nr_online_cpus;
u16 pci_cmd;
if (!trans->cfg->mq_rx_supported)
goto enable_msi;
- max_irqs = min_t(u32, num_possible_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
+ nr_online_cpus = num_online_cpus();
+ max_irqs = min_t(u32, nr_online_cpus + 2, IWL_MAX_RX_HW_QUEUES);
for (i = 0; i < max_irqs; i++)
trans_pcie->msix_entries[i].entry = i;
@@ -1545,11 +1546,11 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
* Two interrupts less: non rx causes shared with FBQ and RSS.
* More than two interrupts: we will use fewer RSS queues.
*/
- if (num_irqs <= num_online_cpus()) {
+ if (num_irqs <= nr_online_cpus) {
trans_pcie->trans->num_rx_queues = num_irqs + 1;
trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX |
IWL_SHARED_IRQ_FIRST_RSS;
- } else if (num_irqs == num_online_cpus() + 1) {
+ } else if (num_irqs == nr_online_cpus + 1) {
trans_pcie->trans->num_rx_queues = num_irqs;
trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX;
} else {