staging: rtl8712: usb_intf: Remove flush_scheduled_work()
PATCH 1/1 staging: rtl8712: usb_intf: Remove flush_scheduled_work()
flush_scheduled_work() flushes out all work items in system_wq. Since one doesn't know what could be running there, flushinf work items individually is preferred.
Since there are finite number of work items to be flushed,(viz pwrpriv->SetPSModeWorkItem,pwrpriv->SetPSModeWorkItem,pLed->BlinkWorkItem) instead of flushing system_wq, each work item is separately flushed.
--- drivers/staging/rtl8712/usb_intf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/usb_intf.c +3 -1
@@ -627,7 +627,9 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)if (drvpriv.drv_registered) padapter->bSurpriseRemoved = true;unregister_netdev (pnetdev);/* will call netdev_close() */ -flush_scheduled_work (); +cancel_delayed_work (&pwrpriv->SetPSModeWorkItem); +cancel_delayed_work (&pwrpriv->rpwm_workitem); +cancel_delayed_work (&pLed->BlinkWorkItem);udelay (1 );/* Stop driver mlme relation timer */ r8712_stop_drv_timers (padapter);
--
2.1.4
Quoted 2 lines · Bhaktipriya Shridhar
flush_scheduled_work()flushes out all work items insystem_wq. Since one doesn't know what could be running there, flushinf work items
flushinf -> flushing
Quoted 36 lines
individually is preferred.
Since there are finite number of work items to be flushed,(viz pwrpriv->SetPSModeWorkItem,pwrpriv->SetPSModeWorkItem,pLed->BlinkWorkItem) instead of flushing
system_wq, each work item is separately flushed.Signed-off-by Bhaktipriya Shridhar <[email protected]>--- drivers/staging/rtl8712/usb_intf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/rtl8712/usb_intf.c +3
-2@@ -627,7 +627,9 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)if (drvpriv.drv_registered) padapter->bSurpriseRemoved = true;unregister_netdev (pnetdev);/* will call netdev_close() */ -flush_scheduled_work (); +cancel_delayed_work (&pwrpriv->SetPSModeWorkItem); +cancel_delayed_work (&pwrpriv->rpwm_workitem); +cancel_delayed_work (&pLed->BlinkWorkItem);udelay (1 );/* Stop driver mlme relation timer */ r8712_stop_drv_timers (padapter); --2.1.4
Signature · 5 lines
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160312183227.GA17219%40Karyakshetra. For more options, visit https://groups.google.com/d/optout.
Hello, Bhaktipriya.
Quoted 3 lines · Bhaktipriya Shridhar
flush_scheduled_work()flushes out all work items insystem_wq. Since one doesn't know what could be running there, flushinf work items individually is preferred.
And flush_scheduled_work() is deprecated as its behavior is unpredictable and it makes system_wq less useful.
Quoted 5 lines
Since there are finite number of work items to be flushed,(viz pwrpriv->SetPSModeWorkItem,pwrpriv->SetPSModeWorkItem,pLed->BlinkWorkItem) instead of flushing
system_wq, each work item is separately flushed.Signed-off-by Bhaktipriya Shridhar <[email protected]>
Thanks a lot!
Signature · 1 line
tejun