From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "Tomislav Požega" <pozega.tomislav@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/5] rt2x00: set registers based on current band
Date: Wed, 19 Sep 2018 14:47:18 +0200 [thread overview]
Message-ID: <20180919124717.GA26590@redhat.com> (raw)
In-Reply-To: <1537359450-8843-1-git-send-email-pozega.tomislav@gmail.com>
On Wed, Sep 19, 2018 at 02:17:30PM +0200, Tomislav Požega wrote:
> On Wed, 19 Sep 2018 13:05:41 +0200, Stanislaw Gruszka wrote:
>
> >Driver should provide on what channels are supported to mac80211, but
> >user space decide what channel to use and that imply band 2.4GHz or
> >5GHz. ->curr_band is just shortcut for band of current channel. Is set
> >in rt2x00lib_config() after we call rt2x00dev->ops->lib->config()
> >[rt2800_config() for rt2800] . So patch is wrong. Either ->curr_band
> >should be set before ->config call or we need to consistently use
> >rf->channel <= 14 for band check in any rt2800_config() function and
> >all it's subroutines. I prefer the second solution (i.e. rf->channel)
> >and now I can see few places when we use ->curr_band, what is a bug.
>
> Works fine, no any kind of regression, especially not performance ones.
Did you test on dual band devices ?
> So I don't see a reason to claim it is wrong or bug just because you
> prefer current solution.
It's not wrong bacause I prefer current solution. It's because
->curr_band is not updated when you call rt2800_config().
> >It's because ->curr_band initialize to 0 and NL80211_BAND_2GHZ
> >happen to be 0. Also problem will not trigger on single band
> >2.4GHz devices.
>
> Can you show us how will the problem trigger on dual band devices?
When you switch from some 2.4GHz channel to 5GHz channel (or vice versa)
->curr_band will point to old band not the new one. To fix that you
have to move curr_band assignemt before ->config() in
rt2x00lib_config() i.e:
rt2x00dev->curr_band = conf->chandef.chan->band;
rt2x00dev->ops->lib->config(rt2x00dev, &libconf, ieee80211_flags);
However I do not see the point of replacyng rf->channel check
to ->curr_band check. What you can do is oposite thing, replace
wrong usage of ->curr_band in very few places in rt2800_config()
subroutines to rf->channel check.
Also replacing spec->num_channels is wrong because this will
stop reporting device support 5GHz band.
Regards
Stanislaw
next prev parent reply other threads:[~2018-09-19 18:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 16:32 [PATCH 1/5] rt2x00: set registers based on current band Tomislav Požega
2018-09-17 16:32 ` [PATCH 2/5] rt2x00: rework channel config function Tomislav Požega
2018-09-18 12:22 ` Stanislaw Gruszka
2018-10-09 10:57 ` Stanislaw Gruszka
2018-09-17 16:32 ` [PATCH 3/5] rt2x00: remove unneeded check Tomislav Požega
2018-09-17 16:32 ` [PATCH 4/5] rt2x00: remove confusing AGC register Tomislav Požega
2018-09-17 16:32 ` [PATCH 5/5] rt2x00: update TX_SW_CFG2 value Tomislav Požega
2018-09-18 12:20 ` [PATCH 1/5] rt2x00: set registers based on current band Stanislaw Gruszka
2018-09-18 14:14 ` Tomislav Požega
2018-09-19 11:05 ` Stanislaw Gruszka
2018-09-19 12:17 ` Tomislav Požega
2018-09-19 12:47 ` Stanislaw Gruszka [this message]
2018-09-19 13:04 ` Stanislaw Gruszka
2018-09-29 9:26 ` Tom Psyborg
2018-10-09 11:00 ` Stanislaw Gruszka
2018-10-09 22:14 ` Tom Psyborg
2018-10-10 8:49 ` Stanislaw Gruszka
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=20180919124717.GA26590@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pozega.tomislav@gmail.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).