Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp624487imm; Wed, 8 Aug 2018 02:55:55 -0700 (PDT) X-Google-Smtp-Source: AA+uWPztJaiCRtFCSAcJS8KrF6wg/faw7f8Tn72xJbqPM6AGUiS6GuL2IAbANYCNIpffckjd7ND4 X-Received: by 2002:a17:902:d710:: with SMTP id w16-v6mr1921400ply.93.1533722155209; Wed, 08 Aug 2018 02:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533722155; cv=none; d=google.com; s=arc-20160816; b=Ekdxx/U57yZ7WejqshOEswCKmYZt+QiPfZl+eEI+In7X1jCocu5O+YVUh7wk+M6olB 9CDQ9SaU2B9mIt32dxfNlUnT1z2ZMmNVvYZkO75v2438GJX+LIIw7GIfFSN1SqP1N1Ma qr1gDUQeIzkbw6Z8WckMY9P4jpX5xlkHpGuyia8Qq3JY1zNYg0yX7yyHbJvKpsn0UHfI ICgGyIgW9WQy7MAnCguSTHrIqR+QV3BJV3Y+koQlXXDf+3J4aX7/Rr/XZHn89VlIp91q GHHOsGL/8AbXBT3GmyuxURpfvcPF8JlUEzoM189ITxzF4cM2pDspez6zVLQsKtz/0tyx uEaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=QONejzuN0rl5LgqtZMmHYKblTuI/UaLr0TfT802M5ZQ=; b=THBtXJK2gL7RS/MJlMQMrH7w/P2MJwgBLdoa1uhILFYvFWsBa3gBiWstCkc1YOlhcI VeJ6W0r78SU9s0TtDtbUqMVK85tQaxbcAXIqsYNVA+l0kj/aoFqbHUW8NsXSUzMyII/M f3paZaxeVqgzniNiZBuRsRd1/kvjUgcOfnl5NJPhzS5td6reATtRXsH67rD++5n/EvTI J0sTP5zSfVjEmdecjr9qnllPa4P7TgAVm85RNjvvLX4ByDs0l8xrntNaelrXsv5MXb7R 8yn2N2zrjnXKVy/e6xM8oyu+D2kqBqrjAQ/DK0HzggrFViyQsz5pSBGTm0V4iJxiVKm/ 5GIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v190-v6si3796568pgd.668.2018.08.08.02.55.40; Wed, 08 Aug 2018 02:55:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbeHHMNq convert rfc822-to-8bit (ORCPT + 99 others); Wed, 8 Aug 2018 08:13:46 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54711 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbeHHMNq (ORCPT ); Wed, 8 Aug 2018 08:13:46 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 531E820739; Wed, 8 Aug 2018 11:54:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (AAubervilliers-681-1-99-143.w90-88.abo.wanadoo.fr [90.88.4.143]) by mail.bootlin.com (Postfix) with ESMTPSA id 162E4206A6; Wed, 8 Aug 2018 11:54:36 +0200 (CEST) Date: Wed, 8 Aug 2018 11:54:37 +0200 From: Miquel Raynal To: Stefan Agner Cc: boris.brezillon@bootlin.com, computersforpeace@gmail.com, dwmw2@infradead.org, marek.vasut@gmail.com, richard@nod.at, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] mtd: rawnand: vf610_nfc: explicitly disable interrupts first Message-ID: <20180808115437.34365451@xps13> In-Reply-To: <20180806092909.28980-2-stefan@agner.ch> References: <20180806092909.28980-1-stefan@agner.ch> <20180806092909.28980-2-stefan@agner.ch> Organization: Bootlin X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stefan, Stefan Agner wrote on Mon, 6 Aug 2018 11:29:08 +0200: > Explicitly disable all interrupts on probe. This should be the > default state, but the bootloader could leave the device in any > state. No issues have been observed so far, but it is still worth > fixing it. > > Signed-off-by: Stefan Agner > --- > drivers/mtd/nand/raw/vf610_nfc.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c > index 740a91c5c86e..52e7811c0bde 100644 > --- a/drivers/mtd/nand/raw/vf610_nfc.c > +++ b/drivers/mtd/nand/raw/vf610_nfc.c > @@ -130,8 +130,13 @@ > #define CONFIG_PAGE_CNT_SHIFT 0 > > /* NFC_IRQ_STATUS Field */ > +#define WERR_IRQ_BIT BIT(31) > +#define DONE_IRQ_BIT BIT(30) > #define IDLE_IRQ_BIT BIT(29) > +#define WERR_EN_BIT BIT(22) > +#define DONE_EN_BIT BIT(21) > #define IDLE_EN_BIT BIT(20) > +#define WERR_CLEAR_BIT BIT(19) > #define DONE_CLEAR_BIT BIT(18) > #define IDLE_CLEAR_BIT BIT(17) > > @@ -819,6 +824,10 @@ static int vf610_nfc_probe(struct platform_device *pdev) > > init_completion(&nfc->cmd_done); > > + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, WERR_EN_BIT); > + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, DONE_EN_BIT); > + vf610_nfc_clear(nfc, NFC_IRQ_STATUS, IDLE_EN_BIT); > + Why not just one call with: vf610_nfc_clear(nfc, NFC_IRQ_STATUS, WERR_EN_BIT | DONE_EN_BIT | IDLE_EN_BIT); The comment applies for the next patch as well. > err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd); > if (err) { > dev_err(nfc->dev, "Error requesting IRQ!\n"); Thanks, Miquèl