iwlwifi: implement BISR HW workaround for 22260 devices
authorJohannes Berg <johannes.berg@intel.com>
Mon, 10 Dec 2018 08:36:58 +0000 (09:36 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 4 Feb 2019 10:28:10 +0000 (12:28 +0200)
There's a small hardware bug in 22260 devices which thus require a
few more delays during initialization. Implement this workaround.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
drivers/net/wireless/intel/iwlwifi/iwl-config.h
drivers/net/wireless/intel/iwlwifi/iwl-io.c

index c547288d32aa394091969316096ca6822f6a644e..28d8c3477371164b734c9255fd34486bbd4fe1d4 100644 (file)
@@ -220,6 +220,7 @@ const struct iwl_cfg iwl22260_2ax_cfg = {
         * HT size; mac80211 would otherwise pick the HE max (256) by default.
         */
        .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
+       .bisr_workaround = 1,
 };
 
 const struct iwl_cfg killer1650x_2ax_cfg = {
@@ -232,6 +233,7 @@ const struct iwl_cfg killer1650x_2ax_cfg = {
         * HT size; mac80211 would otherwise pick the HE max (256) by default.
         */
        .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
+       .bisr_workaround = 1,
 };
 
 const struct iwl_cfg killer1650w_2ax_cfg = {
@@ -244,6 +246,7 @@ const struct iwl_cfg killer1650w_2ax_cfg = {
         * HT size; mac80211 would otherwise pick the HE max (256) by default.
         */
        .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
+       .bisr_workaround = 1,
 };
 
 /*
index f1e4933807133b084a0c24800bc7527e0cbf6d8f..5e713730165a499510a717fdc3359dba4c92d127 100644 (file)
@@ -379,6 +379,7 @@ struct iwl_csr_params {
  * @nvm_type: see &enum iwl_nvm_type
  * @d3_debug_data_base_addr: base address where D3 debug data is stored
  * @d3_debug_data_length: length of the D3 debug data
+ * @bisr_workaround: BISR hardware workaround (for 22260 series devices)
  *
  * We enable the driver to be backward compatible wrt. hardware features.
  * API differences in uCode shouldn't be handled here but through TLVs
@@ -428,7 +429,8 @@ struct iwl_cfg {
            use_tfh:1,
            gen2:1,
            cdb:1,
-           dbgc_supported:1;
+           dbgc_supported:1,
+           bisr_workaround:1;
        u8 valid_tx_ant;
        u8 valid_rx_ant;
        u8 non_shared_ant;
index 4ea5883f9175df8c0b7dc902f21d0514e7ff47ba..bf171edad53a18da00688f300dd372ae28d78f26 100644 (file)
@@ -493,6 +493,11 @@ int iwl_finish_nic_init(struct iwl_trans *trans)
 {
        int err;
 
+       if (trans->cfg->bisr_workaround) {
+               /* ensure the TOP FSM isn't still in previous reset */
+               mdelay(2);
+       }
+
        /*
         * Set "initialization complete" bit to move adapter from
         * D0U* --> D0A* (powered-up active) state.
@@ -515,6 +520,11 @@ int iwl_finish_nic_init(struct iwl_trans *trans)
        if (err < 0)
                IWL_DEBUG_INFO(trans, "Failed to wake NIC\n");
 
+       if (trans->cfg->bisr_workaround) {
+               /* ensure BISR shift has finished */
+               udelay(200);
+       }
+
        return err < 0 ? err : 0;
 }
 IWL_EXPORT_SYMBOL(iwl_finish_nic_init);