From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754551AbdBISLX (ORCPT ); Thu, 9 Feb 2017 13:11:23 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36410 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbdBISKd (ORCPT ); Thu, 9 Feb 2017 13:10:33 -0500 Date: Thu, 9 Feb 2017 10:10:18 -0800 From: Dmitry Torokhov To: Robin van der Gracht Cc: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Linus Walleij Subject: Re: [PATCH 2/3] auxdisplay: ht16k33: rework input device initialization Message-ID: <20170209181018.GB8862@dtor-ws> References: <20170131205438.7531-1-dmitry.torokhov@gmail.com> <20170131205438.7531-2-dmitry.torokhov@gmail.com> <20170208174802.26c370f6@erd979> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170208174802.26c370f6@erd979> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On Wed, Feb 08, 2017 at 05:48:02PM +0100, Robin van der Gracht wrote: > On Tue, 31 Jan 2017 12:54:37 -0800 > Dmitry Torokhov wrote: > > + > > + err = devm_request_threaded_irq(&client->dev, client->irq, > > + NULL, ht16k33_keypad_irq_thread, > > + IRQF_TRIGGER_RISING | IRQF_ONESHOT, > > + DRIVER_NAME, keypad); > > I believe the interrupt trigger should be switched to IRQF_TRIGGER_HIGH > combined with IRQF_ONESHOT, for this new setup. This is causing a race > condition. > > In the previous situation a 'key data' read was triggered by > ht16k33_keypad_start(). This cleared the IRQ and gave a (somewhat racy) > known state. Now, when the IRQ line is HIGH during probe keyscan > wont work. > > Also, when ht16k33_keypad_stop() is run while the irq thread is waiting > for debounce, the scan will be skipped and irq will never be cleared. > This also breaks keyscan. You are absolutely right, I shoudl have changed this to IRQF_TRIGGER_HIGH. I'll resend updated patch series in a minute. Thanks. -- Dmitry