From: Ben Greear <greearb@candelatech.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Michal Kazior <michal.kazior@tieto.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH v2 03/10] ath10k: support ethtool stats.
Date: Mon, 29 Sep 2014 09:07:06 -0700 [thread overview]
Message-ID: <542983AA.9040200@candelatech.com> (raw)
In-Reply-To: <87eguu3ki1.fsf@kamboji.qca.qualcomm.com>
On 09/29/2014 01:21 AM, Kalle Valo wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>> On 09/24/2014 12:44 AM, Michal Kazior wrote:
>>> On 23 September 2014 23:17, <greearb@candelatech.com> wrote:
>>> [...]
>>>> +void ath10k_get_et_stats(struct ieee80211_hw *hw,
>>>> + struct ieee80211_vif *vif,
>>>> + struct ethtool_stats *stats, u64 *data)
>>>> +{
>>>> + struct ath10k *ar = hw->priv;
>>>> + int i = 0;
>>>> + struct ath10k_target_stats *fw_stats;
>>>> +
>>>> + fw_stats = &ar->debug.target_stats;
>>>> +
>>>> + mutex_lock(&ar->conf_mutex);
>>>> +
>>>> + if (ar->state == ATH10K_STATE_ON)
>>>> + ath10k_refresh_peer_stats(ar);
>>>> +
>>>> + mutex_unlock(&ar->conf_mutex);
>>>
>>> Just for correctness sake - it's probably a good idea to
>>> mutex_unlock() at the end (i.e. after spin_unlock_bh()) to make sure
>>> the stats are for this particular request. With your patch there's a
>>> very slight chance that, e.g. fw_stats debug file is being read at the
>>> same time and it updates fw stats between the above mutex_unlock() and
>>> following spin_lock_bh().
>>
>> That makes no difference at all to the user though, and it is one less
>> set of nested locks to worry about.
>
> I still do not want to have known races, especially when it's so easy to
> fix. The ethtool patches patches conflict with Michal's fw_stats fixes.
> Let me take the ethtool patches so that I can rebase them, fix this race
> and do some other small changes as well. I'll send v2 soon.
Your v2 patches are fine with me.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
WARNING: multiple messages have this Message-ID (diff)
From: Ben Greear <greearb@candelatech.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Michal Kazior <michal.kazior@tieto.com>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH v2 03/10] ath10k: support ethtool stats.
Date: Mon, 29 Sep 2014 09:07:06 -0700 [thread overview]
Message-ID: <542983AA.9040200@candelatech.com> (raw)
In-Reply-To: <87eguu3ki1.fsf@kamboji.qca.qualcomm.com>
On 09/29/2014 01:21 AM, Kalle Valo wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>> On 09/24/2014 12:44 AM, Michal Kazior wrote:
>>> On 23 September 2014 23:17, <greearb@candelatech.com> wrote:
>>> [...]
>>>> +void ath10k_get_et_stats(struct ieee80211_hw *hw,
>>>> + struct ieee80211_vif *vif,
>>>> + struct ethtool_stats *stats, u64 *data)
>>>> +{
>>>> + struct ath10k *ar = hw->priv;
>>>> + int i = 0;
>>>> + struct ath10k_target_stats *fw_stats;
>>>> +
>>>> + fw_stats = &ar->debug.target_stats;
>>>> +
>>>> + mutex_lock(&ar->conf_mutex);
>>>> +
>>>> + if (ar->state == ATH10K_STATE_ON)
>>>> + ath10k_refresh_peer_stats(ar);
>>>> +
>>>> + mutex_unlock(&ar->conf_mutex);
>>>
>>> Just for correctness sake - it's probably a good idea to
>>> mutex_unlock() at the end (i.e. after spin_unlock_bh()) to make sure
>>> the stats are for this particular request. With your patch there's a
>>> very slight chance that, e.g. fw_stats debug file is being read at the
>>> same time and it updates fw stats between the above mutex_unlock() and
>>> following spin_lock_bh().
>>
>> That makes no difference at all to the user though, and it is one less
>> set of nested locks to worry about.
>
> I still do not want to have known races, especially when it's so easy to
> fix. The ethtool patches patches conflict with Michal's fw_stats fixes.
> Let me take the ethtool patches so that I can rebase them, fix this race
> and do some other small changes as well. I'll send v2 soon.
Your v2 patches are fine with me.
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-09-29 16:07 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 21:17 [PATCH v2 01/10] ath10k: use 64-bit vdev map greearb
2014-09-23 21:17 ` greearb
2014-09-23 21:17 ` [PATCH v2 02/10] ath10k: add helper method to grab debug stats greearb
2014-09-23 21:17 ` greearb
2014-09-23 21:17 ` [PATCH v2 03/10] ath10k: support ethtool stats greearb
2014-09-23 21:17 ` greearb
2014-09-24 7:44 ` Michal Kazior
2014-09-24 7:44 ` Michal Kazior
2014-09-24 14:37 ` Ben Greear
2014-09-24 14:37 ` Ben Greear
2014-09-29 8:21 ` Kalle Valo
2014-09-29 8:21 ` Kalle Valo
2014-09-29 16:07 ` Ben Greear [this message]
2014-09-29 16:07 ` Ben Greear
2014-09-23 21:17 ` [PATCH v2 04/10] ath10k: make firmware text debug messages more verbose greearb
2014-09-23 21:17 ` greearb
2014-11-22 15:28 ` Kalle Valo
2014-11-22 15:28 ` Kalle Valo
2014-11-22 16:07 ` Ben Greear
2014-11-22 16:07 ` Ben Greear
2014-11-24 15:18 ` Kalle Valo
2014-11-24 15:18 ` Kalle Valo
2014-11-24 14:19 ` Kalle Valo
2014-11-24 14:19 ` Kalle Valo
2014-09-23 21:17 ` [PATCH v2 05/10] ath10k: apply chainmask settings to vdev on creation greearb
2014-09-23 21:17 ` greearb
2014-11-26 6:25 ` Kalle Valo
2014-11-26 6:25 ` Kalle Valo
2014-09-23 21:17 ` [PATCH v2 06/10] ath10k: use configured nss instead of max nss greearb
2014-09-23 21:17 ` greearb
2014-11-04 19:55 ` Ben Greear
2014-11-04 19:55 ` Ben Greear
2014-11-13 13:22 ` Kalle Valo
2014-11-13 13:22 ` Kalle Valo
2014-11-26 6:26 ` Kalle Valo
2014-11-26 6:26 ` Kalle Valo
2014-09-23 21:17 ` [PATCH v2 07/10] ath10k: add fw-powerup-fail to ethtool stats greearb
2014-09-23 21:17 ` greearb
2014-09-29 8:24 ` Kalle Valo
2014-09-29 8:24 ` Kalle Valo
2014-09-29 16:05 ` Ben Greear
2014-09-29 16:05 ` Ben Greear
2014-09-30 12:27 ` Michal Kazior
2014-09-30 12:27 ` Michal Kazior
2014-09-30 15:53 ` Ben Greear
2014-09-30 15:53 ` Ben Greear
2014-09-23 21:17 ` [PATCH v2 08/10] ath10k: support CT firmware flag greearb
2014-09-23 21:17 ` greearb
2014-09-23 21:17 ` [PATCH v2 09/10] ath10k: always request htc tx replenishment greearb
2014-09-23 21:17 ` greearb
2014-09-23 21:17 ` [PATCH v2 10/10] ath10k: request firmware flush in ath10k_flush greearb
2014-09-23 21:17 ` greearb
2014-10-01 8:22 ` [PATCH v2 01/10] ath10k: use 64-bit vdev map Kalle Valo
2014-10-01 8:22 ` 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=542983AA.9040200@candelatech.com \
--to=greearb@candelatech.com \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@qca.qualcomm.com \
--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.