From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 3/5] ath10k: remove early irq handling
Date: Wed, 13 Aug 2014 17:09:45 +0300 [thread overview]
Message-ID: <878umspjkm.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1407402260-29854-4-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Thu, 7 Aug 2014 11:04:18 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
> It's not really necessary to have a dedicated irq
> handler just for the sake of catching early fw
> crashes. It is now safe to use one handler even
> during early stages of device boot up.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Nice, this really needs to be cleaned up.
> drivers/net/wireless/ath/ath10k/pci.c | 160 ++++++++--------------------------
> 1 file changed, 36 insertions(+), 124 deletions(-)
Shouldn't you also remove early_irq_tasklet from struct ath10k_pci?
> -static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
> +static bool ath10k_pci_fw_crashed(struct ath10k *ar)
> {
> - struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
> - u32 fw_indicator;
> -
> - fw_indicator = ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS);
> -
> - if (fw_indicator & FW_IND_EVENT_PENDING) {
> - /* ACK: clear Target-side pending event */
> - ath10k_pci_write32(ar, FW_INDICATOR_ADDRESS,
> - fw_indicator & ~FW_IND_EVENT_PENDING);
> + return ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS) &
> + FW_IND_EVENT_PENDING;
> +}
Hehe, in Ben's firmware crash dump patches I renamed
ath10k_pci_hif_dump_area() to ath10k_pci_firmware_crashed(). So we now
have two very similarly named functions doing very different :)
I propose that you rename this function to ath10k_pci_is_fw_crashed() or
ath10k_pci_has_fw_crashed() and I rename ath10k_pci_hif_dump_area() to
ath10k_pci_fw_crashed_dump(). I think that we have pretty consistent
naming, no?
> +static void ath10k_pci_fw_crashed_clear(struct ath10k *ar)
> +{
> + ath10k_pci_write32(ar, FW_INDICATOR_ADDRESS,
> + (ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS) &
> + ~FW_IND_EVENT_PENDING));
Please don't embed calls like this, with a temporary variable you get it
more readable and the resulting code should be the same anyway.
> @@ -2412,14 +2322,6 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
> return -EIO;
> }
>
> - if (val & FW_IND_EVENT_PENDING) {
> - ath10k_warn("device has crashed during init\n");
> - ath10k_pci_write32(ar, FW_INDICATOR_ADDRESS,
> - val & ~FW_IND_EVENT_PENDING);
> - ath10k_pci_hif_dump_area(ar);
> - return -ECOMM;
> - }
I'm a bit worried about this. Are you relying now that the target will
always trigger an interrupt or what? If yes, how can we sure it will
happen on all possible cases? I would prefer to have some kind of safety
net anyway, even if it's just a simple warning.
--
Kalle Valo
next prev parent reply other threads:[~2014-08-13 14:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 9:04 [PATCH 0/5] ath10k: fixes 2014-08-07, part 2 Michal Kazior
2014-08-07 9:04 ` [PATCH 1/5] ath10k: fix legacy irq workaround Michal Kazior
2014-08-07 9:04 ` [PATCH 2/5] ath10k: setup irq method in probe Michal Kazior
2014-08-13 13:48 ` Kalle Valo
2014-08-18 13:47 ` Michal Kazior
2014-08-19 11:47 ` Kalle Valo
2014-08-07 9:04 ` [PATCH 3/5] ath10k: remove early irq handling Michal Kazior
2014-08-13 14:09 ` Kalle Valo [this message]
2014-08-18 13:51 ` Michal Kazior
2014-08-07 9:04 ` [PATCH 4/5] ath10k: split ce irq/handler setup Michal Kazior
2014-08-14 8:40 ` Kalle Valo
2014-08-19 12:30 ` Michal Kazior
2014-08-19 12:37 ` Kalle Valo
2014-08-07 9:04 ` [PATCH 5/5] ath10k: unmask ce irqs after posting rx buffers Michal Kazior
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=878umspjkm.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).