]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
iwlwifi: mvm: change the format of the SRAM dump
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 15 Jan 2014 08:01:29 +0000 (10:01 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 3 Feb 2014 20:23:35 +0000 (22:23 +0200)
As a debug tool, we dump the SRAM from the device when an
error occurs. The main users of this want it in a different
format, so change the format to suit their needs.
Also - add a short delay between the prints to make sure
that the user space logger can catch up.

This happens only when the firmware asserts, and only when
fw_restart is set to 0 which is typically a testing
configuration.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/utils.c

index 1aadede26919c1ac56b03cea0c939e53bd34b878..b2162328ac9644c7e2f96b2c18bb490992486b9a 100644 (file)
@@ -457,7 +457,8 @@ void iwl_mvm_dump_sram(struct iwl_mvm *mvm)
 {
        const struct fw_img *img;
        int ofs, len = 0;
-       u8 *buf;
+       int i;
+       __le32 *buf;
 
        if (!mvm->ucode_loaded)
                return;
@@ -471,7 +472,12 @@ void iwl_mvm_dump_sram(struct iwl_mvm *mvm)
                return;
 
        iwl_trans_read_mem_bytes(mvm->trans, ofs, buf, len);
-       iwl_print_hex_error(mvm->trans, buf, len);
+       len = len >> 2;
+       for (i = 0; i < len; i++) {
+               IWL_ERR(mvm, "0x%08X\n", le32_to_cpu(buf[i]));
+               /* Add a small delay to let syslog catch up */
+               udelay(10);
+       }
 
        kfree(buf);
 }