Thread (17 messages) flat view 17 messages, 4 authors, 2016-05-27

Re: [PATCH] Input: pwm-beeper - fix: scheduling while atomic

From: Manfred Schlaegl <hidden>
Date: 2016-05-24 08:33:09
Also in: lkml

On 2016-05-20 18:59, Dmitry Torokhov wrote:
Hi Manfred,

On Wed, May 18, 2016 at 05:16:49PM +0200, Manfred Schlaegl wrote:
quoted
@@ -133,6 +149,8 @@ static int pwm_beeper_remove(struct platform_device *pdev)
 {
 	struct pwm_beeper *beeper = platform_get_drvdata(pdev);
 
+	cancel_work_sync(&beeper->work);
+
 	input_unregister_device(beeper->input);
This is racy, request to play may come in after cancel_work_sync()
returns but before we unregistered input device. I think you want the
version below.
Hi Dmitry,

yes you are right. Thank you for your feedback.
I also see that point, but I think it would be a simpler change just
to cancel the worker after unregistering the device (to reorder 
cancel_work_sync and input_unregister_device).

Patch will follow shortly.

What do you think?

Sincerely,
Manfred
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help