iwlwifi: BZ Family BUS_MASTER_DISABLE_REQ code duplication
authorRoee Goldfiner <roee.h.goldfiner@intel.com>
Sun, 17 Oct 2021 13:25:53 +0000 (16:25 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Oct 2021 07:49:01 +0000 (10:49 +0300)
Remove redundant code which occurs anyway in a later stage and add
msleep(100) which is required after disable request.

Signed-off-by: Roee Goldfiner <roee.h.goldfiner@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017162352.46183bcd6549.Ie05161496810d3f28fb9d1fecb5f8593889ed2c6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index 53bc5b7d8d5c8e2cc1cfa70d2f74803fb3b00b11..a4aad24abb90ed47baec61d02cb8f1fb8be21d67 100644 (file)
@@ -131,21 +131,9 @@ void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans)
        if (trans_pcie->is_down)
                return;
 
-       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) {
+       if (trans->state >= IWL_TRANS_FW_STARTED)
+               if (trans_pcie->fw_reset_handshake)
                        iwl_trans_pcie_fw_reset_handshake(trans);
-               }
-       }
 
        trans_pcie->is_down = true;
 
index 9e462633af5526ef195362a4e3bf454a109e4cde..22393b724e9856fe2b384763340a5d26fc71d5c0 100644 (file)
@@ -458,6 +458,7 @@ void iwl_pcie_apm_stop_master(struct iwl_trans *trans)
                                   CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS,
                                   CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS,
                                   100);
+               msleep(100);
        } else {
                iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);