linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Golan Ben-Ami <golan.ben.ami@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 16/19] iwlwifi: fix nmi triggering from host
Date: Sat,  5 Aug 2017 22:43:28 +0300	[thread overview]
Message-ID: <20170805194331.17426-17-luca@coelho.fi> (raw)
In-Reply-To: <20170805194331.17426-1-luca@coelho.fi>

From: Golan Ben-Ami <golan.ben.ami@intel.com>

Although nmi was triggered fine till now, it appears
that the driver didn't write the exact correct values
to the correct addresses for each HW.
Fix the nmi triggering by setting the correct addresses
and values.

Fixes: 4c9706dc2f29 ("iwlwifi: update nmi register")
Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-io.c   | 14 +++-----------
 drivers/net/wireless/intel/iwlwifi/iwl-prph.h |  7 +++----
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-io.c b/drivers/net/wireless/intel/iwlwifi/iwl-io.c
index c527b8c10370..efb1998dcabd 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-io.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-io.c
@@ -241,20 +241,12 @@ IWL_EXPORT_SYMBOL(iwl_clear_bits_prph);
 
 void iwl_force_nmi(struct iwl_trans *trans)
 {
-	if (trans->cfg->device_family < IWL_DEVICE_FAMILY_8000) {
+	if (trans->cfg->device_family < IWL_DEVICE_FAMILY_9000)
 		iwl_write_prph(trans, DEVICE_SET_NMI_REG,
 			       DEVICE_SET_NMI_VAL_DRV);
-		iwl_write_prph(trans, DEVICE_SET_NMI_REG,
-			       DEVICE_SET_NMI_VAL_HW);
-	} else if (trans->cfg->device_family == IWL_DEVICE_FAMILY_A000) {
+	else
 		iwl_write_prph(trans, UREG_NIC_SET_NMI_DRIVER,
-			       DEVICE_SET_NMI_8000_VAL);
-	} else {
-		iwl_write_prph(trans, DEVICE_SET_NMI_8000_REG,
-			       DEVICE_SET_NMI_8000_VAL);
-		iwl_write_prph(trans, DEVICE_SET_NMI_REG,
-			       DEVICE_SET_NMI_VAL_DRV);
-	}
+			       UREG_NIC_SET_NMI_DRIVER_NMI_FROM_DRIVER_MSK);
 }
 IWL_EXPORT_SYMBOL(iwl_force_nmi);
 
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
index fbce97ed4ecd..421a869633a3 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
@@ -109,13 +109,12 @@
 /* Device system time */
 #define DEVICE_SYSTEM_TIME_REG 0xA0206C
 
-/* Device NMI register */
+/* Device NMI register and value for 8000 family and lower hw's */
 #define DEVICE_SET_NMI_REG 0x00a01c30
-#define DEVICE_SET_NMI_VAL_HW BIT(0)
 #define DEVICE_SET_NMI_VAL_DRV BIT(7)
-#define DEVICE_SET_NMI_8000_REG 0x00a01c24
-#define DEVICE_SET_NMI_8000_VAL 0x1000000
+/* Device NMI register and value for 9000 family and above hw's */
 #define UREG_NIC_SET_NMI_DRIVER 0x00a05c10
+#define UREG_NIC_SET_NMI_DRIVER_NMI_FROM_DRIVER_MSK 0xff000000
 
 /* Shared registers (0x0..0x3ff, via target indirect or periphery */
 #define SHR_BASE	0x00a10000
-- 
2.13.2

  parent reply	other threads:[~2017-08-05 19:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-05 19:43 [PATCH 00/19] iwlwifi: updates intended for v4.14 2017-08-05 Luca Coelho
2017-08-05 19:43 ` [PATCH 01/19] iwlwifi: mvm: remove useless condition in LED code Luca Coelho
2017-08-05 19:43 ` [PATCH 02/19] iwlwifi: mvm: use firmware LED command where applicable Luca Coelho
2017-08-05 19:43 ` [PATCH 03/19] iwlwifi: mvm: add const to thermal_cooling_device_ops structure Luca Coelho
2017-08-05 19:43 ` [PATCH 04/19] iwlwifi: mvm: add debugfs to force CT-kill Luca Coelho
2017-08-07 13:11   ` Kalle Valo
2017-08-07 13:25     ` Luca Coelho
2017-08-07 13:28       ` Kalle Valo
2017-08-09  6:43         ` [PATCH v2 4/19] " Luca Coelho
2017-08-09  7:36           ` Kalle Valo
2017-08-05 19:43 ` [PATCH 05/19] iwlwifi: change functions that can only return 0 to void Luca Coelho
2017-08-05 19:43 ` [PATCH 06/19] iwlwifi: fix a few instances of misaligned kerneldoc parameters Luca Coelho
2017-08-05 19:43 ` [PATCH 07/19] iwlwifi: add support of FPGA fw Luca Coelho
2017-08-05 19:43 ` [PATCH 08/19] iwlwifi: fix a000 RF_ID define Luca Coelho
2017-08-05 19:43 ` [PATCH 09/19] iwlwifi: dump smem configuration when firmware crashes Luca Coelho
2017-08-05 19:43 ` [PATCH 10/19] iwlwifi: mvm: move a000 device NVM retrieval to a common place Luca Coelho
2017-08-05 19:43 ` [PATCH 11/19] iwlwifi: mvm: set the default cTDP budget Luca Coelho
2017-08-05 19:43 ` [PATCH 12/19] iwlwifi: mvm: support new beacon template command Luca Coelho
2017-08-07 13:22   ` Kalle Valo
2017-08-09  6:46     ` [PATCH v2 " Luca Coelho
2017-08-09 18:20       ` [PATCH v3 " Luca Coelho
2017-08-05 19:43 ` [PATCH 13/19] iwlwifi: mvm: don't send CTDP commands via debugfs if not supported Luca Coelho
2017-08-05 19:43 ` [PATCH 14/19] iwlwifi: mvm: add station before allocating a queue Luca Coelho
2017-08-05 19:43 ` [PATCH 15/19] iwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue Luca Coelho
2017-08-05 19:43 ` Luca Coelho [this message]
2017-08-05 19:43 ` [PATCH 17/19] iwlwifi: remove references to unsupported HW Luca Coelho
2017-08-05 19:43 ` [PATCH 18/19] iwlwifi: pcie: free the TSO page when a Tx queue is unmapped on A000 devices Luca Coelho
2017-08-05 19:43 ` [PATCH 19/19] iwlwifi: mvm: fix the coex firmware API 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=20170805194331.17426-17-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=golan.ben.ami@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).