All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH 7/8] ath10k: re-add support for early fw indication
Date: Mon, 25 Nov 2013 14:20:00 +0200	[thread overview]
Message-ID: <87siukn05r.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1385125518-13461-8-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Fri, 22 Nov 2013 14:05:17 +0100")

Michal Kazior <michal.kazior@tieto.com> writes:

> It's possible for FW to panic during early boot or
> at driver teardown in some rare cases.
>
> The patch re-introduces support to detect and
> print those crashes.
>
> This introduces an additional irq handler that is
> set for the duration of early boot and shutdown.
> The handler is then overriden with regular
> handlers upon hif start().
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -59,6 +59,8 @@ static int ath10k_pci_init_irq(struct ath10k *ar);
>  static int ath10k_pci_deinit_irq(struct ath10k *ar);
>  static int ath10k_pci_request_irq(struct ath10k *ar);
>  static void ath10k_pci_free_irq(struct ath10k *ar);
> +static int ath10k_pci_request_early_irq(struct ath10k *ar);
> +static void ath10k_pci_free_early_irq(struct ath10k *ar);

We should always try to avoid using forward declarations. If I
understood correctly these are not needed.

>  static int ath10k_pci_bmi_wait(struct ath10k_ce_pipe *tx_pipe,
>  			       struct ath10k_ce_pipe *rx_pipe,
>  			       struct bmi_xfer *xfer);
> @@ -876,6 +878,7 @@ static void ath10k_pci_kill_tasklet(struct ath10k *ar)
>  
>  	tasklet_kill(&ar_pci->intr_tq);
>  	tasklet_kill(&ar_pci->msi_fw_err);
> +	tasklet_kill(&ar_pci->early_irq_tasklet);
>  
>  	for (i = 0; i < CE_COUNT; i++)
>  		tasklet_kill(&ar_pci->pipe_info[i].intr);
> @@ -1188,12 +1191,15 @@ static int ath10k_pci_post_rx(struct ath10k *ar)
>  static int ath10k_pci_hif_start(struct ath10k *ar)
>  {
>  	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
> -	int ret;
> +	int ret, ret2;
> +
> +	ath10k_pci_free_early_irq(ar);
> +	ath10k_pci_kill_tasklet(ar);

Calling kill_tasklet() looks a bit odd here when you only want to kill
early_irq_tasklet. But I guess that's ok.

>  	ret = ath10k_pci_start_ce(ar);
>  	if (ret) {
>  		ath10k_warn("failed to start CE: %d\n", ret);
> -		return ret;
> +		goto err_early_irq;
>  	}
>  
>  	ret = ath10k_pci_request_irq(ar);
> @@ -1219,6 +1225,11 @@ err_free_irq:
>  	ath10k_pci_kill_tasklet(ar);
>  err_stop_ce:
>  	ath10k_pci_stop_ce(ar);
> +err_early_irq:
> +	ret2 = ath10k_pci_request_early_irq(ar);
> +	if (ret2)
> +		ath10k_warn("failed to re-enable early irq: %d\n", ret2);

ret_early or something like that would be a nicer name.

> @@ -1952,6 +1975,9 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar)
>  {
>  	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
>  
> +	ath10k_ce_disable_interrupts(ar);
> +	ath10k_pci_free_early_irq(ar);
> +	ath10k_pci_kill_tasklet(ar);

Should disable_interrupts() and kill_tasklet() be in an earlier patch?

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
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 7/8] ath10k: re-add support for early fw indication
Date: Mon, 25 Nov 2013 14:20:00 +0200	[thread overview]
Message-ID: <87siukn05r.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1385125518-13461-8-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Fri, 22 Nov 2013 14:05:17 +0100")

Michal Kazior <michal.kazior@tieto.com> writes:

> It's possible for FW to panic during early boot or
> at driver teardown in some rare cases.
>
> The patch re-introduces support to detect and
> print those crashes.
>
> This introduces an additional irq handler that is
> set for the duration of early boot and shutdown.
> The handler is then overriden with regular
> handlers upon hif start().
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -59,6 +59,8 @@ static int ath10k_pci_init_irq(struct ath10k *ar);
>  static int ath10k_pci_deinit_irq(struct ath10k *ar);
>  static int ath10k_pci_request_irq(struct ath10k *ar);
>  static void ath10k_pci_free_irq(struct ath10k *ar);
> +static int ath10k_pci_request_early_irq(struct ath10k *ar);
> +static void ath10k_pci_free_early_irq(struct ath10k *ar);

We should always try to avoid using forward declarations. If I
understood correctly these are not needed.

