Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3110103imm; Sun, 10 Jun 2018 08:40:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKIBoj0TqIH4WmkJiuTixPvXjAUtkqdH4s9EL4jgfr5zkckSqfvOts5d4RfNRydJyT3Ppyq X-Received: by 2002:a63:87c8:: with SMTP id i191-v6mr11927385pge.124.1528645248916; Sun, 10 Jun 2018 08:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528645248; cv=none; d=google.com; s=arc-20160816; b=xhD30P2nPRPO5/i92a+0m5sYUAmdZgZj7H0YmrKXEco/b053bdFbAVgReAW5agrmwm N06a/rBT2vbG2vhJSrIWvJzXNjrlsMSmFr7H1JppDTEWyzDK/IHVLZXKss+Agyf0IVeR xbgtOArjFN3E8o6DWSm17GDOZsQ7qMm2lmzqyhf6LHmeMm0fpmESyny9nnzSSWZAuJT8 /ScEIqHjQr1j7g7tXQqFGqmukaLXh0zO/TvOaa/SHnt+DDCv10NB44EsJQzU2A7hyUE/ sK5r5nZeSL6lGxQAOJqKFewWrhSsCvBiwqEBvJ3mLpsNbPJkvHjE4SH/ZJZbKNeXu4P3 J3yw== 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=zk5eElGxL/vKID/tapbW9DzHk75tb2T1bXBNWnPIhPM=; b=oByNMtmXB2kVPJxHNgC2d4A/UM4ZDvj0IVWgsChqkpfktaf8Y9auMQG7fcXkSLvwZb 57s5+KLDTGBST45zsAE/YEyPmJjCY2MrAwuYM02YB0ElwVwsF93jtZUNN3a9mlD7JklW gjXdvssPeJ1R/S6FIb+pF1L4K7yN6u0ZHvZFANubLFooaxFBNWiSMvtg9YdDGiO9u2+i gvj/uLuk41vwk4ZBv7VbTocNYV2TQQdQbjEpDIo6K7ZpVJvZ2A5H0n/fCoZ1uBJZgpsq vxPTqNJwsxKExjG2pixjeuJjwoLj4LdLR77GrXtAAOGAiTVqfTHiFun4RFko7HW+RaWI oILQ== 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 a10-v6si58029362pfn.256.2018.06.10.08.40.22; Sun, 10 Jun 2018 08:40:48 -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 S1753571AbeFJPcH (ORCPT + 99 others); Sun, 10 Jun 2018 11:32:07 -0400 Received: from mail.bootlin.com ([62.4.15.54]:34823 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753407AbeFJPcF (ORCPT ); Sun, 10 Jun 2018 11:32:05 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 059C0207A5; Sun, 10 Jun 2018 17:32:03 +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 (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 7B39C20702; Sun, 10 Jun 2018 17:32:02 +0200 (CEST) Date: Sun, 10 Jun 2018 17:32:02 +0200 From: Boris Brezillon To: Dmitry Osipenko Cc: Stefan Agner , 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: <20180610173202.680d2ee8@bbrezillon> In-Reply-To: <1868760.y7shk6NfjH@dimapc> References: <20180531221637.6017-1-stefan@agner.ch> <22478634.OSqaXHucyu@dimapc> <5751ef697130ba93ce9fb7722a1ce117@agner.ch> <1868760.y7shk6NfjH@dimapc> 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 Sun, 10 Jun 2018 18:00:06 +0300 Dmitry Osipenko wrote: > > >> That seems a lot of work for a code path I do not intend to ever use :-) > > > > > > Are you sure that resetting HW resets the timing and other registers > > > configuration? Reset implementation is HW-specific, like for example in a > > > case of a video decoder the registers state is re-intialized on HW reset, > > > but registers configuration is untouched in a case of resetting GPU. I'd > > > suggest to check whether NAND controller resetting affects the HW > > > configuration. > > It seems all registers are set back to their documented reset value: > > > > [boot loader/ROM initialized values] > > [ 1.270253] tegra-nand 70008000.nand: Tegra NAND controller register > > dump > > [ 1.277051] tegra-nand 70008000.nand: COMMAND: 0x66880104 > > [ 1.282457] tegra-nand 70008000.nand: STATUS: 0x00000101 > > [ 1.287763] tegra-nand 70008000.nand: ISR: 0x01000120 > > [ 1.292818] tegra-nand 70008000.nand: IER: 0x00000000 > > [ 1.297863] tegra-nand 70008000.nand: CONFIG: 0x00840000 > > [ 1.303181] tegra-nand 70008000.nand: TIMING: 0x05040000 > > [ 1.308486] tegra-nand 70008000.nand: TIMING2: 0x00000003 > > [ 1.313897] tegra-nand 70008000.nand: CMD_REG1: 0x00000000 > > [ 1.319377] tegra-nand 70008000.nand: CMD_REG2: 0x00000030 > > [ 1.324868] tegra-nand 70008000.nand: ADDR_REG1: 0x03000000 > > [ 1.330435] tegra-nand 70008000.nand: ADDR_REG2: 0x00000000 > > [ 1.336011] tegra-nand 70008000.nand: DMA_MST_CTRL: 0x04100004 > > [ 1.341838] tegra-nand 70008000.nand: DMA_CFG_A: 0x00000fff > > [ 1.347415] tegra-nand 70008000.nand: DMA_CFG_B: 0x0000001b > > [ 1.352991] tegra-nand 70008000.nand: FIFO_CTRL: 0x0000aa00 > > [reset] > > [ 1.358559] tegra-nand 70008000.nand: Tegra NAND controller register > > dump > > [ 1.365352] tegra-nand 70008000.nand: COMMAND: 0x00800004 > > [ 1.370744] tegra-nand 70008000.nand: STATUS: 0x00000101 > > [ 1.376060] tegra-nand 70008000.nand: ISR: 0x00000100 > > [ 1.381105] tegra-nand 70008000.nand: IER: 0x00000000 > > [ 1.386161] tegra-nand 70008000.nand: CONFIG: 0x10030000 > > [ 1.391466] tegra-nand 70008000.nand: TIMING: 0x00000000 > > [ 1.396782] tegra-nand 70008000.nand: TIMING2: 0x00000000 > > [ 1.402174] tegra-nand 70008000.nand: CMD_REG1: 0x00000000 > > [ 1.407664] tegra-nand 70008000.nand: CMD_REG2: 0x00000000 > > [ 1.413156] tegra-nand 70008000.nand: ADDR_REG1: 0x00000000 > > [ 1.418722] tegra-nand 70008000.nand: ADDR_REG2: 0x00000000 > > [ 1.424297] tegra-nand 70008000.nand: DMA_MST_CTRL: 0x24000000 > > [ 1.430123] tegra-nand 70008000.nand: DMA_CFG_A: 0x00000000 > > [ 1.435698] tegra-nand 70008000.nand: DMA_CFG_B: 0x00000000 > > [ 1.441264] tegra-nand 70008000.nand: FIFO_CTRL: 0x0000aa00 > > Alright, then indeed it's not really worth to bother with HW resetting here. > Probably only a kernel module reload or a reboot will help if HW is hung. > Maybe NAND controller / chip recovering is something that NAND core should be > handling in a such case by providing a nand_controller_reset() hook? > I don't see what the core could do to help with that. We'd end up with a new hook implemented by the controller that would be called by the controller driver when it knows it's safe to reset the controller. So, why bother exposing that in the core?