Skip to contentSkip to conversation

staging: rtl8192e: Remove create_workqueue()

PATCH In review Amitoj Kaur Chawla 2 participants 2 messages Feb 20, 2016 – Feb 25, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192e: Remove create_workqueue()

With conccurency managed workqueues, use of dedicated workqueues can be replaced by system_wq. Drop wq by using system_wq.

Since there are multiple work items per rtllib but they do not need to be ordered, increase of concurrency by switching to system_wq should not break anything.

All work items are sync canceled on rtllib_stop_protocol() so it is guaranteed that no work is running when rtl92e_disable/reset/restart functions are called.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  6 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c   | 14 +++------
 drivers/staging/rtl8192e/rtllib.h            |  1 -
 drivers/staging/rtl8192e/rtllib_softmac.c    | 47 +++++++++++++++-------------
 drivers/staging/rtl8192e/rtllib_softmac_wx.c |  2 +-
 5 files changed, 34 insertions(+), 36 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
index 8f989a9..b9afb9a 100644
@@ -249,7 +249,7 @@ bool rtl92e_set_rf_state(struct net_device *dev,
 		if (StateToSet == eRfOn) {
 
 			if (bConnectBySSID && priv->blinked_ingpio) {
-				queue_delayed_work_rsl(ieee->wq,
+				schedule_delayed_work(
 					 &ieee->associate_procedure_wq, 0);
 				priv->blinked_ingpio = false;
 			}
@@ -1327,7 +1327,7 @@ RESET_START:
 			ieee->set_chan(ieee->dev,
 				       ieee->current_network.channel);
 
-			queue_work_rsl(ieee->wq, &ieee->associate_complete_wq);
+			schedule_work(&ieee->associate_complete_wq);
 
 		} else if (ieee->state == RTLLIB_LINKED && ieee->iw_mode ==
 			   IW_MODE_ADHOC) {
@@ -1499,7 +1499,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
 
 			if (!(ieee->rtllib_ap_sec_type(ieee) &
 			     (SEC_ALG_CCMP|SEC_ALG_TKIP)))
-				queue_delayed_work_rsl(ieee->wq,
+				schedule_delayed_work(
 					&ieee->associate_procedure_wq, 0);
 
 			priv->check_roaming_cnt = 0;
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +5 -9
index 9a4d1bc..98e4d88 100644
@@ -63,9 +63,8 @@ void rtl92e_hw_wakeup(struct net_device *dev)
 		spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
 		RT_TRACE(COMP_DBG,
 			 "rtl92e_hw_wakeup(): RF Change in progress!\n");
-		queue_delayed_work_rsl(priv->rtllib->wq,
-				       &priv->rtllib->hw_wakeup_wq,
-				       msecs_to_jiffies(10));
+		schedule_delayed_work(&priv->rtllib->hw_wakeup_wq,
+				      msecs_to_jiffies(10));
 		return;
 	}
 	spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
@@ -111,10 +110,8 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time)
 		return;
 	}
 	tmp = time - jiffies;
-	queue_delayed_work_rsl(priv->rtllib->wq,
-			&priv->rtllib->hw_wakeup_wq, tmp);
-	queue_delayed_work_rsl(priv->rtllib->wq,
-			(void *)&priv->rtllib->hw_sleep_wq, 0);
+	schedule_delayed_work(&priv->rtllib->hw_wakeup_wq, tmp);
+	schedule_delayed_work(&priv->rtllib->hw_sleep_wq, 0);
 	spin_unlock_irqrestore(&priv->ps_lock, flags);
 }
 
@@ -203,8 +200,7 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
 			}
 			netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
 				    __func__);
-			queue_work_rsl(priv->rtllib->wq,
-				       &priv->rtllib->ips_leave_wq);
+			schedule_work(&priv->rtllib->ips_leave_wq);
 		}
 	}
 }
drivers/staging/rtl8192e/rtllib.h +0 -1
index d99240e..776e179 100644
@@ -1728,7 +1728,6 @@ struct rtllib_device {
 	struct delayed_work link_change_wq;
 	struct work_struct wx_sync_scan_wq;
 
-	struct workqueue_struct *wq;
 	union {
 		struct rtllib_rxb *RfdArray[REORDER_WIN_SIZE];
 		struct rtllib_rxb *stats_IndicateArray[REORDER_WIN_SIZE];
drivers/staging/rtl8192e/rtllib_softmac.c +25 -22

125 lines not on this page · raw message

drivers/staging/rtl8192e/rtllib_softmac_wx.c +1 -1
index 86f52ac..6d78960 100644
@@ -429,7 +429,7 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
 	}
 
 	if (ieee->state == RTLLIB_LINKED) {
-		queue_work_rsl(ieee->wq, &ieee->wx_sync_scan_wq);
+		schedule_work(&ieee->wx_sync_scan_wq);
 		/* intentionally forget to up sem */
 		return 0;
 	}
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw

Hello, Amitoj.

Quoted 7 lines · Amitoj Kaur Chawla

With conccurency managed workqueues, use of dedicated workqueues can be replaced by system_wq. Drop wq by using system_wq.

Since there are multiple work items per rtllib but they do not need to be ordered, increase of concurrency by switching to system_wq should not break anything.

Quoted 5 lines

All work items are sync canceled on rtllib_stop_protocol() so it is guaranteed that no work is running when rtl92e_disable/reset/restart functions are called.

For workqueue part,

The same thing with the other patch. Let's get it tested.

Thanks.

Signature · 1 line
tejun