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 55376C4332F for ; Wed, 2 Nov 2022 02:34:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 841F185079; Wed, 2 Nov 2022 03:34:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="fO6RGrqC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D62AB84EEF; Wed, 2 Nov 2022 02:05:37 +0100 (CET) Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1C8D881273 for ; Wed, 2 Nov 2022 02:05:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=liangyanyu13@gmail.com Received: by mail-pf1-x436.google.com with SMTP id b29so14997123pfp.13 for ; Tue, 01 Nov 2022 18:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BtDh+jiK8QxqjaahNn0i0TJl6QOq3J7bKyodjt9F6TQ=; b=fO6RGrqCU2+Tv7p+pjryO89OQLzRkX0QiLEDrlVWFsBPTJTaGcj0BD4GUElBiELxFT rnfiAqpzKnpkbX5W4Xp5hLkjrCAstHq5rhaPrkwK7aL0RHVlhECay5wACOfQlys2MzQV L99YJbVs1QZaaWh9XkWxYqnIFGKf3UmU4C8FKXe6ugJDhrmNF/eaQEAhQUFlM3RVWgzq 7/3EFOkczOpRyTM81eEkMfZ1TQL2eeXr/pXG/QTCLt+t1SiCuMsUFvrNtSYELbxxPKy/ 8wqdPI+Ivox4JqiA5qgaftPemoryZ4n2kSY5wX2f8CJrdC2BY129GY9Golf76z9CBBxT nXaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BtDh+jiK8QxqjaahNn0i0TJl6QOq3J7bKyodjt9F6TQ=; b=hfNc/IFmupx35fKrvLhkajRklm7PxgQS4ba7OSMbolS8faT92bFtrNG/RiDNyPGob0 7DW2KAGADeJpLGosauTjbfMchvUx+yWQ9c1RUEJf5a2AesUQ1jeJemRYQizEQVXC3g3O adhA53LcEM98gbVGeh/HGehCkAOlih5Dvk0a0X3Enq7dPSOpiSSlX8FsZ5tCt3eRml8z AdUpD95P/01zB32UN0Ej1QGIneCAhW0vhqXbuBzrxtXABdT9G18SIzJGtPb6D1x4D3cX Nix68SYe8LyvvepT9DDkbDGqjKXgvmnZ/zn3H2y1qMOIxX9Bk6cFd+tKeF3w2hiRqbmP R+DQ== X-Gm-Message-State: ACrzQf1GfnnW/piADLpeT7fEvg49WkUrUVUTnsnBFSmUJoRpMfc+e53i Qb+ATm/oXYt/fiiBEkrxaIeeUiqnmSwSag== X-Google-Smtp-Source: AMsMyM4h19DMQZ9WhQfdXV4fIzkR1eM8nJ81SFqByIpy8Rq5Ik5nbkBNQv3jqeTgYkxsXbednOoAuw== X-Received: by 2002:a63:2253:0:b0:43c:c924:e56a with SMTP id t19-20020a632253000000b0043cc924e56amr18885498pgm.122.1667351133454; Tue, 01 Nov 2022 18:05:33 -0700 (PDT) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id 13-20020a62190d000000b00562cfc80864sm7134549pfz.36.2022.11.01.18.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 18:05:33 -0700 (PDT) From: Leo Yu To: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, miquel.raynal@bootlin.com, u-boot@lists.denx.de Cc: jaimeliao.tw@gmail.com, Leo Yu Subject: [PATCH v1 3/5] cmd: mtd: Add total length of read operation Date: Wed, 2 Nov 2022 09:05:15 +0800 Message-Id: <20221102010515.32203-1-liangyanyu13@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Wed, 02 Nov 2022 03:33:58 +0100 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 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. Signed-off-by: Leo Yu --- cmd/mtd.c | 2 ++ 1 file changed, 2 insertions(+) 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 = woob ? mtd->oobsize : 0; io_op.datbuf = buf; io_op.oobbuf = woob ? &buf[len] : NULL; + /* Total length of this read operation passed by user */ + io_op.totallen = len; /* Search for the first good block after the given offset */ off = start_off; -- 2.17.1