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=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 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 545DEC433ED for ; Mon, 5 Apr 2021 14:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A3BB6128D for ; Mon, 5 Apr 2021 14:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237297AbhDEOdW (ORCPT ); Mon, 5 Apr 2021 10:33:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:32804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235915AbhDEOdV (ORCPT ); Mon, 5 Apr 2021 10:33:21 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7998161284; Mon, 5 Apr 2021 14:33:13 +0000 (UTC) Date: Mon, 5 Apr 2021 15:33:27 +0100 From: Jonathan Cameron To: "Song Bao Hua (Barry Song)" Cc: "linux-iio@vger.kernel.org" , Jonathan Cameron , Alexandre Belloni , "tiantao (H)" Subject: Re: [PATCH 3/7] iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable Message-ID: <20210405153327.3ff5e1f3@jic23-huawei> In-Reply-To: References: <20210402184544.488862-1-jic23@kernel.org> <20210402184544.488862-4-jic23@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, 2 Apr 2021 20:12:13 +0000 "Song Bao Hua (Barry Song)" wrote: > > -----Original Message----- > > From: Jonathan Cameron [mailto:jic23@kernel.org] > > Sent: Saturday, April 3, 2021 7:46 AM > > To: linux-iio@vger.kernel.org > > Cc: Song Bao Hua (Barry Song) ; Jonathan Cameron > > ; Alexandre Belloni > > > > Subject: [PATCH 3/7] iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request > > then disable > > > > From: Jonathan Cameron > > > > Whilst a race during interrupt enabling is probably not a problem, > > it is better to not enable the interrupt at all. The new > > IRQF_NO_AUTOEN flag allows us to do that. > > > > Signed-off-by: Jonathan Cameron > > Cc: Alexandre Belloni > > --- > > Reviewed-by: Barry Song Applied and pushed out as testing to let the autobuilders test it a bit. Still time for others to respond though as I can rebase for at least the next few days as I expect I'll do a pull request mid week. Thanks, Jonathan > > > drivers/iio/adc/nau7802.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/iio/adc/nau7802.c b/drivers/iio/adc/nau7802.c > > index 07c85434b568..bb70b51d25b1 100644 > > --- a/drivers/iio/adc/nau7802.c > > +++ b/drivers/iio/adc/nau7802.c > > @@ -498,7 +498,8 @@ static int nau7802_probe(struct i2c_client *client, > > ret = request_threaded_irq(client->irq, > > NULL, > > nau7802_eoc_trigger, > > - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > > + IRQF_TRIGGER_HIGH | IRQF_ONESHOT | > > + IRQF_NO_AUTOEN, > > client->dev.driver->name, > > indio_dev); > > if (ret) { > > @@ -513,8 +514,7 @@ static int nau7802_probe(struct i2c_client *client, > > dev_info(&client->dev, > > "Failed to allocate IRQ, using polling mode\n"); > > client->irq = 0; > > - } else > > - disable_irq(client->irq); > > + } > > } > > > > if (!client->irq) { > > -- > > 2.31.1 >