linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: don't warn about CW params when not using them
@ 2019-07-18  1:57 Brian Norris
  2019-07-18  7:45 ` Stanislaw Gruszka
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2019-07-18  1:57 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-kernel, linux-wireless, Stanislaw Gruszka,
	Yan-Hsuan Chuang, Brian Norris

ieee80211_set_wmm_default() normally sets up the initial CW min/max for
each queue, except that it skips doing this if the driver doesn't
support ->conf_tx. We still end up calling drv_conf_tx() in some cases
(e.g., ieee80211_reconfig()), which also still won't do anything
useful...except it complains here about the invalid CW parameters.

Let's just skip the WARN if we weren't going to do anything useful with
the parameters.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
Noticed because rtw88 does not currently implement .conf_tx()

I think there are several ways to slice this one. I picked one fix,
which may not be the best one.

 net/mac80211/driver-ops.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
index acd4afb4944b..c9a8a2433e8a 100644
--- a/net/mac80211/driver-ops.c
+++ b/net/mac80211/driver-ops.c
@@ -187,11 +187,16 @@ int drv_conf_tx(struct ieee80211_local *local,
 	if (!check_sdata_in_driver(sdata))
 		return -EIO;
 
-	if (WARN_ONCE(params->cw_min == 0 ||
-		      params->cw_min > params->cw_max,
-		      "%s: invalid CW_min/CW_max: %d/%d\n",
-		      sdata->name, params->cw_min, params->cw_max))
+	if (params->cw_min == 0 || params->cw_min > params->cw_max) {
+		/*
+		 * If we can't configure hardware anyway, don't warn. We may
+		 * never have initialized the CW parameters.
+		 */
+		WARN_ONCE(local->ops->conf_tx,
+			  "%s: invalid CW_min/CW_max: %d/%d\n",
+			  sdata->name, params->cw_min, params->cw_max);
 		return -EINVAL;
+	}
 
 	trace_drv_conf_tx(local, sdata, ac, params);
 	if (local->ops->conf_tx)
-- 
2.22.0.510.g264f2c817a-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: don't warn about CW params when not using them
  2019-07-18  1:57 [PATCH] mac80211: don't warn about CW params when not using them Brian Norris
@ 2019-07-18  7:45 ` Stanislaw Gruszka
  2019-07-18 15:48   ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2019-07-18  7:45 UTC (permalink / raw)
  To: Brian Norris
  Cc: Johannes Berg, linux-kernel, linux-wireless, Yan-Hsuan Chuang

On Wed, Jul 17, 2019 at 06:57:12PM -0700, Brian Norris wrote:
> ieee80211_set_wmm_default() normally sets up the initial CW min/max for
> each queue, except that it skips doing this if the driver doesn't
> support ->conf_tx. We still end up calling drv_conf_tx() in some cases
> (e.g., ieee80211_reconfig()), which also still won't do anything
> useful...except it complains here about the invalid CW parameters.
> 
> Let's just skip the WARN if we weren't going to do anything useful with
> the parameters.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> Noticed because rtw88 does not currently implement .conf_tx()
> 
> I think there are several ways to slice this one. I picked one fix,
> which may not be the best one.

Fix looks fine for me. However I think rtw88 should implement
drv_conf_tx() because parameters can be different on different
network setups and maybe more important WMM/AC parameters become
quite recently part of ETSI regulatory.

Stanislaw 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: don't warn about CW params when not using them
  2019-07-18  7:45 ` Stanislaw Gruszka
@ 2019-07-18 15:48   ` Brian Norris
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2019-07-18 15:48 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Johannes Berg, Linux Kernel, linux-wireless, Yan-Hsuan Chuang

On Thu, Jul 18, 2019 at 12:45 AM Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> Fix looks fine for me. However I think rtw88 should implement
> drv_conf_tx() because parameters can be different on different
> network setups and maybe more important WMM/AC parameters become
> quite recently part of ETSI regulatory.

Ack. I just figured we should stay consistent with the WARNINGs (and
we both noticed this one on earlier patch reviews). I don't know about
you, but for me, the whole wireless stack is so full of WARNINGs that
my crash reporter system separately classifies net/wireless and
drivers/net/wireless/ from the rest of the kernel when categorizing
automated problem reports. (And...most developers then ignore them.)

But I digress ;)

Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-18 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18  1:57 [PATCH] mac80211: don't warn about CW params when not using them Brian Norris
2019-07-18  7:45 ` Stanislaw Gruszka
2019-07-18 15:48   ` Brian Norris

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).