From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"David S . Miller" <davem@davemloft.net>,
Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [PATCH v2 03/33] staging: wfx: ignore PS when STA/AP share same channel
Date: Mon, 13 Sep 2021 12:36:25 +0200 [thread overview]
Message-ID: <2757254.9bAbmTgjDO@pc-42> (raw)
In-Reply-To: <20210913093328.GG7203@kadam>
On Monday 13 September 2021 11:33:28 CEST Dan Carpenter wrote:
> On Mon, Sep 13, 2021 at 10:30:15AM +0200, Jerome Pouiller wrote:
> > diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
> > index 5de9ccf02285..aff0559653bf 100644
> > --- a/drivers/staging/wfx/sta.c
> > +++ b/drivers/staging/wfx/sta.c
> > @@ -154,18 +154,26 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
> > chan0 = wdev_to_wvif(wvif->wdev, 0)->vif->bss_conf.chandef.chan;
> > if (wdev_to_wvif(wvif->wdev, 1))
> > chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan;
> > - if (chan0 && chan1 && chan0->hw_value != chan1->hw_value &&
> > - wvif->vif->type != NL80211_IFTYPE_AP) {
> > - // It is necessary to enable powersave if channels
> > - // are different.
> > - if (enable_ps)
> > - *enable_ps = true;
> > - if (wvif->wdev->force_ps_timeout > -1)
> > - return wvif->wdev->force_ps_timeout;
> > - else if (wfx_api_older_than(wvif->wdev, 3, 2))
> > - return 0;
> > - else
> > - return 30;
> > + if (chan0 && chan1 && wvif->vif->type != NL80211_IFTYPE_AP) {
> > + if (chan0->hw_value == chan1->hw_value) {
> > + // It is useless to enable PS if channels are the same.
> > + if (enable_ps)
> > + *enable_ps = false;
> > + if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps)
> > + dev_info(wvif->wdev->dev, "ignoring requested PS mode");
> > + return -1;
>
> I can't be happy about this -1 return or how it's handled in the caller.
> There is already a -1 return so it's not really a new bug, though...
I see what you mean. However, I remember it is easy to break things
here and I don't want to change that in a rush. So, I would prefer to
solve that in a further PR.
--
Jérôme Pouiller
next prev parent reply other threads:[~2021-09-13 10:36 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 8:30 [PATCH v2 00/33] staging/wfx: usual maintenance Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 01/33] staging: wfx: use abbreviated message for "incorrect sequence" Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 02/33] staging: wfx: do not send CAB while scanning Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 03/33] staging: wfx: ignore PS when STA/AP share same channel Jerome Pouiller
2021-09-13 9:33 ` Dan Carpenter
2021-09-13 10:36 ` Jérôme Pouiller [this message]
2021-09-13 10:42 ` Dan Carpenter
2021-09-13 8:30 ` [PATCH v2 04/33] staging: wfx: wait for SCAN_CMPL after a SCAN_STOP Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 05/33] staging: wfx: avoid possible lock-up during scan Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 06/33] staging: wfx: drop unused argument from hif_scan() Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 07/33] staging: wfx: fix atomic accesses in wfx_tx_queue_empty() Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 08/33] staging: wfx: take advantage of wfx_tx_queue_empty() Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 09/33] staging: wfx: declare support for TDLS Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 10/33] staging: wfx: fix support for CSA Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 11/33] staging: wfx: relax the PDS existence constraint Jerome Pouiller
2021-09-13 9:58 ` Dan Carpenter
2021-09-13 8:30 ` [PATCH v2 12/33] staging: wfx: simplify API coherency check Jerome Pouiller
2021-09-13 10:02 ` Dan Carpenter
2021-09-13 8:30 ` [PATCH v2 13/33] staging: wfx: update with the firmware API 3.8 Jerome Pouiller
2021-09-13 10:06 ` Dan Carpenter
2021-09-13 8:30 ` [PATCH v2 14/33] staging: wfx: uniformize counter names Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 15/33] staging: wfx: fix misleading 'rate_id' usage Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 16/33] staging: wfx: declare variables at beginning of functions Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 17/33] staging: wfx: simplify hif_join() Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 18/33] staging: wfx: reorder function for slightly better eye candy Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 19/33] staging: wfx: fix error names Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 20/33] staging: wfx: apply naming rules in hif_tx_mib.c Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 21/33] staging: wfx: remove unused definition Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 22/33] staging: wfx: remove useless debug statement Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 23/33] staging: wfx: fix space after cast operator Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 24/33] staging: wfx: remove references to WFxxx in comments Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 25/33] staging: wfx: update files descriptions Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 26/33] staging: wfx: reformat comment Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 27/33] staging: wfx: avoid c99 comments Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 28/33] staging: wfx: fix comments styles Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 29/33] staging: wfx: remove useless comments after #endif Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 30/33] staging: wfx: explain the purpose of wfx_send_pds() Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 31/33] staging: wfx: indent functions arguments Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 32/33] staging: wfx: ensure IRQ is ready before enabling it Jerome Pouiller
2021-09-13 8:30 ` [PATCH v2 33/33] staging: wfx: early exit of PDS is not correct Jerome Pouiller
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=2757254.9bAbmTgjDO@pc-42 \
--to=jerome.pouiller@silabs.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).