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 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html