>  static int ath10k_pci_bmi_wait(struct ath10k_ce_pipe *tx_pipe,
>  			       struct ath10k_ce_pipe *rx_pipe,
>  			       struct bmi_xfer *xfer);
> @@ -876,6 +878,7 @@ static void ath10k_pci_kill_tasklet(struct ath10k *ar)
>  
>  	tasklet_kill(&ar_pci->intr_tq);
>  	tasklet_kill(&ar_pci->msi_fw_err);
> +	tasklet_kill(&ar_pci->early_irq_tasklet);
>  
>  	for (i = 0; i < CE_COUNT; i++)
>  		tasklet_kill(&ar_pci->pipe_info[i].intr);
> @@ -1188,12 +1191,15 @@ static int ath10k_pci_post_rx(struct ath10k *ar)
>  static int ath10k_pci_hif_start(struct ath10k *ar)
>  {
>  	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
> -	int ret;
> +	int ret, ret2;
> +
> +	ath10k_pci_free_early_irq(ar);
> +	ath10k_pci_kill_tasklet(ar);

Calling kill_tasklet() looks a bit odd here when you only want to kill
early_irq_tasklet. But I guess that's ok.

>  	ret = ath10k_pci_start_ce(ar);
>  	if (ret) {
>  		ath10k_warn("failed to start CE: %d\n", ret);
> -		return ret;
> +		goto err_early_irq;
>  	}
>  
>  	ret = ath10k_pci_request_irq(ar);
> @@ -1219,6 +1225,11 @@ err_free_irq:
>  	ath10k_pci_kill_tasklet(ar);
>  err_stop_ce:
>  	ath10k_pci_stop_ce(ar);
> +err_early_irq:
> +	ret2 = ath10k_pci_request_early_irq(ar);
> +	if (ret2)
> +		ath10k_warn("failed to re-enable early irq: %d\n", ret2);

ret_early or something like that would be a nicer name.

> @@ -1952,6 +1975,9 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar)
>  {
>  	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
>  
> +	ath10k_ce_disable_interrupts(ar);
> +	ath10k_pci_free_early_irq(ar);
> +	ath10k_pci_kill_tasklet(ar);

Should disable_interrupts() and kill_tasklet() be in an earlier patch?

-- 
Kalle Valo

  reply	other threads:[~2013-11-25 12:20 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 13:05 [PATCH 0/8] ath10k: pci fixes 2013-11-22 Michal Kazior
2013-11-22 13:05 ` Michal Kazior
2013-11-22 13:05 ` [PATCH 1/8] ath10k: don't consume other's shared interrupts Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-24 13:59   ` Kalle Valo
2013-11-24 13:59     ` Kalle Valo
2013-11-22 13:05 ` [PATCH 2/8] ath10k: split up pci irq code Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-22 13:05 ` [PATCH 3/8] ath10k: fix memory leak on hif_start failpath Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-22 13:05 ` [PATCH 4/8] ath10k: don't use interrupts for BMI Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-22 13:05 ` [PATCH 5/8] ath10k: defer irq registration until hif start() Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-22 13:05 ` [PATCH 6/8] ath10k: extract functions for legacy irq handling Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-22 13:05 ` [PATCH 7/8] ath10k: re-add support for early fw indication Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-25 12:20   ` Kalle Valo [this message]
2013-11-25 12:20     ` Kalle Valo
2013-11-25 12:46     ` Michal Kazior
2013-11-25 12:46       ` Michal Kazior
2013-11-22 13:05 ` [PATCH 8/8] ath10k: allow explicit MSI/MSI-X disabling Michal Kazior
2013-11-22 13:05   ` Michal Kazior
2013-11-25 12:01   ` Kalle Valo
2013-11-25 12:01     ` Kalle Valo
2013-11-25 13:06 ` [PATCH v2 0/8] ath10k: pci fixes 2013-11-22 Michal Kazior
2013-11-25 13:06   ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 1/8] ath10k: don't consume other's shared interrupts Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 2/8] ath10k: split up pci irq code Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 3/8] ath10k: don't use interrupts for BMI Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 4/8] ath10k: decouple ath10k_pci_start_ce() Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 5/8] ath10k: defer irq registration until hif start() Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 6/8] ath10k: extract functions for legacy irq handling Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 7/8] ath10k: re-add support for early fw indication Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-25 13:06   ` [PATCH v2 8/8] ath10k: allow explicit MSI/MSI-X disabling Michal Kazior
2013-11-25 13:06     ` Michal Kazior
2013-11-27 14:47     ` Kalle Valo
2013-11-27 14:47       ` Kalle Valo
2013-11-27 14:48   ` [PATCH v2 0/8] ath10k: pci fixes 2013-11-22 Kalle Valo
2013-11-27 14:48     ` Kalle Valo

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=87siukn05r.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 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.