Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp175055lqo; Thu, 16 May 2024 02:58:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUx8LqXvkk6aXaraFqe+Z8vgIyLt9WGd8Q1YB/GX7Al2UjkTyGzm7MPgTn5f1JlpopRTpLuAclaB3rKiHrw94sTMCtLwBYWv1cGLhzz4Q== X-Google-Smtp-Source: AGHT+IFtqfs77gpPjsHv2JBRc1tFBALAO4pzECGGlWfEgDBc6ohKsC0zXrd2x+PHERcqrMyDDKmo X-Received: by 2002:a17:906:f111:b0:a5a:28cc:ff85 with SMTP id a640c23a62f3a-a5a2d58545amr1176585466b.28.1715853508526; Thu, 16 May 2024 02:58:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715853508; cv=pass; d=google.com; s=arc-20160816; b=J/0uHThl6Ng1Ndo5UL6FLqzCkz67tfeVLSyrB88jl1YRTjLiwQJDBtRN1/fYLri1Jq bCjebN+onFoAXl+tMdzmCxo06bqVVgwxwDizgNxos1VwSAkgg7gMoO/d+OuX+NYV0n/C jice4MUkrU7AVEppJVb9pVAg0m6HStcmJdrPZ80KDpqX9WGJp491Zod4ntkUHXx2u8+a RohVjSU/9lcRo0ChwgnsFC0W3YqOiH0XrVj2P6OZegtL36xuscLqB9tBBpSLtKzv5zmt xAff6La6RYFEZ4X2ws/TuBXKL6U/0RggUif84BtkqbgpVFsjHo+pzz9tJj0GImUA/wyl Jm3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=TU3V61Z0wIgectXTOIoDLF/0Qh2EeUmNqA0N7zoS8Fk=; fh=KuoaaeS4v7MQZXFEe1CTwlh/O5Fhztn4ow+f7XCbCw8=; b=a5srR4/sUrOTWwpYt9uXBdfsqIeQhwCCvBf2/a9RZmpmcKUk4NW8GTvJWfYZgGRN72 B0GZY+0tq8AxJKzDlFIvdewPbDcVAPClhhIXz+mTKgVXFT4dD40nYJs3kZAQauadA0L+ lVQFC6Ct3K1jq5lsGUVNYgg3/qqQ5B/mVxtuW/cC9mR/3j35JR4O03/6F38nFZf8V6K8 r0vnHwG5bpOvEd/efb6j9icUhRNcfbt06slYL/+FQW03BPTgspVbvYY90v6d8rlBU1tK 7aPSYke0j3KdE7FUpopUmHV35IHqQ4CIEMI6I3s9KgnH7ovPsUgstvEMzD/rgY0Fv4oO Y4uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=haXHGLgz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-180875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180875-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17945f1asi852117666b.70.2024.05.16.02.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 02:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=haXHGLgz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-180875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180875-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 19A7C1F24453 for ; Thu, 16 May 2024 09:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5BE4143882; Thu, 16 May 2024 09:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="haXHGLgz" 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 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