Thread (1 message) 1 message, 1 author, 2014-07-11

Re: [PATCH] Input: Add driver for Microchip's CAP1106

From: Daniel Mack <daniel@zonque.org>
Date: 2014-07-11 17:42:27
Also in: linux-input

On 07/11/2014 07:33 PM, Dmitry Torokhov wrote:
On Fri, Jul 11, 2014 at 11:48:48AM +0200, Daniel Mack wrote:
quoted
On 07/11/2014 11:43 AM, David Herrmann wrote:
quoted
quoted
+static void cap1106_work(struct work_struct *w)
quoted
+{
+       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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help