From 6041c6e39aa7de0aa6411349954ae7f64be266a2 Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Thu, 10 Sep 2015 15:00:22 +0300 Subject: [PATCH] CHROMIUM: iwl7000: sdio: avoid read/write operations if the bus is dead Recovery takes too much time if the bus is dead (each timeout is 2000ms, etc.). try avoiding it by setting a flag when the bus is dead, and avoid any bus access until recovery. There still might be significant delays caused by implicit mmc access (e.g. sdio_disable_func()), but at least avoid the direct read/write operations. Additionally, explicitly skip fw dump in this case, as it will result in garbage data (and might take signifcant time) -- TODO: are there valid failures? Signed-off-by: Eliad Peller iwl7000-tree: b5e41377e07fe71bbb562ffb36057ffd93adacd8 --- drivers/net/wireless/iwl7000/iwlwifi/iwl-trans.h | 2 ++ drivers/net/wireless/iwl7000/iwlwifi/mvm/mac80211.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/iwl7000/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwl7000/iwlwifi/iwl-trans.h index df119dab95d33..2d246b1822d3b 100644 --- a/drivers/net/wireless/iwl7000/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwl7000/iwlwifi/iwl-trans.h @@ -412,6 +412,7 @@ enum iwl_d3_status { * are sent * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent * @STATUS_TA_ACTIVE: target access is in progress + * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation */ enum iwl_trans_status { STATUS_SYNC_HCMD_ACTIVE, @@ -423,6 +424,7 @@ enum iwl_trans_status { STATUS_TRANS_GOING_IDLE, STATUS_TRANS_IDLE, STATUS_TA_ACTIVE, + STATUS_TRANS_DEAD, }; /** diff --git a/drivers/net/wireless/iwl7000/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwl7000/iwlwifi/mvm/mac80211.c index 8c6c0801027fd..dbfb734c26dec 100644 --- a/drivers/net/wireless/iwl7000/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwl7000/iwlwifi/mvm/mac80211.c @@ -1149,6 +1149,12 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) lockdep_assert_held(&mvm->mutex); + /* there's no point in fw dump if the bus is dead */ + if (test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) { + IWL_ERR(mvm, "Skip fw error dump since bus is dead\n"); + return; + } + fw_error_dump = kzalloc(sizeof(*fw_error_dump), GFP_KERNEL); if (!fw_error_dump) return;