linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
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 v2 2/7] ath10k: implement chanctx API
Date: Fri, 30 Jan 2015 15:10:32 +0100	[thread overview]
Message-ID: <1422627032.1919.26.camel@sipsolutions.net> (raw)
In-Reply-To: <CA+BoTQ=pRfxreghBMNoqXfADSLntws_UZqtLHRHbdTrLJvH6bw@mail.gmail.com> (sfid-20150130_150200_280430_F4A5B0DB)

On Fri, 2015-01-30 at 15:01 +0100, Michal Kazior wrote:

> With `width` you'll change `center_freq1` in many cases. Reading a
> pair of old-and-new of each may not necessarily be fatal but may
> introduce subtle bugs that are hard to debug. Even if the current code
> doesn't really use these values out of mac80211 callback context now
> it may become a problem later.

Yes, this is a good point. Like I said (below), we had a similar issue
with the bss_conf, in our case that was two timestamps there that need
to be read together. Right now we're the only ones using those and only
within the context of the callback, so we can just document that they're
only valid together in such a context, but it's a more general issue.

> > We've recently seen a similar issue with vif->bss_conf, and I'm
> > considering making that an RCU-protected pointer rather than the
> > embedded sub-struct, that way mac80211 can replace it atomically when
> > needed. I've yet to see if that's practical though.
> 
> It'd be lovely if I could freely read mac80211 structures from
> whatever context I want without any worries but I think you'd have to
> introduce explicit locking between mac80211 and drivers or go ham with
> RCU :-)

Yeah, locking there would perhaps not be such a bad idea? Either that or
RCU. Though we need RCU already in many contexts (like a tasklet
iterating the list of interfaces) but perhaps configuration accesses
could be contained to mutex-capable contexts? I don't know.

We did have a similar problem between cfg80211 and mac80211 and decided
to move the cfg80211 mutex to the public part so that mac80211 (or other
cfg80211 drivers, of course) could use it - and in fact the cfg80211 API
requires that now in some places - but we haven't really considered this
so much in the context of drivers.

I think this would make a good discussion topic for the wireless
workshop :)

johannes


  reply	other threads:[~2015-01-30 14:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30  8:41 [PATCH 0/7] ath10k: add multi-channel support Michal Kazior
2015-01-30  8:41 ` [PATCH 1/7] ath10k: allow empty ssid vdev config Michal Kazior
2015-01-30  8:41 ` [PATCH 2/7] ath10k: implement chanctx API Michal Kazior
2015-01-30 10:44   ` Michal Kazior
2015-01-30  8:41 ` [PATCH 3/7] ath10k: implement adaptive qcs command Michal Kazior
2015-01-30  8:41 ` [PATCH 4/7] ath10k: protect ar->arvifs linking with data_lock Michal Kazior
2015-01-30  8:41 ` [PATCH 5/7] ath10k: rework tx queue locking Michal Kazior
2015-01-30  8:41 ` [PATCH 6/7] ath10k: implement tx pause wmi event Michal Kazior
2015-01-30  8:41 ` [PATCH 7/7] ath10k: enable multi-channel on supported devices Michal Kazior
2015-01-30 12:31 ` [PATCH v2 0/7] ath10k: add multi-channel support Michal Kazior
2015-01-30 12:31   ` [PATCH v2 1/7] ath10k: allow empty ssid vdev config Michal Kazior
2015-01-30 12:31   ` [PATCH v2 2/7] ath10k: implement chanctx API Michal Kazior
2015-01-30 12:45     ` Johannes Berg
2015-01-30 13:02       ` Michal Kazior
2015-01-30 13:04         ` Johannes Berg
2015-01-30 13:22           ` Michal Kazior
2015-01-30 13:31             ` Johannes Berg
2015-01-30 13:47               ` Michal Kazior
2015-01-30 14:06                 ` Johannes Berg
2015-01-30 12:58     ` Johannes Berg
2015-01-30 13:06       ` Michal Kazior
2015-01-30 13:10         ` Johannes Berg
2015-01-30 14:01           ` Michal Kazior
2015-01-30 14:10             ` Johannes Berg [this message]
2015-01-30 12:31   ` [PATCH v2 3/7] ath10k: implement adaptive qcs command Michal Kazior
2015-01-30 12:31   ` [PATCH v2 4/7] ath10k: protect ar->arvifs linking with data_lock Michal Kazior
2015-01-30 12:31   ` [PATCH v2 5/7] ath10k: rework tx queue locking Michal Kazior
2015-01-30 12:31   ` [PATCH v2 6/7] ath10k: implement tx pause wmi event Michal Kazior
2015-01-30 12:31   ` [PATCH v2 7/7] ath10k: enable multi-channel on supported devices 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=1422627032.1919.26.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --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).