[PATCH v7 6/8] ath10k: save firmware RAM and ROM BSS sections on crash
Michal Kazior
michal.kazior at tieto.com
Tue Aug 19 02:39:20 PDT 2014
On 19 August 2014 10:23, Kalle Valo <kvalo at qca.qualcomm.com> wrote:
> From: Ben Greear <greearb at candelatech.com>
>
> This can be used to get a useful back trace out of a firmware
> crash that involves an interrupt handler. For instance, a
> null-pointer-exception would be this kind of trace. A user-space
> tool can read the debugfs file and decode things as wished.
>
> This requires a packaged firmware with a new IE to describe the
> BSS section starts and length.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>
> Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
> ---
[...]
> +static void ath10k_pci_dump_bss_ram(struct ath10k *ar,
> + struct ath10k_fw_crash_data *crash_data) {
> + int ret;
> +
> + lockdep_assert_held(&ar->data_lock);
> +
> + if (!ar->fw.ram_bss_addr)
> + return;
> +
> + if (!ar->fw.ram_bss_len)
> + return;
> +
> + ret = ath10k_pci_diag_read_mem(ar, ar->fw.ram_bss_addr,
> + crash_data->ram_bss_buf,
> + ar->fw.ram_bss_len);
> + if (ret)
> + ath10k_warn("failed to read firmware RAM BSS memory from %d (%d B): %d\n",
> + ar->fw.ram_bss_addr, ar->fw.ram_bss_len, ret);
> +}
> +
> +static void ath10k_pci_dump_bss_rom(struct ath10k *ar,
> + struct ath10k_fw_crash_data *crash_data)
> +{
> + int ret;
> +
> + lockdep_assert_held(&ar->data_lock);
> +
> + if (!ar->fw.rom_bss_addr)
> + return;
> +
> + if (!ar->fw.rom_bss_len)
> + return;
> +
> + ret = ath10k_pci_diag_read_mem(ar, ar->fw.rom_bss_addr,
> + crash_data->rom_bss_buf,
> + ar->fw.rom_bss_len);
> + if (ret)
> + ath10k_warn("failed to read firmware ROM BSS memory from %d (%d B): %d\n",
> + ar->fw.rom_bss_addr, ar->fw.rom_bss_len, ret);
> +}
Ditto as with other patches - endianess mess.
Michał
More information about the ath10k
mailing list