All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Manfred Schlaegl <manfred.schlaegl@ginzinger.com>,
	Luis de Bethencourt <luis@debethencourt.com>,
	Olivier Sobrie <olivier@sobrie.be>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] Input: pwm-beeper - fix: scheduling while atomic
Date: Wed, 25 May 2016 17:36:15 -0700	[thread overview]
Message-ID: <20160526003615.GE22369@dtor-ws> (raw)
In-Reply-To: <574411B5.2010407@gmx.at>

On Tue, May 24, 2016 at 10:32:53AM +0200, Manfred Schlaegl wrote:
> On 2016-05-20 18:59, Dmitry Torokhov wrote:
> > Hi Manfred,
> > 
> > On Wed, May 18, 2016 at 05:16:49PM +0200, Manfred Schlaegl wrote:
> >> @@ -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).

That is an option, but I wanter to have close() because I also want to
convert the driver to used devm for allocating resources, and then we'd
need close() anyway so that we can get rid of remove() method.

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2016-05-26  0:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 13:19 [PATCH] Input: pwm-beeper - defer pwm config if pwm can sleep Manfred Schlaegl
2016-02-22 19:46 ` Dmitry Torokhov
2016-02-23  8:46   ` Manfred Schlaegl
2016-03-30 14:57     ` Manfred Schlaegl
2016-05-12 12:18   ` Thierry Reding
2016-05-13 15:38     ` Manfred Schlaegl
2016-05-18 15:16       ` [PATCH] Input: pwm-beeper - fix: scheduling while atomic Manfred Schlaegl
2016-05-18 16:06         ` Greg Kroah-Hartman
2016-05-19  7:52           ` Manfred Schlaegl
2016-05-20 16:59         ` Dmitry Torokhov
2016-05-24  8:32           ` Manfred Schlaegl
2016-05-24  8:37             ` Manfred Schlaegl
2016-05-26  0:36             ` Dmitry Torokhov [this message]
2016-05-27  8:54               ` Manfred Schlaegl
2016-05-27  9:11                 ` Manfred Schlaegl
2016-05-27  9:14                   ` Manfred Schlaegl
2016-05-27 23:38                     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160526003615.GE22369@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@debethencourt.com \
    --cc=manfred.schlaegl@ginzinger.com \
    --cc=manfred.schlaegl@gmx.at \
    --cc=olivier@sobrie.be \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.