iwlwifi: fix nmi triggering from host
authorGolan Ben-Ami <golan.ben.ami@intel.com>
Wed, 28 Jun 2017 10:03:58 +0000 (13:03 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 9 Aug 2017 18:14:43 +0000 (21:14 +0300)
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
drivers/net/wireless/intel/iwlwifi/iwl-prph.h

index c527b8c103700136c70f12068c5b7bf5a96be8d5..efb1998dcabd44df0ec44e8e3fbd8f80ae01e956 100644 (file)
@@ -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);
 
index fbce97ed4ecd02c6cf9d17b5ac42728e2a509a20..421a869633a32d861919dc80f11f23500f398ace 100644 (file)
 /* 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