diff mbox series

[V2,6/6] brcmfmac: initialize the requested dwell time

Message ID 20200610152106.175257-7-chi-hsien.lin@cypress.com (mailing list archive)
State Accepted
Commit ad96bc27032c27cf3d77b26fa71f317c67b7f940
Delegated to: Kalle Valo
Headers show
Series brcmfmac: flow control and p2p fix series | expand

Commit Message

Chi-Hsien Lin June 10, 2020, 3:21 p.m. UTC
From: Joseph Chuang <joseph.chuang@cypress.com>

Commit 9c29da3f4e7e
("brcmfmac: Fix P2P Group Formation failure via Go-neg method") did not
initialize requested_dwell properly, resulting in an always-false dwell
time overflow check. Fix it by setting the correct requested_dwell
value.

Fixes: 4905432b28b7 ("brcmfmac: Fix P2P Group Formation failure via Go-neg method")
Signed-off-by: Joseph Chuang <joseph.chuang@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c      | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

Comments

Chi-Hsien Lin June 22, 2020, 3:04 p.m. UTC | #1
On 06/10/2020 11:21, Chi-Hsien Lin wrote:
> From: Joseph Chuang <joseph.chuang@cypress.com>
> 
> Commit 9c29da3f4e7e
> ("brcmfmac: Fix P2P Group Formation failure via Go-neg method") did not
> initialize requested_dwell properly, resulting in an always-false dwell
> time overflow check. Fix it by setting the correct requested_dwell
> value.
> 
> Fixes: 4905432b28b7 ("brcmfmac: Fix P2P Group Formation failure via Go-neg method")
> Signed-off-by: Joseph Chuang <joseph.chuang@cypress.com>
> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>

Kalle,

This issue is reported by kernel test robot. Please kindly add below tag 
during commit.

Reported-by: kernel test robot <lkp@intel.com>



> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c      | 5 ++---
>   2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index a757abd7a599..bddd23240609 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -5129,7 +5129,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>   					      &freq);
>   		chan_nr = ieee80211_frequency_to_channel(freq);
>   		af_params->channel = cpu_to_le32(chan_nr);
> -
> +		af_params->dwell_time = cpu_to_le32(params->wait);
>   		memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN],
>   		       le16_to_cpu(action_frame->len));
>   
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> index d2795dc17c46..debd887e159e 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> @@ -1700,7 +1700,7 @@ static s32 brcmf_p2p_pub_af_tx(struct brcmf_cfg80211_info *cfg,
>   	return err;
>   }
>   
> -static bool brcmf_p2p_check_dwell_overflow(s32 requested_dwell,
> +static bool brcmf_p2p_check_dwell_overflow(u32 requested_dwell,
>   					   unsigned long dwell_jiffies)
>   {
>   	if ((requested_dwell & CUSTOM_RETRY_MASK) &&
> @@ -1738,8 +1738,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
>   	unsigned long dwell_jiffies = 0;
>   	bool dwell_overflow = false;
>   
> -	s32 requested_dwell = af_params->dwell_time;
> -
> +	u32 requested_dwell = le32_to_cpu(af_params->dwell_time);
>   	action_frame = &af_params->action_frame;
>   	action_frame_len = le16_to_cpu(action_frame->len);
>   
>
Kalle Valo July 14, 2020, 9:30 a.m. UTC | #2
Chi-Hsien Lin <chi-hsien.lin@cypress.com> wrote:

> From: Joseph Chuang <joseph.chuang@cypress.com>
> 
> Commit 9c29da3f4e7e
> ("brcmfmac: Fix P2P Group Formation failure via Go-neg method") did not
> initialize requested_dwell properly, resulting in an always-false dwell
> time overflow check. Fix it by setting the correct requested_dwell
> value.
> 
> Fixes: 4905432b28b7 ("brcmfmac: Fix P2P Group Formation failure via Go-neg method")

The commit id is wrong, this should be:

Fixes: 9c29da3f4e7e ("brcmfmac: Fix P2P Group Formation failure via Go-neg method")
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index a757abd7a599..bddd23240609 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -5129,7 +5129,7 @@  brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 					      &freq);
 		chan_nr = ieee80211_frequency_to_channel(freq);
 		af_params->channel = cpu_to_le32(chan_nr);
-
+		af_params->dwell_time = cpu_to_le32(params->wait);
 		memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN],
 		       le16_to_cpu(action_frame->len));
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index d2795dc17c46..debd887e159e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -1700,7 +1700,7 @@  static s32 brcmf_p2p_pub_af_tx(struct brcmf_cfg80211_info *cfg,
 	return err;
 }
 
-static bool brcmf_p2p_check_dwell_overflow(s32 requested_dwell,
+static bool brcmf_p2p_check_dwell_overflow(u32 requested_dwell,
 					   unsigned long dwell_jiffies)
 {
 	if ((requested_dwell & CUSTOM_RETRY_MASK) &&
@@ -1738,8 +1738,7 @@  bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
 	unsigned long dwell_jiffies = 0;
 	bool dwell_overflow = false;
 
-	s32 requested_dwell = af_params->dwell_time;
-
+	u32 requested_dwell = le32_to_cpu(af_params->dwell_time);
 	action_frame = &af_params->action_frame;
 	action_frame_len = le16_to_cpu(action_frame->len);