Commit d7270d61 authored by Haim Dreyfuss's avatar Haim Dreyfuss Committed by Luca Coelho

iwlwifi: pcie: re-configure IVAR table after suspend-resume

During the suspend/resume flow some HW blocks are reset.  This causes
the IVAR table to be completely erased.  This table is where interrupt
causes are bound to specific IRQs.  When the table is empty the
interrupt handlers are not called correctly.  Fix this by reconfiguring
the IVAR table after resume.

Fixes: 2e5d4a8f ("iwlwifi: pcie: Add new configuration to enable MSIX")
Signed-off-by: default avatarHaim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 83730058
...@@ -1152,12 +1152,18 @@ static void iwl_pcie_conf_msix_hw(struct iwl_trans_pcie *trans_pcie) ...@@ -1152,12 +1152,18 @@ static void iwl_pcie_conf_msix_hw(struct iwl_trans_pcie *trans_pcie)
struct iwl_trans *trans = trans_pcie->trans; struct iwl_trans *trans = trans_pcie->trans;
if (!trans_pcie->msix_enabled) { if (!trans_pcie->msix_enabled) {
if (trans->cfg->mq_rx_supported) if (trans->cfg->mq_rx_supported &&
test_bit(STATUS_DEVICE_ENABLED, &trans->status))
iwl_write_prph(trans, UREG_CHICK, iwl_write_prph(trans, UREG_CHICK,
UREG_CHICK_MSI_ENABLE); UREG_CHICK_MSI_ENABLE);
return; return;
} }
/*
* The IVAR table needs to be configured again after reset,
* but if the device is disabled, we can't write to
* prph.
*/
if (test_bit(STATUS_DEVICE_ENABLED, &trans->status))
iwl_write_prph(trans, UREG_CHICK, UREG_CHICK_MSIX_ENABLE); iwl_write_prph(trans, UREG_CHICK, UREG_CHICK_MSIX_ENABLE);
/* /*
...@@ -1457,6 +1463,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans, ...@@ -1457,6 +1463,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
enum iwl_d3_status *status, enum iwl_d3_status *status,
bool test, bool reset) bool test, bool reset)
{ {
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
u32 val; u32 val;
int ret; int ret;
...@@ -1469,10 +1476,14 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans, ...@@ -1469,10 +1476,14 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
iwl_pcie_enable_rx_wake(trans, true); iwl_pcie_enable_rx_wake(trans, true);
/* /*
* Also enables interrupts - none will happen as the device doesn't * Reconfigure IVAR table in case of MSIX or reset ict table in
* know we're waking it up, only when the opmode actually tells it * MSI mode since HW reset erased it.
* after this call. * Also enables interrupts - none will happen as
* the device doesn't know we're waking it up, only when
* the opmode actually tells it after this call.
*/ */
iwl_pcie_conf_msix_hw(trans_pcie);
if (!trans_pcie->msix_enabled)
iwl_pcie_reset_ict(trans); iwl_pcie_reset_ict(trans);
iwl_enable_interrupts(trans); iwl_enable_interrupts(trans);
......
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