Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp728825imm; Mon, 9 Jul 2018 09:33:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqNhemS3mXFjYuCp2Nry659K+aodRxVUXZ3mh//+0Dj9MoLwR2dIPCbYbGCMxajW8Dq23N X-Received: by 2002:a65:654d:: with SMTP id a13-v6mr14911975pgw.132.1531153994594; Mon, 09 Jul 2018 09:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531153994; cv=none; d=google.com; s=arc-20160816; b=DaQTX2rlX65deytbx3IrBwhsV9qi1rcy+NoPUmrpIP7l3/cCjJ2EJ5n6avz63+spUo Tmltpppvbjl6ehzPr3UMGX1PZ7jVdVyj09BhJuhKL76fyLrASb70N7T93Ca69TuX/Fyz 6APlH5OoXExpiwkiOprvCHIhhqaWwKqMzAmZ2NEB6h0lW8e55+llUgsmVSB6MJn6f3tw rjeiWfiInqwwhyoWYEsJuO1E3bg8c0JdecKgVF54zLNXrrfnJwxiOaFEkccQlOrq8Gia TDguOc/hJGQjA0HX78+h4nT7w3wdy6rVNEF1sBm65pSFIg/Mp+7EWEWs5CLLoRluCImB wI+Q== 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=LSpSGG53+1BoRhevIN1KFGEIDzH8p/okc8HZW5RWkvM=; b=JCD3mxerbcCqbDSW75wDQ9dNEgX7YNSVrHAAzYEK61LQbfGpDeIwkFxeRjPkX2Eebv BYPw/owN1al64WbKU6FbWs9FpL3J1xPbmGVhsT8NTJ1L16byvk2FCXxxF27H40MSkIFG 3G0pMDqOQbI5Vrk80Oqxpft34pNVJmo4cmjUuKPAv3YvPdo5ICpOJ4zld8UcaXo4+kH5 wXHFK+TcLPhzfd+1aJhUZPIvzJJroBzO3aH0tcu82YYIYdNCIJHfez9OzzQO8CQF6+uL u/DTl/2xpEnMixZSlTdW8AGf2anNIfYOpDmHRTr2AOlD+RVMDFeJVjdu23/xytlB+ekm QZIw== 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 1-v6si14810572plx.227.2018.07.09.09.33.00; Mon, 09 Jul 2018 09:33:14 -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 S1754562AbeGIQb1 (ORCPT + 99 others); Mon, 9 Jul 2018 12:31:27 -0400 Received: from mail.bootlin.com ([62.4.15.54]:34586 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459AbeGIQb0 (ORCPT ); Mon, 9 Jul 2018 12:31:26 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 72DA920876; Mon, 9 Jul 2018 18:31:25 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-12-56.w90-88.abo.wanadoo.fr [90.88.133.56]) by mail.bootlin.com (Postfix) with ESMTPSA id 2C2A920741; Mon, 9 Jul 2018 18:31:25 +0200 (CEST) Date: Mon, 9 Jul 2018 18:31:24 +0200 From: Boris Brezillon To: "Bean Huo (beanhuo)" Cc: Chris Packham , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "miquel.raynal@bootlin.com" , "computersforpeace@gmail.com" , "dwmw2@infradead.org" Subject: Re: [PATCH v6 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Message-ID: <20180709183124.22f39f1b@bbrezillon> In-Reply-To: References: 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 Hi Bean, On Mon, 9 Jul 2018 15:54:11 +0000 "Bean Huo (beanhuo)" wrote: > Hi, Boris and Chris > > >> > >> I see 2 solutions to this problem: > >> 1/ Bean provides us a solution to reliably detect when ECC can be > >> de-actived and when it can't > >> 2/ We only ever expose 64 bytes of OOB to the user and consider that > >> ECC can be disabled, even if it can't in reality > >> > > > >After reading the doc again, I forgot one thing you can try before deciding to > >go for option #2. > > > >8th bit in byte 5 of READID's result encodes whether the on-die ECC state > >(enabled or not). I remember we had a discussion with Bean where he told us > >this was a runtime status reflecting the on-die ECC state, which is crazy, since > >READID might return different values depending on the NAND state, and most > >of the code in the core assumes READID provides a fixed ID that encodes the > >chip characteristics/capabilities, not its state. > > > >Anyway, if this bit is actually reflecting the on-die ECC state and on-die > >cannot be disabled on your chip, it should stay at 1 even after you have sent > >the SET_FEATURES(DISABLE_ECC) command. Let's hope this works as I expect, > >otherwise we're back to option #2 until Bean suggest something else. > > MT29F1G08ABAFAWP-ITE:F is Micron 70s SLC NAND with on-die ECC. > If the bit7 in the byte 5 of READID default is 1(ECC Enabled), it is true on-die ECC > Cannot be disabled by SET Feature command. > In case sending Set Feature command, you can check previous command is success or not by > Get Feature Chris tried that already and it didn't work. GET_FEATURES(ECC) returns a value with the bit cleared (meaning that ECC is supposedly disabled) after SET_FEATURES(ECC, DISABLE) has been sent. Are you sure that GET_FEATURES(ECC) is supposed to return the actual state of the ECC engine and not the last value you wrote in the internal reg (would be the case if this reg is just a dummy reg when on-die ECC is forcibly enabled). > or check this bit7 in byte 5 of READID later. This, we'll have to test. > > To check if this device supports on-die ECC or not, you can use inter ECC level (bit 0 and bit1 in byte 5 of READID) > http://lists.infradead.org/pipermail/linux-mtd/2017-April/073370.html Okay, I think we already had this discussion, but I'm asking it again. What are the possible values for that field and what do they mean? Also, is it even used to encode the fact that the NAND has on-die ECC on all your NANDs? We already had the problem of incompatible ID schemes, so I wouldn't be surprised if that was the case here, hence my initial suggestion to base the detection on the model name. Bean, can you check that on a few different NAND parts before giving a definitive answer, because, at least for the SET_FEATURES(ECC), we don't see what you describe, and that's not the first time you suggest things that do not work in real life. Regards, Boris