From: Kalle Valo <kvalo@codeaurora.org>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: linux-kernel@vger.kernel.org,
Arend van Spriel <arend.vanspriel@broadcom.com>,
Franky Lin <franky.lin@broadcom.com>,
Hante Meuleman <hante.meuleman@broadcom.com>,
Chi-Hsien Lin <chi-hsien.lin@cypress.com>,
Wright Feng <wright.feng@cypress.com>,
Kalle Valo <kvalo@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-wireless@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com,
brcm80211-dev-list@cypress.com, netdev@vger.kernel.org
Subject: Re: [PATCH] brcmfmac: set timeout value when configuring power save
Date: Tue, 14 Jul 2020 12:41:52 +0300 [thread overview]
Message-ID: <87blkicu1r.fsf@tynnyri.adurom.net> (raw)
In-Reply-To: <20200707155410.12123-1-nsaenzjulienne@suse.de> (Nicolas Saenz Julienne's message of "Tue, 7 Jul 2020 17:54:10 +0200")
Nicolas Saenz Julienne <nsaenzjulienne@suse.de> writes:
> Set the timeout value as per cfg80211's set_power_mgmt() request. If the
> requested value value is left undefined we set it to 2 seconds, the
> maximum supported value.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>
> Note: I got the 2 seconds value from the Raspberry Pi downstream kernel.
>
> .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index a757abd7a599..15578c6e87cd 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -84,6 +84,8 @@
>
> #define BRCMF_ND_INFO_TIMEOUT msecs_to_jiffies(2000)
>
> +#define BRCMF_PS_MAX_TIMEOUT_MS 2000
> +
> #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
> (sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
>
> @@ -2941,6 +2943,14 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev,
> else
> bphy_err(drvr, "error (%d)\n", err);
> }
> +
> + if ((u32)timeout > BRCMF_PS_MAX_TIMEOUT_MS)
> + timeout = BRCMF_PS_MAX_TIMEOUT_MS;
Wouldn't min_t() be better? Then you won't need the ugly cast either.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2020-07-14 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 15:54 [PATCH] brcmfmac: set timeout value when configuring power save Nicolas Saenz Julienne
2020-07-14 9:41 ` Kalle Valo [this message]
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=87blkicu1r.fsf@tynnyri.adurom.net \
--to=kvalo@codeaurora.org \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211-dev-list@cypress.com \
--cc=chi-hsien.lin@cypress.com \
--cc=davem@davemloft.net \
--cc=franky.lin@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nsaenzjulienne@suse.de \
--cc=wright.feng@cypress.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).