From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A02A1C25B79 for ; Thu, 16 May 2024 09:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=azfxY5M6dIi1pUihwJAgfLhjBxMIg9f2JBFcEEUC82w=; b=cZL0w76G6J0PcF 0qzzzWSZDcFhGwj0HTs7OzRhwwxcJNfyt6TUlBMy4H3HkM3RI8USIl5pNIsGvulc5h9kKXFKIPfln Q8qy7w+QJQvH2czNoHR4SvHyezz6FpVzwdYoMvD/p2ZaYHlFGXT1Qus0CZxLunHZ1m6cvAZj+6rWH dVMgs3RiaL0ZXnO1m/3oR7+CHyuis8IPJ3mqm/WqRqryAqbOo7MzI+9KOj/WzIVXDS8PqnUGrMtwc L/SGanFdv0STj79BJIAsJM+2ZItNAmJ9b0oNU7TEPH9Es7c6/z8GqUhh83ZyYOssNKcJRqIEvmtA4 NDHpGMpB3R9bAIbRxWaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7XsX-00000004P9f-3WEi; Thu, 16 May 2024 09:58:25 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7XsU-00000004P5Q-2Gy6 for linux-mtd@lists.infradead.org; Thu, 16 May 2024 09:58:24 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id B404C6000B; Thu, 16 May 2024 09:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715853496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TU3V61Z0wIgectXTOIoDLF/0Qh2EeUmNqA0N7zoS8Fk=; b=haXHGLgz3tHlAGjx+O1RqDE769xASBsIP31pnB6qeDP/6DRuA5rEgbCNRfKkoOuh2o8NCJ cS9gdO6Y3agDJYU02S6GW66q/YtgfnGnupHOM92XlEN1JXXZmFPP7ZAbRgQgV9tqD8Y+42 XxoFhWhqQjWSV17YB+pD+PrHSYnxm7J/WKrQ81ahbzZ88hnQHRnB5yPlWapVNQ36OW8GWd 546YDtKUVZkgodHY01eVqBAyQe53oBoml+aDOhMbhQfYF+M+nYBY9tuLvloq2HAk4FXXtr keK+xZncK/Mq/jdl8xhuWTo5zPGO7zn0IbG+KAV6YHlS2KdCCeo15mzntBlzvA== Date: Thu, 16 May 2024 11:58:12 +0200 From: Miquel Raynal To: Sascha Hauer Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Weinberger Subject: Re: [PATCH] mtd: rawnand: onfi: read parameter pages in one go Message-ID: <20240516115812.02908822@xps-13> In-Reply-To: <20240516101350.78e5ee29@xps-13> References: <20240514134140.1050141-1-s.hauer@pengutronix.de> <20240516101350.78e5ee29@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240516_025822_756282_8BC09101 X-CRM114-Status: GOOD ( 21.58 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Cm1pcXVlbC5yYXluYWxAYm9vdGxpbi5jb20gd3JvdGUgb24gVGh1LCAxNiBNYXkgMjAyNCAxMDox Mzo1MCArMDIwMDoKCj4gSGkgU2FzY2hhLAo+IAo+IHMuaGF1ZXJAcGVuZ3V0cm9uaXguZGUgd3Jv dGUgb24gVHVlLCAxNCBNYXkgMjAyNCAxNTo0MTo0MCArMDIwMDoKPiAKPiA+IG5hbmRfcmVhZF9k YXRhX29wKCkgaXMgbm90IHN1cHBvcnRlZCBieSBhbGwgTkFORCBjb250cm9sbGVycy4KPiA+IG5h bmRfY2hhbmdlX3JlYWRfY29sdW1uX29wKCkgaXMgbm90IHN1cHBvcnRlZCBvciBhdCBsZWFzdCBp cyBoYXJkIHRvCj4gPiBzdXBwb3J0IGJ5IE5BTkQgY29udHJvbGxlcnMgdGhhdCB1c2UgYSBkaWZm ZXJlbnQgcGFnZSBsYXlvdXQgdGhhbgo+ID4gZXhwZWN0ZWQgYnkgdGhlIE5BTkQgY29yZS4gIAo+ IAo+IEknbSBzb3JyeSBidXQgUk5ET1VUIGlzIG5vdCBzbyBoYXJkIHRvIHN1cHBvcnQsIGFuZCBJ IGtub3cgbm8gTkFORAo+IGNvbnRyb2xsZXIgd2l0aG91dCB0aGlzIGZlYXR1cmUgKEkgdGhpbmsg ZXZlbiB0aGUgZmlyc3QgbXhjIGNvbnRyb2xsZXIKPiBzdXBwb3J0cyBpdD8pLiBIb3dldmVyLCB0 aGUgY29tbWFu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vdGxpbi5jb20vbGludXgvbGF0ZXN0L3NvdXJj ZS9kcml2ZXJzL210ZC9uYW5kL3Jhdy9xY29tX25hbmRjLmMjTDI5NjUKClRoYW5rcywKTWlxdcOo bAoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f CkxpbnV4IE1URCBkaXNjdXNzaW9uIG1haWxpbmcgbGlzdApodHRwOi8vbGlzdHMuaW5mcmFkZWFk Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LW10ZC8K From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E106614387B for ; Thu, 16 May 2024 09:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715853500; cv=none; b=V8sfomZ7KIL4YQPB6odbG5O8eSEkJ0OHKmeMO/qoVKP0dOW6ENTr9dGKegaYmlcHVcCUa2ZNtjUOzlo2Z7jlREfu++eRBN20omxbUTT+HtAY564YNIq9teQUzzX+lkbbD2A4uHB9fcFVrIvOeF3Y3DMVnoTOF11SGCk38rTDS8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715853500; c=relaxed/simple; bh=/Pkjo0O6kPrOQ+pSjbXZ0VxxK1MyzoODYOjlkXO8dN0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MAZ42ZfSNqKeX6uRCaj2llzgj2eWF1U/Qtg9fAEpQBiP/eM0D/20bmCv72IzPmrpdxnS63t/W6ektknl2b6Q9vUjwVflClg29EvpGLhyKjnpbM3gf+NhTIr0fnftoNonMpOfyhAlrP/WglZ+VZH1a4QCEWwVaYQE9OF6vuH05u0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=haXHGLgz; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="haXHGLgz" Received: by mail.gandi.net (Postfix) with ESMTPSA id B404C6000B; Thu, 16 May 2024 09:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715853496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TU3V61Z0wIgectXTOIoDLF/0Qh2EeUmNqA0N7zoS8Fk=; b=haXHGLgz3tHlAGjx+O1RqDE769xASBsIP31pnB6qeDP/6DRuA5rEgbCNRfKkoOuh2o8NCJ cS9gdO6Y3agDJYU02S6GW66q/YtgfnGnupHOM92XlEN1JXXZmFPP7ZAbRgQgV9tqD8Y+42 XxoFhWhqQjWSV17YB+pD+PrHSYnxm7J/WKrQ81ahbzZ88hnQHRnB5yPlWapVNQ36OW8GWd 546YDtKUVZkgodHY01eVqBAyQe53oBoml+aDOhMbhQfYF+M+nYBY9tuLvloq2HAk4FXXtr keK+xZncK/Mq/jdl8xhuWTo5zPGO7zn0IbG+KAV6YHlS2KdCCeo15mzntBlzvA== Date: Thu, 16 May 2024 11:58:12 +0200 From: Miquel Raynal To: Sascha Hauer Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Weinberger Subject: Re: [PATCH] mtd: rawnand: onfi: read parameter pages in one go Message-ID: <20240516115812.02908822@xps-13> In-Reply-To: <20240516101350.78e5ee29@xps-13> References: <20240514134140.1050141-1-s.hauer@pengutronix.de> <20240516101350.78e5ee29@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com miquel.raynal@bootlin.com wrote on Thu, 16 May 2024 10:13:50 +0200: > Hi Sascha, >=20 > s.hauer@pengutronix.de wrote on Tue, 14 May 2024 15:41:40 +0200: >=20 > > nand_read_data_op() is not supported by all NAND controllers. > > nand_change_read_column_op() is not supported or at least is hard to > > support by NAND controllers that use a different page layout than > > expected by the NAND core. =20 >=20 > I'm sorry but RNDOUT is not so hard to support, and I know no NAND > controller without this feature (I think even the first mxc controller > supports it?). However, the command does not exist on small page NANDs > (512 bytes). Nevermind, the ONFI spec (in all versions) states that RNDOUT are allowed during parameter page reads, regardless of the size of the chip (at least, that is not mentioned). > TBH I have never seen such a device myself, so I wonder > how spread they still are. >=20 > What may not be supported however are the DATA_IN cycles. >=20 > > Instead of relying on these functions > > just read the three parameter pages in one go. =20 >=20 > Bitflips in parameter pages are very rare, they are normally quite > robust. The proposed solution impacts *all* NANDs, because the I/O > chip speed is at its lowest. There is no reason in most cases to do > that. >=20 > I agree there is a problem with the patch I proposed and we need to > settle. And we simply cannot make RNDOUT calls randomly here as long as > we want to support small page NANDs. >=20 > I believe we should do something like: >=20 > nand_read_param_page_op(0) > if (corrupted) { > if (supported.datain) > data_in(); /* this is faster */ > else =09 > nand_read_param_page_op(1) This can't work, there is a single address byte. The parameter page being 256 bytes, we can't use the address parameter. So I'm sorry but the solutions are: - DATA_IN cycles (not always supported but the best) or if unsupported: - RNDOUT Re-reading the three pages would be slower and is not supported by all controllers anyway. Example of controller not supporting it: qcom [1]. That's why I want the constraints to be fairly well described in the parser. [1] https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/raw/qco= m_nandc.c#L2965 Thanks, Miqu=C3=A8l