From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbdBJIcP (ORCPT ); Fri, 10 Feb 2017 03:32:15 -0500 Received: from protonic.xs4all.nl ([83.163.252.89]:13182 "EHLO protonic.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752587AbdBJIcK (ORCPT ); Fri, 10 Feb 2017 03:32:10 -0500 Date: Fri, 10 Feb 2017 09:32:08 +0100 From: Robin van der Gracht To: Dmitry Torokhov Cc: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Linus Walleij Subject: Re: [PATCH v2 2/3] auxdisplay: ht16k33: rework input device initialization Message-ID: <20170210093208.4a0d7e51@erd979> In-Reply-To: <20170209181553.17277-2-dmitry.torokhov@gmail.com> References: <20170209181553.17277-1-dmitry.torokhov@gmail.com> <20170209181553.17277-2-dmitry.torokhov@gmail.com> Organization: Protonic Holland X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Feb 2017 10:15:52 -0800 Dmitry Torokhov wrote: > This patch fixes following issues in input device (keypad) handling: > > - requesting IRQ before allocating and initializing parts of the device > that can be referenced from IRQ handler is racy, even if we try to > disable interrupt after requesting it. Let's move allocations around > so that everything is ready by the time we request IRQ. > > - using threaded interrupt handler to schedule a work item it sub-optimal. > Disabling and then re-enabling interrupts in work item and in open/close > methods is prone to races and exactly the reason theraded interrupts were > introduced. Let's use the infrastructure properly and keep scanning the > matrix array in IRQ thread, stopping when there are no keys, or when told > to do so. > > Signed-off-by: Dmitry Torokhov > --- > > v2: addressed Robin's feedback - changed interrupt trigger from > IRQF_TRIGGER_RISING to IRQF_TRIGGER_HIGH > Works like a charm! Tested-by: Robin van der Gracht