[Xenial SRU][PATCH] UBUNTU: SAUCE: Redpine: resolve wifi scan stop issue in stress tests

Amitkumar Karwar amitkarwar at gmail.com
Wed Mar 21 14:32:39 UTC 2018


From: Sanjay Kumar Konduri <sanjay.konduri at redpinesignals.com>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1757435

We are disabling deep sleep before performing scan. In corner case,
it's observed that probe request is downloaded to firmware before
receiving deep sleep confirmation which leads to a scan stop issue

Race is resolved in this patch by waiting for the confirmation from
firmware

Signed-off-by: Sanjay Kumar Konduri <sanjay.konduri at redpinesignals.com>
Signed-off-by: Amitkumar Karwar <amit.karwar at redpinesignals.com>
---
 ubuntu/rsi/rsi_91x_main.c | 1 +
 ubuntu/rsi/rsi_91x_mgmt.c | 5 +++++
 ubuntu/rsi/rsi_main.h     | 1 +
 3 files changed, 7 insertions(+)

diff --git a/ubuntu/rsi/rsi_91x_main.c b/ubuntu/rsi/rsi_91x_main.c
index 2350dbb61..49b98cd 100644
--- a/ubuntu/rsi/rsi_91x_main.c
+++ b/ubuntu/rsi/rsi_91x_main.c
@@ -382,6 +382,7 @@ struct rsi_hw *ven_rsi_91x_init(void)
 #ifdef CONFIG_HW_SCAN_OFFLOAD
 	rsi_init_event(&common->chan_set_event);
 	rsi_init_event(&common->probe_cfm_event);
+	rsi_init_event(&common->mgmt_cfm_event);
 	rsi_init_event(&common->chan_change_event);
 	rsi_init_event(&common->cancel_hw_scan_event);
 	common->scan_workqueue = 
diff --git a/ubuntu/rsi/rsi_91x_mgmt.c b/ubuntu/rsi/rsi_91x_mgmt.c
index 11b2046..58a9b69 100644
--- a/ubuntu/rsi/rsi_91x_mgmt.c
+++ b/ubuntu/rsi/rsi_91x_mgmt.c
@@ -2407,6 +2407,8 @@ void rsi_scan_start(struct work_struct *work)
 
 	common->scan_in_prog = true;
 	rsi_disable_ps(common->priv);
+	rsi_reset_event(&common->mgmt_cfm_event);
+	rsi_wait_event(&common->mgmt_cfm_event, msecs_to_jiffies(2000));
 	
 	for (ii =0; ii < scan_req->n_channels ; ii++) {
 		if (common->iface_down)
@@ -2470,6 +2472,8 @@ void rsi_scan_start(struct work_struct *work)
 	del_timer(&common->scan_timer);
 	common->scan_in_prog = false;
 	rsi_enable_ps(common->priv);
+	rsi_reset_event(&common->mgmt_cfm_event);
+	rsi_wait_event(&common->mgmt_cfm_event, msecs_to_jiffies(2000));
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
 	info.aborted = false;
 	ieee80211_scan_completed(common->priv->hw, &info);
@@ -2693,6 +2697,7 @@ static int rsi_handle_ta_confirm(struct rsi_common *common, u8 *msg)
 
 	case WAKEUP_SLEEP_REQUEST:
 		ven_rsi_dbg(INFO_ZONE, "Wakeup/Sleep confirmation.\n");
+		rsi_set_event(&common->mgmt_cfm_event);
 		return rsi_handle_ps_confirm(adapter, msg);
 
 	case BG_SCAN_PROBE_REQ:
diff --git a/ubuntu/rsi/rsi_main.h b/ubuntu/rsi/rsi_main.h
index 2aad124..027e9d9 100644
--- a/ubuntu/rsi/rsi_main.h
+++ b/ubuntu/rsi/rsi_main.h
@@ -376,6 +376,7 @@ struct rsi_common {
 	struct work_struct scan_work;
 	struct rsi_event chan_set_event;
 	struct rsi_event probe_cfm_event;
+	struct rsi_event mgmt_cfm_event;
 	struct rsi_event chan_change_event;
 	struct rsi_event cancel_hw_scan_event;
 	struct timer_list scan_timer;
-- 
2.7.4





More information about the kernel-team mailing list