staging: rtl8192e: rtl8192e: Remove create_workqueue()
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Thu, 25 Feb 2016 03:53:31 +0000 (09:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
With conccurency managed workqueues, use of dedicated workqueues can
be replaced by system_wq. Drop priv_wq by using system_wq.

Since there are multiple work items per priv 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 so it is guaranteed that
no work is running when rtl92e_suspend function is called.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
drivers/staging/rtl8192e/rtl8192e/rtl_pm.c

index 18d0fe3802a92ecb7321199d0f347058d1f20780..bb6b62f1a260702280144da751d0ccd9d18ffefb 100644 (file)
@@ -437,7 +437,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv,
                        network->qos_data.old_param_count =
                                network->qos_data.param_count;
        priv->rtllib->wmm_acm = network->qos_data.wmm_acm;
-                       queue_work_rsl(priv->priv_wq, &priv->qos_activate);
+                       schedule_work(&priv->qos_activate);
                        RT_TRACE(COMP_QOS,
                                 "QoS parameters change call qos_activate\n");
                }
@@ -446,7 +446,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv,
                       &def_qos_parameters, size);
 
                if ((network->qos_data.active == 1) && (active_network == 1)) {
-                       queue_work_rsl(priv->priv_wq, &priv->qos_activate);
+                       schedule_work(&priv->qos_activate);
                        RT_TRACE(COMP_QOS,
                                 "QoS was disabled call qos_activate\n");
                }
@@ -465,7 +465,7 @@ static int _rtl92e_handle_beacon(struct net_device *dev,
 
        _rtl92e_qos_handle_probe_response(priv, 1, network);
 
-       queue_delayed_work_rsl(priv->priv_wq, &priv->update_beacon_wq, 0);
+       schedule_delayed_work(&priv->update_beacon_wq, 0);
        return 0;
 
 }
@@ -512,7 +512,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
                 network->flags, priv->rtllib->current_network.qos_data.active);
        if (set_qos_param == 1) {
                rtl92e_dm_init_edca_turbo(priv->rtllib->dev);
-               queue_work_rsl(priv->priv_wq, &priv->qos_activate);
+               schedule_work(&priv->qos_activate);
        }
        return 0;
 }
@@ -1002,7 +1002,6 @@ static void _rtl92e_init_priv_task(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
 
-       priv->priv_wq = create_workqueue(DRV_NAME);
        INIT_WORK_RSL(&priv->reset_wq, (void *)_rtl92e_restart, dev);
        INIT_WORK_RSL(&priv->rtllib->ips_leave_wq, (void *)rtl92e_ips_leave_wq,
                      dev);
@@ -1536,7 +1535,7 @@ static void _rtl92e_watchdog_timer_cb(unsigned long data)
 {
        struct r8192_priv *priv = rtllib_priv((struct net_device *)data);
 
-       queue_delayed_work_rsl(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(RTLLIB_WATCH_DOG_TIME));
 }
@@ -2161,8 +2160,8 @@ static void _rtl92e_irq_rx_tasklet(struct r8192_priv *priv)
 *****************************************************************************/
 static void _rtl92e_cancel_deferred_work(struct r8192_priv *priv)
 {
-       cancel_delayed_work(&priv->watch_dog_wq);
-       cancel_delayed_work(&priv->update_beacon_wq);
+       cancel_delayed_work_sync(&priv->watch_dog_wq);
+       cancel_delayed_work_sync(&priv->update_beacon_wq);
        cancel_delayed_work(&priv->rtllib->hw_sleep_wq);
        cancel_work_sync(&priv->reset_wq);
        cancel_work_sync(&priv->qos_activate);
@@ -2693,7 +2692,7 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev)
                priv = rtllib_priv(dev);
 
                del_timer_sync(&priv->gpio_polling_timer);
-               cancel_delayed_work(&priv->gpio_change_rf_wq);
+               cancel_delayed_work_sync(&priv->gpio_change_rf_wq);
                priv->polling_timer_on = 0;
                _rtl92e_down(dev, true);
                rtl92e_dm_deinit(dev);
@@ -2701,7 +2700,6 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev)
                        vfree(priv->pFirmware);
                        priv->pFirmware = NULL;
                }
-               destroy_workqueue(priv->priv_wq);
                _rtl92e_free_rx_ring(dev);
                for (i = 0; i < MAX_TX_QUEUE_COUNT; i++)
                        _rtl92e_free_tx_ring(dev, i);
@@ -2783,7 +2781,7 @@ void rtl92e_check_rfctrl_gpio_timer(unsigned long data)
 
        priv->polling_timer_on = 1;
 
-       queue_delayed_work_rsl(priv->priv_wq, &priv->gpio_change_rf_wq, 0);
+       schedule_delayed_work(&priv->gpio_change_rf_wq, 0);
 
        mod_timer(&priv->gpio_polling_timer, jiffies +
                  msecs_to_jiffies(RTLLIB_WATCH_DOG_TIME));
index a7777a319c024510590b8097fc07b3e2ce251fd9..f627fdc15a58c49e6ed1e28d0f0f70af33b90360 100644 (file)
@@ -338,8 +338,6 @@ struct r8192_priv {
        struct delayed_work             rfpath_check_wq;
        struct delayed_work             gpio_change_rf_wq;
 
-       struct workqueue_struct         *priv_wq;
-
        struct channel_access_setting ChannelAccessSetting;
 
        struct rtl819x_ops                      *ops;
index b6b714d676b525d74b72efded4af9a5d6e8f8d66..9bc284812c30e4e57a398b2d974f6f19e0536d81 100644 (file)
@@ -994,8 +994,7 @@ static void _rtl92e_dm_check_tx_power_tracking_tssi(struct net_device *dev)
 
 
         if (tx_power_track_counter >= 180) {
-               queue_delayed_work_rsl(priv->priv_wq,
-                                      &priv->txpower_tracking_wq, 0);
+               schedule_delayed_work(&priv->txpower_tracking_wq, 0);
                tx_power_track_counter = 0;
        }
 
@@ -1028,7 +1027,7 @@ static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev)
                return;
        }
        netdev_info(dev, "===============>Schedule TxPowerTrackingWorkItem\n");
-       queue_delayed_work_rsl(priv->priv_wq, &priv->txpower_tracking_wq, 0);
+       schedule_delayed_work(&priv->txpower_tracking_wq, 0);
        TM_Trigger = 0;
 
 }
@@ -2121,7 +2120,7 @@ static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
 
-       queue_delayed_work_rsl(priv->priv_wq, &priv->rfpath_check_wq, 0);
+       schedule_delayed_work(&priv->rfpath_check_wq, 0);
 }
 
 
index b2b5ada69e738024c9772f31d621e74d3fb3856f..9e04dc29fbbb00aebd05d440794f29e6a4539fbb 100644 (file)
@@ -27,7 +27,7 @@ int rtl92e_suspend(struct pci_dev *pdev, pm_message_t state)
 
        netdev_info(dev, "============> r8192E suspend call.\n");
        del_timer_sync(&priv->gpio_polling_timer);
-       cancel_delayed_work(&priv->gpio_change_rf_wq);
+       cancel_delayed_work_sync(&priv->gpio_change_rf_wq);
        priv->polling_timer_on = 0;
 
        if (!netif_running(dev)) {
This page took 0.040224 seconds and 5 git commands to generate.