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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4031EC4332F for ; Mon, 7 Nov 2022 14:51:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E945484E56; Mon, 7 Nov 2022 15:51:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="AcFPgBDS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6F578070B; Mon, 7 Nov 2022 15:51:54 +0100 (CET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 820BF84EC7 for ; Mon, 7 Nov 2022 15:51:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 8788B2000E; Mon, 7 Nov 2022 14:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667832708; 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=tlAcgD+UQ49KVqT79roMAx8480ce04c2qxgG6rUIJYg=; b=AcFPgBDSxfuzrNM7Jneis3uVFI09COPI2OvLxBTe/FUeZHgqktsfQ/60HtmwJ0D38tyGjC sCKl50xClNlkv43JAS4SzsUsL1kwTgTZrAJdVH2C4z8zB/M+l1mu905wGFBadwVJnTRhfb bKb8+oK/glSeV4aYR3A7CUz4NvgPrXALr17HMqNCTNzYJp1esI5fbr0m3JzThp20QZRCRX 99M8gt3eOUsVxyuj8QknWaVJI6gg1Z3i7EXKvSQijAXJ7nRcioTlUu3WWHIwei1Ty8kG48 2MZGEXY6gCikul8Ri0u4TCOyPHlKso0f2rDgHpKAHYR2kFwwWW7PBPj5w0egxQ== Date: Mon, 7 Nov 2022 15:51:46 +0100 From: Miquel Raynal To: Leo Yu Cc: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, u-boot@lists.denx.de, jaimeliao.tw@gmail.com Subject: Re: [PATCH v2 3/5] cmd: mtd: Add total length of read operation Message-ID: <20221107155146.2c30eac3@xps-13> In-Reply-To: <20221102061432.7113-4-liangyanyu13@gmail.com> References: <20221102061432.7113-1-liangyanyu13@gmail.com> <20221102061432.7113-4-liangyanyu13@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Leo, liangyanyu13@gmail.com wrote on Wed, 2 Nov 2022 14:14:30 +0800: > This patch bypasses the limitation of length for read operations > in MTD test module. Thus, the total length of a read operation > can be passed down to the continuous read operation in SPI NAND > layer. >=20 > Signed-off-by: Leo Yu > --- > cmd/mtd.c | 2 ++ > include/linux/mtd/mtd.h | 2 ++ > 2 files changed, 4 insertions(+) >=20 > diff --git a/cmd/mtd.c b/cmd/mtd.c > index ad5cc9827d..0b601e08a3 100644 > --- a/cmd/mtd.c > +++ b/cmd/mtd.c > @@ -335,6 +335,8 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag,= int argc, > io_op.ooblen =3D woob ? mtd->oobsize : 0; > io_op.datbuf =3D buf; > io_op.oobbuf =3D woob ? &buf[len] : NULL; > + /* Total length of this read operation passed by user */ > + io_op.totallen =3D len; Where is this used? >=20 > /* Search for the first good block after the given offset */ > off =3D start_off; > diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h > index ff635bd716..df8a231c82 100644 > --- a/include/linux/mtd/mtd.h > +++ b/include/linux/mtd/mtd.h > @@ -79,6 +79,7 @@ struct mtd_erase_region_info { > * mode =3D MTD_OPS_PLACE_OOB or MTD_OPS_RAW) > * @datbuf: data buffer - if NULL only oob data are read/written > * @oobbuf: oob data buffer > + * @totallen: total number of data bytes to read in one read operation= (for continuous read mode) > */ > struct mtd_oob_ops { > unsigned int mode; > @@ -89,6 +90,7 @@ struct mtd_oob_ops { > uint32_t ooboffs; > uint8_t *datbuf; > uint8_t *oobbuf; > + size_t totallen; > }; >=20 > #ifdef CONFIG_SYS_NAND_MAX_OOBFREE > -- > 2.17.1 >=20 Thanks, Miqu=C3=A8l