Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3314975imm; Mon, 6 Aug 2018 02:30:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeuNb3qJVNJAYmDB50mQrdDcbUVzlsxZ2wywR4W5DxfcXrPxkPdHh1iLAacIIMSBfBcMp8V X-Received: by 2002:a63:7e1a:: with SMTP id z26-v6mr13739531pgc.278.1533547854888; Mon, 06 Aug 2018 02:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533547854; cv=none; d=google.com; s=arc-20160816; b=BTMQhVvNKm58ghZpAFRA/pm4UmaDIzinaR+xoj9W11KlV47aOFdRTv7YjpN8jWNSdN t81hP21ghHttamvkNdCLPC5tYUlka1LgW7hhevcWTixHav+T8jdJrfkmE6lTFxMGgwBU N0GOsCB1HNFacaQaphI4wP1axmFPUNpxsabXeG2ei4AtzWLnie+9ucijMJ4i7UUz2IBB Gv/h1AG0P2L7TpLhhpZmQ0wEC78o6gkvLvGQbFjJmwZUgdGlM/BrnuOcP10JQ/qhfi3D UPwD16obxbzCyjWGuTbLq71cWmDoYAMGfcEvkwOYDYttvfRza+s9BlTCgawTWOnhCMSl aiIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AvwPUz6hO0t1fGzby698w1FpDP+P7cF9FoOYJMnDjso=; b=DFyh7riDhUs20ql5riaifvKQB+WiJOcD9XeuD0AS6JVAdNj2wFrlfgx1iun0XlhPZR 1AqbJDFsRQzggeLN3NJS5cyRIw0lr5Ux4E+ysmu8wAK9S8Hj6kkRHTE2qqOJtwWsJBXP TTDtvx39UyTXX+ava8Tv1+PxL1cF31dxsqiNOw3rJJnTH8W4d7Sp4rdRb94FBftigpkh vUnV24A9ntJUyPWfkGQNUJCFXUUTujgL9t+Z1kN7eihwz0zSSOjgApndAsCZqSjgg+bZ PAys+WQF5HsOe++aypnMbGLc6/uA3giVVcnENTh03l1AcsndF4/W0pUBntBmzUCZtE+h R/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=0AhuFbhw; 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 190-v6si15042021pfu.343.2018.08.06.02.30.40; Mon, 06 Aug 2018 02:30:54 -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; dkim=pass header.i=@agner.ch header.s=dkim header.b=0AhuFbhw; 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 S1728908AbeHFLha (ORCPT + 99 others); Mon, 6 Aug 2018 07:37:30 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:53134 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727583AbeHFLh3 (ORCPT ); Mon, 6 Aug 2018 07:37:29 -0400 Received: from trochilidae.toradex.int (unknown [46.140.72.82]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0B0485C1561; Mon, 6 Aug 2018 11:29:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1533547756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AvwPUz6hO0t1fGzby698w1FpDP+P7cF9FoOYJMnDjso=; b=0AhuFbhwTQ1m1ilQH5AdWX8je7Ycp+6h4VhKj73CWVt91Ls/WnFnxyrAG77Bd7RwN13N8M ffTw3n/X+wExXBTGswijHtBhfdh9It76YFFOj2PqqceSajuKqHcShDASxyJDnqLIBmKPbz AzEb9G8KhuPVuLpQi5dSy5PPt+uyNFM= From: Stefan Agner To: boris.brezillon@bootlin.com, miquel.raynal@bootlin.com Cc: computersforpeace@gmail.com, dwmw2@infradead.org, marek.vasut@gmail.com, richard@nod.at, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH 2/3] mtd: rawnand: vf610_nfc: explicitly disable interrupts first Date: Mon, 6 Aug 2018 11:29:08 +0200 Message-Id: <20180806092909.28980-2-stefan@agner.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180806092909.28980-1-stefan@agner.ch> References: <20180806092909.28980-1-stefan@agner.ch> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd); if (err) { dev_err(nfc->dev, "Error requesting IRQ!\n"); -- 2.18.0