From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D65EDC433E0 for ; Thu, 7 Jan 2021 18:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7A0C2342C for ; Thu, 7 Jan 2021 18:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728257AbhAGS5h (ORCPT ); Thu, 7 Jan 2021 13:57:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:40366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726326AbhAGS5g (ORCPT ); Thu, 7 Jan 2021 13:57:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF96D23406; Thu, 7 Jan 2021 18:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610045816; bh=45f8KASW0Fu7tUm+Dkt9MA/Dys/qG3Qvhkz1nV7oF+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z6eEr4w+MSGu2+K/9RX7GcDNB/RBBp3zccod4WgznbweMUNNPKLf2shwA1u/rXdf2 pDWTt5pE+1DGmvS0+zwaVWv0yfFGNlisiC9bR8b4sC0QpbZnSEQQg8TxoWSqdPFZWR NiFAuH3vZio1vYAn+lP8cWg18rxiRxwAot3cr210= Date: Thu, 7 Jan 2021 19:58:15 +0100 From: Greg KH To: Barry Song Cc: tglx@linutronix.de, maz@kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@openeuler.org, Dmitry Torokhov Subject: Re: [PATCH v2] genirq: add IRQF_NO_AUTOEN for request_irq Message-ID: References: <20210105021411.34020-1-song.bao.hua@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210105021411.34020-1-song.bao.hua@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Tue, Jan 05, 2021 at 03:14:11PM +1300, Barry Song wrote: > Many drivers don't want interrupts enabled automatically due to > request_irq(). So they are handling this issue by either way of > the below two: > (1) > irq_set_status_flags(irq, IRQ_NOAUTOEN); > request_irq(dev, irq...); > (2) > request_irq(dev, irq...); > disable_irq(irq); > > The code in the second way is silly and unsafe. In the small time > gap between request_irq() and disable_irq(), interrupts can still > come. > The code in the first way is safe though we might be able to do it > in the generic irq code. > > With this patch, drivers can request_irq with IRQF_NO_AUTOEN flag. > They will need neither irq_set_status_flags() nor disable_irq(). > Hundreds of drivers with this problem will be handled afterwards. > > Cc: Dmitry Torokhov > Signed-off-by: Barry Song Can you also convert some in-kernel drivers to this new api so that we can see how this works? thanks, greg k-h