iwlwifi: yoyo: dump IMR DRAM only for HW and FW error
authorMukesh Sisodiya <mukesh.sisodiya@intel.com>
Fri, 4 Mar 2022 11:21:23 +0000 (13:21 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 10 Mar 2022 07:23:28 +0000 (09:23 +0200)
Support debug collection of the platform IMR memory region
only for HW and FW error. This region needs to be collected
as the last region.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5b70e5ba9a41.I502f9b6179b97b163992729edd2b3c5c4ca9e311@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c

index 1083922..53f0fe7 100644 (file)
@@ -2430,6 +2430,9 @@ static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
        struct iwl_dump_ini_region_data reg_data = {
                .dump_data = dump_data,
        };
+       struct iwl_dump_ini_region_data imr_reg_data = {
+               .dump_data = dump_data,
+       };
        int i;
        u32 size = 0;
        u64 regions_mask = le64_to_cpu(trigger->regions_mask) &
@@ -2465,10 +2468,32 @@ static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
                                 tp_id);
                        continue;
                }
+               /*
+                * DRAM_IMR can be collected only for FW/HW error timepoint
+                * when fw is not alive. In addition, it must be collected
+                * lastly as it overwrites SRAM that can possibly contain
+                * debug data which also need to be collected.
+                */
+               if (reg_type == IWL_FW_INI_REGION_DRAM_IMR) {
+                       if (tp_id == IWL_FW_INI_TIME_POINT_FW_ASSERT ||
+                           tp_id == IWL_FW_INI_TIME_POINT_FW_HW_ERROR)
+                               imr_reg_data.reg_tlv = fwrt->trans->dbg.active_regions[i];
+                       else
+                               IWL_INFO(fwrt,
+                                        "WRT: trying to collect DRAM_IMR at time point: %d, skipping\n",
+                                        tp_id);
+               /* continue to next region */
+                       continue;
+               }
+
 
                size += iwl_dump_ini_mem(fwrt, list, &reg_data,
                                         &iwl_dump_ini_region_ops[reg_type]);
        }
+       /* collect DRAM_IMR region in the last */
+       if (imr_reg_data.reg_tlv)
+               size += iwl_dump_ini_mem(fwrt, list, &reg_data,
+                                        &iwl_dump_ini_region_ops[IWL_FW_INI_REGION_DRAM_IMR]);
 
        if (size)
                size += iwl_dump_ini_info(fwrt, trigger, list);