From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH 2/5] ath10k: setup irq method in probe
Date: Tue, 19 Aug 2014 14:47:44 +0300 [thread overview]
Message-ID: <8738csbt0f.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQmTiEaZ03Nu-UiOn2ObW8e-m7it7_Th2KKCn+byFP+mPg@mail.gmail.com> (Michal Kazior's message of "Mon, 18 Aug 2014 15:47:03 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
>>> @@ -1905,22 +1915,10 @@ static int __ath10k_pci_hif_power_up(struct ath10k *ar, bool cold_reset)
>>> goto err;
>>> }
>>>
>>> - ret = ath10k_ce_disable_interrupts(ar);
>>> - if (ret) {
>>> - ath10k_err("failed to disable CE interrupts: %d\n", ret);
>>> - goto err_ce;
>>> - }
>>> -
>>> - ret = ath10k_pci_init_irq(ar);
>>> - if (ret) {
>>> - ath10k_err("failed to init irqs: %d\n", ret);
>>> - goto err_ce;
>>> - }
>>> -
>>> ret = ath10k_pci_request_early_irq(ar);
>>> if (ret) {
>>> ath10k_err("failed to request early irq: %d\n", ret);
>>> - goto err_deinit_irq;
>>> + goto err_ce;
>>> }
>>
>> You add ath10k_pci_ce_init() to probe() and respective
>> ath10k_pci_ce_deinit() to remove(), and you remove
>> ath10k_pci_ce_deinit() from hif_power_down(). But why do you leave
>> ath10k_pci_ce_init() to hif_power_up()? Isn't that unnecessary as we
>> already do that in probe()?
>
> Hmm.. I didn't check if copy engine register state (notable ring index
> values) is guaranteed to be usable in all cases yet and decided it's
> safer to just re-init it on each power up until it is proven it is not
> necessary.
So I have been trying to follow this naming scheme for initilisation:
_create() - called during device probe time
_start() - if up / power up
_stop() - if down / power down
_destroy() - called when device is removed
If you call ce_init() both in create() and start() time there has to be
some redundant code and I think the function should be split. This isn't
a concern now, but something for the future.
--
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" <ath10k@lists.infradead.org>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 2/5] ath10k: setup irq method in probe
Date: Tue, 19 Aug 2014 14:47:44 +0300 [thread overview]
Message-ID: <8738csbt0f.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQmTiEaZ03Nu-UiOn2ObW8e-m7it7_Th2KKCn+byFP+mPg@mail.gmail.com> (Michal Kazior's message of "Mon, 18 Aug 2014 15:47:03 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
>>> @@ -1905,22 +1915,10 @@ static int __ath10k_pci_hif_power_up(struct ath10k *ar, bool cold_reset)
>>> goto err;
>>> }
>>>
>>> - ret = ath10k_ce_disable_interrupts(ar);
>>> - if (ret) {
>>> - ath10k_err("failed to disable CE interrupts: %d\n", ret);
>>> - goto err_ce;
>>> - }
>>> -
>>> - ret = ath10k_pci_init_irq(ar);
>>> - if (ret) {
>>> - ath10k_err("failed to init irqs: %d\n", ret);
>>> - goto err_ce;
>>> - }
>>> -
>>> ret = ath10k_pci_request_early_irq(ar);
>>> if (ret) {
>>> ath10k_err("failed to request early irq: %d\n", ret);
>>> - goto err_deinit_irq;
>>> + goto err_ce;
>>> }
>>
>> You add ath10k_pci_ce_init() to probe() and respective
>> ath10k_pci_ce_deinit() to remove(), and you remove
>> ath10k_pci_ce_deinit() from hif_power_down(). But why do you leave
>> ath10k_pci_ce_init() to hif_power_up()? Isn't that unnecessary as we
>> already do that in probe()?
>
> Hmm.. I didn't check if copy engine register state (notable ring index
> values) is guaranteed to be usable in all cases yet and decided it's
> safer to just re-init it on each power up until it is proven it is not
> necessary.
So I have been trying to follow this naming scheme for initilisation:
_create() - called during device probe time
_start() - if up / power up
_stop() - if down / power down
_destroy() - called when device is removed
If you call ce_init() both in create() and start() time there has to be
some redundant code and I think the function should be split. This isn't
a concern now, but something for the future.
--
Kalle Valo
next prev parent reply other threads:[~2014-08-19 11:48 UTC|newest]
Thread overview: 28+ 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 ` Michal Kazior
2014-08-07 9:04 ` [PATCH 1/5] ath10k: fix legacy irq workaround Michal Kazior
2014-08-07 9:04 ` Michal Kazior
2014-08-07 9:04 ` [PATCH 2/5] ath10k: setup irq method in probe Michal Kazior
2014-08-07 9:04 ` Michal Kazior
2014-08-13 13:48 ` Kalle Valo
2014-08-13 13:48 ` Kalle Valo
2014-08-18 13:47 ` Michal Kazior
2014-08-18 13:47 ` Michal Kazior
2014-08-19 11:47 ` Kalle Valo [this message]
2014-08-19 11:47 ` Kalle Valo
2014-08-07 9:04 ` [PATCH 3/5] ath10k: remove early irq handling Michal Kazior
2014-08-07 9:04 ` Michal Kazior
2014-08-13 14:09 ` Kalle Valo
2014-08-13 14:09 ` Kalle Valo
2014-08-18 13:51 ` Michal Kazior
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-07 9:04 ` Michal Kazior
2014-08-14 8:40 ` Kalle Valo
2014-08-14 8:40 ` Kalle Valo
2014-08-19 12:30 ` Michal Kazior
2014-08-19 12:30 ` Michal Kazior
2014-08-19 12:37 ` Kalle Valo
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
2014-08-07 9:04 ` 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=8738csbt0f.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.