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 v3 1/2] ath10k: handle cycle counter wraparound
Date: Fri, 22 May 2015 15:12:59 +0300 [thread overview]
Message-ID: <87vbfk4xpw.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=xNbcQv+FVZWUAki5f0zQ_F0hTW3V6FkTp-DzQOr-FFA@mail.gmail.com> (Michal Kazior's message of "Fri, 22 May 2015 14:00:05 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
> On 22 May 2015 at 13:56, Michal Kazior <michal.kazior@tieto.com> wrote:
>> On 22 May 2015 at 13:36, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>>> Michal Kazior <michal.kazior@tieto.com> writes:
> [...]
>>>> +void ath10k_core_get_cc_delta(struct ath10k *ar,
>>>> + u32 *cc_delta, u32 *rcc_delta,
>>>> + u32 cc, u32 rcc,
>>>> + u32 cc_prev, u32 rcc_prev)
>>>> +{
>>>> + if (ar->hw_params.has_shifted_cc_wraparound && cc < cc_prev) {
>>>> + cc_prev -= 0x7fffffff;
>>>> + rcc *= 2;
>>>> + }
>>>> +
>>>> + *cc_delta = cc - cc_prev;
>>>> + *rcc_delta = rcc - rcc_prev;
>>>> +}
>>>
>>> Why do you have this function in core.c? Why not in wmi.c?
>>
>> I don't consider this a part of WMI protocol per se. It's a logic
>> which happens to be used with values delivered via WMI but is chip
>> specific otherwise. For what it's worth we could be reading CC
>> registers, e.g. directly via MMIO.
>
> Now that I think about it this would fit into hw.c as well.
Yeah, hw.c would be much better. And we could start adding more similar
hw adaptation code there in 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 v3 1/2] ath10k: handle cycle counter wraparound
Date: Fri, 22 May 2015 15:12:59 +0300 [thread overview]
Message-ID: <87vbfk4xpw.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=xNbcQv+FVZWUAki5f0zQ_F0hTW3V6FkTp-DzQOr-FFA@mail.gmail.com> (Michal Kazior's message of "Fri, 22 May 2015 14:00:05 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
> On 22 May 2015 at 13:56, Michal Kazior <michal.kazior@tieto.com> wrote:
>> On 22 May 2015 at 13:36, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>>> Michal Kazior <michal.kazior@tieto.com> writes:
> [...]
>>>> +void ath10k_core_get_cc_delta(struct ath10k *ar,
>>>> + u32 *cc_delta, u32 *rcc_delta,
>>>> + u32 cc, u32 rcc,
>>>> + u32 cc_prev, u32 rcc_prev)
>>>> +{
>>>> + if (ar->hw_params.has_shifted_cc_wraparound && cc < cc_prev) {
>>>> + cc_prev -= 0x7fffffff;
>>>> + rcc *= 2;
>>>> + }
>>>> +
>>>> + *cc_delta = cc - cc_prev;
>>>> + *rcc_delta = rcc - rcc_prev;
>>>> +}
>>>
>>> Why do you have this function in core.c? Why not in wmi.c?
>>
>> I don't consider this a part of WMI protocol per se. It's a logic
>> which happens to be used with values delivered via WMI but is chip
>> specific otherwise. For what it's worth we could be reading CC
>> registers, e.g. directly via MMIO.
>
> Now that I think about it this would fit into hw.c as well.
Yeah, hw.c would be much better. And we could start adding more similar
hw adaptation code there in the future.
--
Kalle Valo
next prev parent reply other threads:[~2015-05-22 12:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 22:29 [PATCH v2] ath10k: handle cycle count wrap around Srinivasa Duvvuri
2015-05-18 12:05 ` Michal Kazior
2015-05-22 8:18 ` [PATCH v3 1/2] ath10k: handle cycle counter wraparound Michal Kazior
2015-05-22 8:18 ` Michal Kazior
2015-05-22 8:18 ` [PATCH v3 2/2] ath10k: fix inconsistent survey reports Michal Kazior
2015-05-22 8:18 ` Michal Kazior
2015-05-22 11:36 ` [PATCH v3 1/2] ath10k: handle cycle counter wraparound Kalle Valo
2015-05-22 11:36 ` Kalle Valo
2015-05-22 11:56 ` Michal Kazior
2015-05-22 11:56 ` Michal Kazior
2015-05-22 12:00 ` Michal Kazior
2015-05-22 12:00 ` Michal Kazior
2015-05-22 12:12 ` Kalle Valo [this message]
2015-05-22 12:12 ` Kalle Valo
[not found] ` <CACZoB6-+AUWN6gBqnwgJY101jfjBkDukLYNNffbe2bWNidjJ0Q@mail.gmail.com>
2015-05-25 8:23 ` Michal Kazior
2015-05-25 8:23 ` Michal Kazior
2015-05-25 12:06 ` [PATCH v4 1/3] ath10k: move cycle_count macro Michal Kazior
2015-05-25 12:06 ` Michal Kazior
2015-05-25 12:06 ` [PATCH v4 2/3] ath10k: handle cycle counter wraparound Michal Kazior
2015-05-25 12:06 ` Michal Kazior
2015-05-25 12:06 ` [PATCH v4 3/3] ath10k: fix inconsistent survey reports Michal Kazior
2015-05-25 12:06 ` Michal Kazior
2015-05-29 14:41 ` [PATCH v4 1/3] ath10k: move cycle_count macro Kalle Valo
2015-05-29 14:41 ` Kalle Valo
2015-05-20 12:42 ` [PATCH v2] ath10k: handle cycle count wrap around 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=87vbfk4xpw.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.