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.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Amitoj Kaur Chawla 2016-02-20 15:36:26 +05:30 committed by Greg Kroah-Hartman
parent e27604efde
commit 354605f4e6
5 changed files with 34 additions and 36 deletions

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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];

View File

@ -615,8 +615,8 @@ static void rtllib_softmac_scan_wq(void *data)
if (ieee->active_channel_map[ieee->current_network.channel] == 1)
rtllib_send_probe_requests(ieee, 0);
queue_delayed_work_rsl(ieee->wq, &ieee->softmac_scan_wq,
msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME));
schedule_delayed_work(&ieee->softmac_scan_wq,
msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME));
up(&ieee->scan_sem);
return;
@ -689,7 +689,7 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee)
ieee->scanning_continue = 0;
ieee->actscanning = false;
cancel_delayed_work(&ieee->softmac_scan_wq);
cancel_delayed_work_sync(&ieee->softmac_scan_wq);
}
up(&ieee->scan_sem);
@ -745,8 +745,7 @@ static void rtllib_start_scan(struct rtllib_device *ieee)
if (ieee->scanning_continue == 0) {
ieee->actscanning = true;
ieee->scanning_continue = 1;
queue_delayed_work_rsl(ieee->wq,
&ieee->softmac_scan_wq, 0);
schedule_delayed_work(&ieee->softmac_scan_wq, 0);
}
} else {
if (ieee->rtllib_start_hw_scan)
@ -1428,8 +1427,8 @@ static void rtllib_associate_abort(struct rtllib_device *ieee)
ieee->state = RTLLIB_ASSOCIATING_RETRY;
queue_delayed_work_rsl(ieee->wq, &ieee->associate_retry_wq,
RTLLIB_SOFTMAC_ASSOC_RETRY_TIME);
schedule_delayed_work(&ieee->associate_retry_wq,
RTLLIB_SOFTMAC_ASSOC_RETRY_TIME);
spin_unlock_irqrestore(&ieee->lock, flags);
}
@ -1580,7 +1579,7 @@ static void rtllib_associate_complete(struct rtllib_device *ieee)
ieee->state = RTLLIB_LINKED;
rtllib_sta_send_associnfo(ieee);
queue_work_rsl(ieee->wq, &ieee->associate_complete_wq);
schedule_work(&ieee->associate_complete_wq);
}
static void rtllib_associate_procedure_wq(void *data)
@ -1729,7 +1728,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
if (ieee->LedControlHandler != NULL)
ieee->LedControlHandler(ieee->dev,
LED_CTL_START_TO_LINK);
queue_delayed_work_rsl(ieee->wq,
schedule_delayed_work(
&ieee->associate_procedure_wq, 0);
} else {
if (rtllib_is_54g(&ieee->current_network) &&
@ -2283,7 +2282,7 @@ inline int rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb,
"Association response status code 0x%x\n",
errcode);
if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT)
queue_delayed_work_rsl(ieee->wq,
schedule_delayed_work(
&ieee->associate_procedure_wq, 0);
else
rtllib_associate_abort(ieee);
@ -2393,7 +2392,7 @@ inline int rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb)
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, 5);
}
return 0;
@ -2715,8 +2714,7 @@ static void rtllib_start_ibss_wq(void *data)
inline void rtllib_start_ibss(struct rtllib_device *ieee)
{
queue_delayed_work_rsl(ieee->wq, &ieee->start_ibss_wq,
msecs_to_jiffies(150));
schedule_delayed_work(&ieee->start_ibss_wq, msecs_to_jiffies(150));
}
/* this is called only in user context, with wx_sem held */
@ -2770,7 +2768,7 @@ void rtllib_disassociate(struct rtllib_device *ieee)
ieee->is_set_key = false;
ieee->wap_set = 0;
queue_delayed_work_rsl(ieee->wq, &ieee->link_change_wq, 0);
schedule_delayed_work(&ieee->link_change_wq, 0);
notify_wx_assoc_event(ieee);
}
@ -2882,9 +2880,9 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown)
rtllib_stop_send_beacons(ieee);
del_timer_sync(&ieee->associate_timer);
cancel_delayed_work(&ieee->associate_retry_wq);
cancel_delayed_work(&ieee->start_ibss_wq);
cancel_delayed_work(&ieee->link_change_wq);
cancel_delayed_work_sync(&ieee->associate_retry_wq);
cancel_delayed_work_sync(&ieee->start_ibss_wq);
cancel_delayed_work_sync(&ieee->link_change_wq);
rtllib_stop_scan(ieee);
if (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED)
@ -3027,9 +3025,6 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
rtllib_send_beacon_cb,
(unsigned long) ieee);
ieee->wq = create_workqueue(DRV_NAME);
INIT_DELAYED_WORK_RSL(&ieee->link_change_wq,
(void *)rtllib_link_change_wq, ieee);
INIT_DELAYED_WORK_RSL(&ieee->start_ibss_wq,
@ -3065,8 +3060,16 @@ void rtllib_softmac_free(struct rtllib_device *ieee)
ieee->pDot11dInfo = NULL;
del_timer_sync(&ieee->associate_timer);
cancel_delayed_work(&ieee->associate_retry_wq);
destroy_workqueue(ieee->wq);
cancel_delayed_work_sync(&ieee->associate_retry_wq);
cancel_delayed_work_sync(&ieee->associate_procedure_wq);
cancel_delayed_work_sync(&ieee->softmac_scan_wq);
cancel_delayed_work_sync(&ieee->start_ibss_wq);
cancel_delayed_work_sync(&ieee->hw_wakeup_wq);
cancel_delayed_work_sync(&ieee->hw_sleep_wq);
cancel_delayed_work_sync(&ieee->link_change_wq);
cancel_work_sync(&ieee->associate_complete_wq);
cancel_work_sync(&ieee->ips_leave_wq);
cancel_work_sync(&ieee->wx_sync_scan_wq);
up(&ieee->wx_sem);
tasklet_kill(&ieee->ps_task);
}

View File

@ -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;
}