diff mbox series

[1/1] iwlwifi: msix: limit max RX queues for 9000 family

Message ID 20201014033523.13521-2-kai.heng.feng@canonical.com
State New
Headers show
Series Fix system reboot when disconnecting WiFi | expand

Commit Message

Kai-Heng Feng Oct. 14, 2020, 3:35 a.m. UTC
From: Mordechay Goodstein <mordechay.goodstein@intel.com>

BugLink: https://bugs.launchpad.net/bugs/1899726

There is an issue in the HW DMA engine in the 9000 family of devices
when more than 6 RX queues are used.  The issue is that the FW may
hang when IWL_MVM_RXQ_NSSN_SYNC notifications are sent.

Fix this by limiting the number of RX queues to 6 in the 9000 family
of devices.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200911204056.37d90f9ceb0c.I8dfe8a7d3a7ac9f0bc9d93e4a03f8165d8c999d2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
(cherry picked from commit 0cd38f4d05299f5148c60db0234ea4db862c839b linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-trans.h  | 1 +
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Stefan Bader Oct. 14, 2020, 7:04 a.m. UTC | #1
On 14.10.20 05:35, Kai-Heng Feng wrote:
> From: Mordechay Goodstein <mordechay.goodstein@intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1899726
> 
> There is an issue in the HW DMA engine in the 9000 family of devices
> when more than 6 RX queues are used.  The issue is that the FW may
> hang when IWL_MVM_RXQ_NSSN_SYNC notifications are sent.
> 
> Fix this by limiting the number of RX queues to 6 in the 9000 family
> of devices.
> 
> Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> Link: https://lore.kernel.org/r/iwlwifi.20200911204056.37d90f9ceb0c.I8dfe8a7d3a7ac9f0bc9d93e4a03f8165d8c999d2@changeid
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> (cherry picked from commit 0cd38f4d05299f5148c60db0234ea4db862c839b linux-next)
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/iwl-trans.h  | 1 +
>  drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 6 +++++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> index 34788e7afc7b..32ea4c3c7d23 100644
> --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> @@ -316,6 +316,7 @@ static inline void iwl_free_rxb(struct iwl_rx_cmd_buffer *r)
>  #define IWL_MGMT_TID		15
>  #define IWL_FRAME_LIMIT	64
>  #define IWL_MAX_RX_HW_QUEUES	16
> +#define IWL_9000_MAX_RX_HW_QUEUES	6
>  
>  /**
>   * enum iwl_wowlan_status - WoWLAN image/device status
> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> index e5160d620868..a59684e82713 100644
> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> @@ -1607,11 +1607,15 @@ iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
>  	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
>  	int max_irqs, num_irqs, i, ret;
>  	u16 pci_cmd;
> +	u32 max_rx_queues = IWL_MAX_RX_HW_QUEUES;
>  
>  	if (!cfg_trans->mq_rx_supported)
>  		goto enable_msi;
>  
> -	max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
> +	if (cfg_trans->device_family <= IWL_DEVICE_FAMILY_9000)
> +		max_rx_queues = IWL_9000_MAX_RX_HW_QUEUES;
> +
> +	max_irqs = min_t(u32, num_online_cpus() + 2, max_rx_queues);
>  	for (i = 0; i < max_irqs; i++)
>  		trans_pcie->msix_entries[i].entry = i;
>  
>
Seth Forshee Oct. 14, 2020, 2:16 p.m. UTC | #2
On Wed, Oct 14, 2020 at 11:35:23AM +0800, Kai-Heng Feng wrote:
> From: Mordechay Goodstein <mordechay.goodstein@intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1899726
> 
> There is an issue in the HW DMA engine in the 9000 family of devices
> when more than 6 RX queues are used.  The issue is that the FW may
> hang when IWL_MVM_RXQ_NSSN_SYNC notifications are sent.
> 
> Fix this by limiting the number of RX queues to 6 in the 9000 family
> of devices.
> 
> Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> Link: https://lore.kernel.org/r/iwlwifi.20200911204056.37d90f9ceb0c.I8dfe8a7d3a7ac9f0bc9d93e4a03f8165d8c999d2@changeid
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> (cherry picked from commit 0cd38f4d05299f5148c60db0234ea4db862c839b linux-next)
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Acked-by: Seth Forshee <seth.forshee@canonical.com>
Ian May Oct. 22, 2020, 6:02 p.m. UTC | #3
Applied to Focal/master-next

Thanks,
Ian

On 2020-10-14 11:35:23 , Kai-Heng Feng wrote:
> From: Mordechay Goodstein <mordechay.goodstein@intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1899726
> 
> There is an issue in the HW DMA engine in the 9000 family of devices
> when more than 6 RX queues are used.  The issue is that the FW may
> hang when IWL_MVM_RXQ_NSSN_SYNC notifications are sent.
> 
> Fix this by limiting the number of RX queues to 6 in the 9000 family
> of devices.
> 
> Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> Link: https://lore.kernel.org/r/iwlwifi.20200911204056.37d90f9ceb0c.I8dfe8a7d3a7ac9f0bc9d93e4a03f8165d8c999d2@changeid
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> (cherry picked from commit 0cd38f4d05299f5148c60db0234ea4db862c839b linux-next)
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/iwl-trans.h  | 1 +
>  drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 6 +++++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> index 34788e7afc7b..32ea4c3c7d23 100644
> --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
> @@ -316,6 +316,7 @@ static inline void iwl_free_rxb(struct iwl_rx_cmd_buffer *r)
>  #define IWL_MGMT_TID		15
>  #define IWL_FRAME_LIMIT	64
>  #define IWL_MAX_RX_HW_QUEUES	16
> +#define IWL_9000_MAX_RX_HW_QUEUES	6
>  
>  /**
>   * enum iwl_wowlan_status - WoWLAN image/device status
> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> index e5160d620868..a59684e82713 100644
> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
> @@ -1607,11 +1607,15 @@ iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
>  	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
>  	int max_irqs, num_irqs, i, ret;
>  	u16 pci_cmd;
> +	u32 max_rx_queues = IWL_MAX_RX_HW_QUEUES;
>  
>  	if (!cfg_trans->mq_rx_supported)
>  		goto enable_msi;
>  
> -	max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
> +	if (cfg_trans->device_family <= IWL_DEVICE_FAMILY_9000)
> +		max_rx_queues = IWL_9000_MAX_RX_HW_QUEUES;
> +
> +	max_irqs = min_t(u32, num_online_cpus() + 2, max_rx_queues);
>  	for (i = 0; i < max_irqs; i++)
>  		trans_pcie->msix_entries[i].entry = i;
>  
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index 34788e7afc7b..32ea4c3c7d23 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -316,6 +316,7 @@  static inline void iwl_free_rxb(struct iwl_rx_cmd_buffer *r)
 #define IWL_MGMT_TID		15
 #define IWL_FRAME_LIMIT	64
 #define IWL_MAX_RX_HW_QUEUES	16
+#define IWL_9000_MAX_RX_HW_QUEUES	6
 
 /**
  * enum iwl_wowlan_status - WoWLAN image/device status
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index e5160d620868..a59684e82713 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -1607,11 +1607,15 @@  iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 	int max_irqs, num_irqs, i, ret;
 	u16 pci_cmd;
+	u32 max_rx_queues = IWL_MAX_RX_HW_QUEUES;
 
 	if (!cfg_trans->mq_rx_supported)
 		goto enable_msi;
 
-	max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
+	if (cfg_trans->device_family <= IWL_DEVICE_FAMILY_9000)
+		max_rx_queues = IWL_9000_MAX_RX_HW_QUEUES;
+
+	max_irqs = min_t(u32, num_online_cpus() + 2, max_rx_queues);
 	for (i = 0; i < max_irqs; i++)
 		trans_pcie->msix_entries[i].entry = i;