]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
iwlwifi: pcie: implement Bz reset flow
authorJohannes Berg <johannes.berg@intel.com>
Mon, 2 Aug 2021 18:58:53 +0000 (21:58 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 26 Aug 2021 20:34:26 +0000 (23:34 +0300)
Bz device reset flow changed, now the hardware (instead of
firmware) will reset the PCI bus etc., this can take up to
100ms.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.df30875c6ff9.I962ed0f2c3358903dc6ba1abb65726ce5acbbd48@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

index fa416b42bd9d85a9bcde4297fd360b9f64e4c7cb..bf0c32a74ca473287588d7106bed77225b46d87d 100644 (file)
@@ -131,9 +131,21 @@ void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans)
        if (trans_pcie->is_down)
                return;
 
-       if (trans_pcie->fw_reset_handshake &&
-           trans->state >= IWL_TRANS_FW_STARTED)
-               iwl_trans_pcie_fw_reset_handshake(trans);
+       if (trans->state >= IWL_TRANS_FW_STARTED) {
+               if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) {
+                       iwl_set_bit(trans, CSR_GP_CNTRL,
+                                   CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_REQ);
+                       iwl_poll_bit(trans, CSR_GP_CNTRL,
+                                    CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS,
+                                    CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS,
+                                    5000);
+                       msleep(100);
+                       iwl_set_bit(trans, CSR_GP_CNTRL,
+                                   CSR_GP_CNTRL_REG_FLAG_SW_RESET);
+               } else if (trans_pcie->fw_reset_handshake) {
+                       iwl_trans_pcie_fw_reset_handshake(trans);
+               }
+       }
 
        trans_pcie->is_down = true;