Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1679471imm; Fri, 8 Jun 2018 22:54:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLOCVY/7AWShl+YRgyZ3//2PINI6DXUOPTR/Yt7qtJjaQ+ZZJJ+tC0WLYBYDEivKEerJXZA X-Received: by 2002:a17:902:bf01:: with SMTP id bi1-v6mr9528842plb.43.1528523647815; Fri, 08 Jun 2018 22:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528523647; cv=none; d=google.com; s=arc-20160816; b=QJFb8K6+u0WAR5NGl//TvWBI+eJeuJioRzsyKsJy2vpLRjQtxy8uRiyGgw1xC6C5vr v3T+TsH3k+TKJ7TIVTbBRAH1MkVNYWbxN+0wNXjwPrPSA/miTDrtpaCS/idUj8IhuXHN 12eFIVHAs9LbpsCvThsdSd7Cj856glhXR8OTL3GWa7JYjw08b0tfXOe8cOn28fUhJkqO mUxWWgZDXXh0gY7aXC+wHPAuUpzG7kLsucQzyHd+igabRptHnyBBFWmwfBQJYl1h+hdX rcMY0Ho8hfHeJy/uGuBt/a8d3p8UUlrzFVTWVoq3FBaDObruVl1Hne6QqnPxbY7oKKey 7goA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=2maD+59ikhcWh01+QaQcbaKVbYrIfDxFnPUHq0bsIxg=; b=fStsdCMfm7chEs6zgizJstcqgJy0F1z7InifEThtKTxLVJncGZ/de9fJfGzY5Q0NVc Ne2OkSCTTMR2+Nv80Zy5t2Snd6v/K2lVdzHoQUl8wU4+mIc4go0QFcPuwMq8Gr2OCpoe 2Khz6L62lXsoFSu3/ospe8na4ckJIU2bvEm89wbIJOBSHSQfNn2Uo5cA6Q7+3cvHEyR1 nM1s9gW6Sl8P4wPSUTbQSCLjnuftVIEc47Iss8yMEuHel6iKJJDq4BUvIoABjST8HbU3 LNwycwC8bv7p74p/UKuPyF5duw9UUpRW4ko2ENkl8cPAkrO+yQBG2qqinbC6UVX10HvR eG9w== 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 m62-v6si431539pfb.127.2018.06.08.22.53.41; Fri, 08 Jun 2018 22:54:07 -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 S1751466AbeFIFxC (ORCPT + 99 others); Sat, 9 Jun 2018 01:53:02 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50184 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbeFIFxA (ORCPT ); Sat, 9 Jun 2018 01:53:00 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 2D700207CA; Sat, 9 Jun 2018 07:52:58 +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 bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 9DC33203EC; Sat, 9 Jun 2018 07:52:57 +0200 (CEST) Date: Sat, 9 Jun 2018 07:52:56 +0200 From: Boris Brezillon To: Stefan Agner Cc: Dmitry Osipenko , dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, thierry.reding@gmail.com, dev@lynxeye.de, miquel.raynal@bootlin.com, richard@nod.at, marcel@ziswiler.com, krzk@kernel.org, benjamin.lindqvist@endian.se, jonathanh@nvidia.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com, mirza.krak@gmail.com, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/6] mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver Message-ID: <20180609075256.725354d6@bbrezillon> In-Reply-To: References: <20180531221637.6017-1-stefan@agner.ch> <20180531221637.6017-5-stefan@agner.ch> 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=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 08 Jun 2018 23:51:01 +0200 Stefan Agner wrote: > > > > void tegra_nand_controller_reset(struct tegra_nand_controller *ctrl) > > { > > int err; > > > > disable_irq(ctrl->irq); > > > > err = reset_control_reset(ctrl->rst); > > if (err) { > > dev_err(ctrl->dev, "Failed to reset HW: %d\n", err); > > msleep(HW_TIMEOUT); > > } > > > > writel_relaxed(NAND_CMD_STATUS, ctrl->regs + HWSTATUS_CMD); > > writel_relaxed(HWSTATUS_MASK, ctrl->regs + HWSTATUS_MASK); > > writel_relaxed(INT_MASK, ctrl->regs + ISR); > > If we do a controller reset, there is much more state than that which > needs to be restored. A lot of it is not readily available currently > (timing, ECC settings...) This is actually a good test to detect what is not properly initialized by the driver. Timings should be configured correctly through ->setup_data_interface(). ECC engine should be disabled by default and only enabled when ->{read,write}_page() is called. > > That seems a lot of work for a code path I do not intend to ever use :-) > Not so sure it's a lot of work. If ECC and timing settings are the only thing you need to initialize then it should work just fine. Try with a controller reset and you'll know if you miss something ;-).