All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 07/10] iwlwifi: pcie: implement Bz reset flow
Date: Mon,  2 Aug 2021 21:58:53 +0300	[thread overview]
Message-ID: <iwlwifi.20210802215208.df30875c6ff9.I962ed0f2c3358903dc6ba1abb65726ce5acbbd48@changeid> (raw)
In-Reply-To: <20210802185856.175567-1-luca@coelho.fi>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 .../wireless/intel/iwlwifi/pcie/trans-gen2.c   | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
index fa416b42bd9d..bf0c32a74ca4 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
@@ -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;
 
-- 
2.32.0


  parent reply	other threads:[~2021-08-02 18:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 18:58 [PATCH 00/10] iwlwifi: updates intended for v5.15 2021-08-02 part 3 Luca Coelho
2021-08-02 18:58 ` [PATCH 01/10] iwlwifi: yoyo: cleanup internal buffer allocation in D3 Luca Coelho
2021-08-26 20:34   ` Luca Coelho
2021-08-02 18:58 ` [PATCH 02/10] iwlwifi: split off Bz devices into their own family Luca Coelho
2021-08-02 18:58 ` [PATCH 03/10] iwlwifi: give Bz devices their own name Luca Coelho
2021-08-02 18:58 ` [PATCH 04/10] iwlwifi: read MAC address from correct place on Bz Luca Coelho
2021-08-02 18:58 ` [PATCH 05/10] iwlwifi: pcie: implement Bz device startup Luca Coelho
2021-08-02 18:58 ` [PATCH 06/10] iwlwifi: implement Bz NMI behaviour Luca Coelho
2021-08-02 18:58 ` Luca Coelho [this message]
2021-08-02 18:58 ` [PATCH 08/10] iwlwifi: mvm: Fix umac scan request probe parameters Luca Coelho
2021-08-02 18:58 ` [PATCH 09/10] iwlwifi: mvm: support new station key API Luca Coelho
2021-08-02 18:58 ` [PATCH 10/10] iwlwifi: mvm: simplify __iwl_mvm_set_sta_key() Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20210802215208.df30875c6ff9.I962ed0f2c3358903dc6ba1abb65726ce5acbbd48@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.