All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8712: usb_intf:  Remove flush_scheduled_work()
@ 2016-03-13  7:25 Bhaktipriya Shridhar
  2016-03-21 20:50 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Bhaktipriya Shridhar @ 2016-03-13  7:25 UTC (permalink / raw)
  To: outreachy-kernel

flush_scheduled_work() flushes out all work items in system_wq.
Since one doesn't know what could be running there, flushing 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.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 Changes in v2:
	-Fixed typo in commit message.

 drivers/staging/rtl8712/usb_intf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index c1a0ca49..32c5798 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] staging: rtl8712: usb_intf: Remove flush_scheduled_work()
  2016-03-13  7:25 [PATCH v2] staging: rtl8712: usb_intf: Remove flush_scheduled_work() Bhaktipriya Shridhar
@ 2016-03-21 20:50 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-03-21 20:50 UTC (permalink / raw)
  To: Bhaktipriya Shridhar; +Cc: outreachy-kernel

On Sun, Mar 13, 2016 at 12:55:16PM +0530, Bhaktipriya Shridhar wrote:
> flush_scheduled_work() flushes out all work items in system_wq.
> Since one doesn't know what could be running there, flushing 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.
> 
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
> Acked-by: Tejun Heo <tj@kernel.org>
> ---
>  Changes in v2:
> 	-Fixed typo in commit message.
> 
>  drivers/staging/rtl8712/usb_intf.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
> index c1a0ca49..32c5798 100644
> --- a/drivers/staging/rtl8712/usb_intf.c
> +++ b/drivers/staging/rtl8712/usb_intf.c
> @@ -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

This patch does not even build!

Please always test build your patches, to not do so makes maintainers
very grumpy...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-21 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13  7:25 [PATCH v2] staging: rtl8712: usb_intf: Remove flush_scheduled_work() Bhaktipriya Shridhar
2016-03-21 20:50 ` [Outreachy kernel] " Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.