staging: rtl8192u: Use system_wq
PATCH 1/2 staging: rtl8192u: Use system_wq
With conccurency managed workqueues, use of dedicated workqueues can be replaced by system_wq. Drop wq by using system_wq.
There are multiple work items per priv_wq (viz. reset_wq, watch_dog, update_beacon_wq,initialgain_operate_wq,txpower_tracking_wq and qos_activate) and different priv_wqs need not be be ordered. Hence, concurrency can be increased by switching to system_wq.
All work items are sync canceled in rtl8192_cancel_deferred_work so it is guaranteed that no work is in flight by the time exit path runs.
Signed-off-by Bhaktipriya Shridhar <[email protected]>
--- drivers/staging/rtl8192u/r8192U.h | 1 - drivers/staging/rtl8192u/r8192U_core.c | 15 +++++++-------- drivers/staging/rtl8192u/r8192U_dm.c | 6 +++--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -1
@@ -1090,7 +1090,6 @@ typedef struct r8192_priv {struct delayed_work rfpath_check_wq;struct delayed_work gpio_change_rf_wq;struct delayed_work initialgain_operate_wq; -struct workqueue_struct *priv_wq; } r8192_priv;/* For rtl8187B */
drivers/staging/rtl8192u/r8192U_core.c +7 -8
@@ -1962,7 +1962,7 @@ static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv, network->qos_data.param_count)) { network->qos_data.old_param_count = network->qos_data.param_count; -queue_work (priv->priv_wq, &priv->qos_activate); +schedule_work (&priv->qos_activate);RT_TRACE (COMP_QOS ,"QoS parameters change call qos_activate\n" ); }
@@ -1971,7 +1971,7 @@ static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv, &def_qos_parameters, size);if ((network->qos_data.active ==1 ) && (active_network ==1 )) { -queue_work (priv->priv_wq, &priv->qos_activate); +schedule_work (&priv->qos_activate);RT_TRACE (COMP_QOS ,"QoS was disabled call qos_activate\n" ); }
@@ -1990,7 +1990,7 @@ static int rtl8192_handle_beacon(struct net_device *dev,struct r8192_priv *priv =ieee80211_priv (dev);rtl8192_qos_handle_probe_response (priv,1 , network); -queue_delayed_work (priv->priv_wq, &priv->update_beacon_wq,0 ); +schedule_delayed_work (&priv->update_beacon_wq,0 );return 0 ; }
@@ -2042,7 +2042,7 @@ static int rtl8192_qos_association_resp(struct r8192_priv *priv, network->flags, priv->ieee80211->current_network.qos_data.active);if (set_qos_param ==1 ) -queue_work (priv->priv_wq, &priv->qos_activate); +schedule_work (&priv->qos_activate);return 0 ;
@@ -2387,7 +2387,6 @@ static void rtl8192_init_priv_task(struct net_device *dev) {struct r8192_priv *priv =ieee80211_priv (dev); - priv->priv_wq =create_workqueue (DRV_NAME );INIT_WORK (&priv->reset_wq, rtl8192_restart);
@@ -3518,7 +3517,7 @@ static void watch_dog_timer_callback(unsigned long data) {struct r8192_priv *priv =ieee80211_priv ((struct net_device *)data); -queue_delayed_work (priv->priv_wq, &priv->watch_dog_wq,0 ); +schedule_delayed_work (&priv->watch_dog_wq,0 );mod_timer (&priv->watch_dog_timer, jiffies +msecs_to_jiffies (IEEE80211_WATCH_DOG_TIME )); }
@@ -5022,7 +5021,6 @@ fail2:kfree (priv->pFirmware); priv->pFirmware =NULL ;rtl8192_usb_deleteendpoints (dev); -destroy_workqueue (priv->priv_wq);mdelay (10 ); fail:free_ieee80211 (dev);
@@ -5040,6 +5038,8 @@ static void rtl8192_cancel_deferred_work(struct r8192_priv *priv)cancel_work_sync (&priv->reset_wq);cancel_delayed_work (&priv->watch_dog_wq);cancel_delayed_work (&priv->update_beacon_wq); +cancel_delayed_work (&priv->txpower_tracking_wq); +cancel_delayed_work (&priv->initialgain_operate_wq);cancel_work_sync (&priv->qos_activate); }
@@ -5060,7 +5060,6 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)kfree (priv->pFirmware); priv->pFirmware =NULL ;rtl8192_usb_deleteendpoints (dev); -destroy_workqueue (priv->priv_wq);mdelay (10 ); }free_ieee80211 (dev);
drivers/staging/rtl8192u/r8192U_dm.c +3 -3
@@ -1320,7 +1320,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)if (!priv->btxpower_tracking)return ;if ((tx_power_track_counter %30 ==0 ) && (tx_power_track_counter !=0 )) -queue_delayed_work (priv->priv_wq, &priv->txpower_tracking_wq,0 ); +schedule_delayed_work (&priv->txpower_tracking_wq,0 ); tx_power_track_counter++; }
@@ -1350,7 +1350,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)return ; }/*DbgPrint("Schedule TxPowerTrackingWorkItem\n");*/ -queue_delayed_work (priv->priv_wq, &priv->txpower_tracking_wq,0 ); +schedule_delayed_work (&priv->txpower_tracking_wq,0 ); TM_Trigger =0 ; }
@@ -2671,7 +2671,7 @@ static void dm_check_rx_path_selection(struct net_device *dev) {struct r8192_priv *priv =ieee80211_priv (dev); -queue_delayed_work (priv->priv_wq, &priv->rfpath_check_wq,0 ); +schedule_delayed_work (&priv->rfpath_check_wq,0 ); }/* dm_CheckRxRFPath */ static void dm_init_fsync (struct net_device *dev)
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1678,7 +1678,7 @@ void InitialGain819xUsb(struct net_device *dev, u8 Operation) priv->InitialGainOperateType = Operation;if (priv->up) -queue_delayed_work (priv->priv_wq, &priv->initialgain_operate_wq,0 ); +schedule_delayed_work (&priv->initialgain_operate_wq,0 ); }void InitialGainOperateWorkItemCallBack (struct work_struct *work)
--
2.1.4