linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: David Herrmann <dh.herrmann@gmail.com>,
	"list@mail.zonque.de: HID CORE LAYER"
	<linux-input@vger.kernel.org>, Mark Brown <broonie@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] Input: Add driver for Microchip's CAP1106
Date: Fri, 11 Jul 2014 19:42:27 +0200	[thread overview]
Message-ID: <53C02203.50601@zonque.org> (raw)
In-Reply-To: <20140711173336.GA492@core.coreip.homeip.net>

On 07/11/2014 07:33 PM, Dmitry Torokhov wrote:
> On Fri, Jul 11, 2014 at 11:48:48AM +0200, Daniel Mack wrote:
>> On 07/11/2014 11:43 AM, David Herrmann wrote:
>>>> +static void cap1106_work(struct work_struct *w)
>>>>> +{
>>>>> +       struct cap1106_priv *priv = container_of(w, struct cap1106_priv, work);
>>>>> +       unsigned int status;
>>>>> +       int ret, i;
>>>>> +
>>>>> +       spin_lock(&priv->lock);
>>> If your worker started and is _about_ to take the spinlock, you might
>>> dead-lock with cap1106_close(). They might already hold the spinlock
>>> and then call cancel_work_sync(), thus waiting for this task to take
>>> the lock end exit..
>>>
>>> How about you add "bool closed : 1;" to your cap1106_priv structure
>>> and drop the lock here, but..
>>>
>>
>> Thanks for the review, David. Will look into it and send a v2 with these
>> changes soon.
> 
> Why aren't you using threaded oneshot IRQ for this? Then you would not
> need all this dancing around with worker and enabling/disabling
> interrupt.

Ah, right, that's much nicer indeed.
Thanks for the pointer! I'll post v3 later.


Daniel


  parent reply	other threads:[~2014-07-11 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11  7:42 [PATCH] Input: Add driver for Microchip's CAP1106 Daniel Mack
2014-07-11  9:43 ` David Herrmann
     [not found]   ` <53BFB300.1040500@zonque.org>
     [not found]     ` <20140711173336.GA492@core.coreip.homeip.net>
2014-07-11 17:42       ` Daniel Mack [this message]
2014-07-11  9:47 ` David Herrmann

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=53C02203.50601@zonque.org \
    --to=daniel@zonque.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dh.herrmann@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).