From: Ben Greear <greearb@candelatech.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: ath10k@lists.infradead.org
Subject: Re: [PATCH v5 0/7] ath10k: firmware crash dump
Date: Fri, 08 Aug 2014 14:32:22 -0700 [thread overview]
Message-ID: <53E541E6.50707@candelatech.com> (raw)
In-Reply-To: <20140808201815.20713.85582.stgit@potku.adurom.net>
On 08/08/2014 01:28 PM, Kalle Valo wrote:
> Hi,
>
> here's my reworked Ben's patchset adding firmware crash dump support to ath10k.
> Unfortunately this crashes when reading the stack dump from the firmware but
> time run out for me to fix that and I wanted to send this for comments anyway.
>
> I did quite a lot of changes, basically to simplify the code, remove ifdefs and
> so on. Here's some sort of list what I did:
>
> * dump_data->tv_sec and tv_nsec to 64 bits (because long can be 32 bits
> on some platforms)
I did u32 on purpose because I know how to do ntohl, htonl if I need
to flip the machine order in user-space. Is there something similar
for 64-bit numbers?
> * fix long lines
>
> * renamed ath10k_dbg_save_fw_dbg_buffer() to ath10k_debug_dbglog_add()
>
> * add helpers for ath10k_pci_diag* functions
>
> * refactor and rename ath10k_pci_hif_dump_area()
>
> * latest crash dump is always stored (instead of the oldest unread)
At least with the kernel, the first crash is normally the most useful,
so I figured the same would be true of the firmware (a firmware crash
is excellent way to find hidden bugs in the driver, so upon crash/reload,
it is more likely that the driver will be screwed up and thus mis-configure
firmware...)
>
> * add ath10k_debug_get_fw_crash_data()
>
> * move fw_r?m_bss_* fields to ar->fw
>
> * struct ath10k_fw_crash_data is allocated with vmalloc()
>
> * atomic allocation in ath10k_pci_dump_bss() is bad, fix that by using vmalloc
> in module initialisation
>
> * separate FW IE entries for BSS regions
>
> * don't use ath10k_err()
>
> * simplify locking and memory allocation for FW IE handling
>
> * add uuid
>
> * move struct ath10k_dump_file_data and enum ath10k_fw_error_dump_type to debug.c
>
> * function and variable naming, using ath10k_fw_crash_ prefix etc
>
> * change warning and debug messages to follow ath10k style
>
> * add ath10k_debug_get_new_fw_crash_data() to avoid ifdefs in pci.c
>
> And I still have TODO:
>
> * rename crashed_since_read to crashed?
>
> * atomic allocation in ath10k_pci_dump_dbglog() is bad. Should we
> allocate a big buffer with vmalloc and use that?
dbglog entries are probably never going to be large, they are currently
in the 2k range, so vmalloc is likely overkill. If you want it allocated
at startup, just choose a 4k buffer size, can put the buffer right in
the debug struct or something like that so you don't even have more memory
management to deal with. It will waste 4k of RAM for normal use, however.
>
> * what should ath10k_fw_error_dump_open() do if firmware hasn't
> crashed? check crashed_since_read and return zero len file? or an
> error code? -ENOMSG?
Maybe a mostly empty crash log with just the header, should be easy enough
to figure out it's not really a crash. If we use udev to gather these,
it is likely to be stupid shell scripts doing a lot of the work, so
being clever on return codes might not be helpful.
> * should the crash dump file actually be in little endian? would that
> be easier/simpler?
I think it is about the same amount of work in user-space, so I'd
keep the kernel simple and dump in the CPU's endian-ness. I don't
care that much either way, however.
> * should ath10k_pci_hif_dump_area() hold the lock all the time? That
> way we would guarantee that changes to ath10k_fw_crash_data are
> atomic.
I don't think it's worth trying to do that.
I'll go dig through the patches in a bit..have to figure out why systemd
is fcked up on my lab machine first. :P
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
next prev parent reply other threads:[~2014-08-08 21:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 20:28 [PATCH v5 0/7] ath10k: firmware crash dump Kalle Valo
2014-08-08 20:28 ` [PATCH v5 1/7] ath10k: add ath10k_pci_diag_* helpers Kalle Valo
2014-08-08 20:28 ` [PATCH v5 2/7] ath10k: provide firmware crash info via debugfs Kalle Valo
2014-08-08 22:26 ` Ben Greear
2014-08-09 5:52 ` Kalle Valo
2014-08-08 20:28 ` [PATCH v5 3/7] ath10k: save firmware debug log messages Kalle Valo
2014-08-08 20:29 ` [PATCH v5 4/7] ath10k: save firmware stack upon firmware crash Kalle Valo
2014-08-08 20:29 ` [PATCH v5 5/7] ath10k: dump exception stack contents on " Kalle Valo
2014-08-08 20:29 ` [PATCH v5 6/7] ath10k: save firmware RAM and ROM BSS sections on crash Kalle Valo
2014-08-08 22:36 ` Ben Greear
2014-08-09 6:05 ` Kalle Valo
2014-08-09 16:54 ` Ben Greear
2014-08-09 17:31 ` Kalle Valo
2014-08-08 20:29 ` [PATCH v5 7/7] ath10k: rename ath10k_pci_hif_dump_area() to ath10k_pci_firmware_crashed() Kalle Valo
2014-08-08 21:32 ` Ben Greear [this message]
2014-08-09 5:50 ` [PATCH v5 0/7] ath10k: firmware crash dump Kalle Valo
2014-08-09 16:51 ` Ben Greear
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=53E541E6.50707@candelatech.com \
--to=greearb@candelatech.com \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@qca.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.