Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1234554rdb; Mon, 2 Oct 2023 03:36:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoEpxB+TwMP27MeOf2ooLjvKlHI7Y3upaS6RAZYDU2soqqPdDb/ArpzTJ74DukLY4atZK0 X-Received: by 2002:a17:90b:1215:b0:273:e24e:36b9 with SMTP id gl21-20020a17090b121500b00273e24e36b9mr10570836pjb.8.1696242974399; Mon, 02 Oct 2023 03:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696242974; cv=none; d=google.com; s=arc-20160816; b=iHqaYNJtvUB30TfQHRZHO1ygCA2JPw4DKYfIZvR14hv7GuxckjXPOhYRy/6rAfwE9r L2wKt03apEoLbQMQPjvYHcjPnz/3JEi7BR1KkMiOQZucuJLKMFqZ/PBEUDZamjYBvjvM omIVWN1ODDLrBhtnKj1WsmmkmZ0QDeLCkEAFfmUjoVGCgXIo0E33D3hn1JUNk47IGWID j+TN3eUIqQIdgUI1fl/cWfuHPe4N7xz6UHhkNfph6APC6luL1C1gaBNcXl56eyor94W3 A5kfUo3jJeF0H1zvUhCg+iMz1HEtBC+C6n4c1it14PRt8Rq8wUL+pDLwmdR9AmR5ngiG SZcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=1nvcBaLCmY8mO5vCFGklzXqpSCLTGt+OF1cfRa4tU1I=; fh=SHjUcDOckhvCZZezmD4hyvyPs/lVB5rhWRtCp1PGmv4=; b=0rjtgcOgOrIkK8mvUCNCWSA59JVEjtqt2P1Ylt19XDNa1QC9EGIG4wl7uiFupCQhZ7 pB/2ZliH7Ji5rnd5FeBOiawHO4VZTRzbFYYArcu1e72TobU3V89dpBcIF0v8vbETqLXy xDTRkWykaaCrdrDz1fMc+2afImUhthYpCWYfmoSmpn4TxoNC4dxo+y8ilBhJJVvg+4Ny 9OBY7QV6ZXPyD6CIlDVgBdmeHQh48Tdbj65DajHm8Gyr8UowAzmaO2N0dueT7J7g3zOF 6H8Gr5B1igVjHeq47CD/Jr6uWfwnGRwiSjAQrxeoy2xqujumPNyipYyLIB936xoHbLeu /XIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Gcu7m0Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id om12-20020a17090b3a8c00b00274274bf0ecsi7603566pjb.61.2023.10.02.03.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 03:36:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Gcu7m0Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8B0028098430; Mon, 2 Oct 2023 02:30:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236111AbjJBJa2 (ORCPT + 99 others); Mon, 2 Oct 2023 05:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236118AbjJBJa1 (ORCPT ); Mon, 2 Oct 2023 05:30:27 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B625A4 for ; Mon, 2 Oct 2023 02:30:22 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A66AB1BF204; Mon, 2 Oct 2023 09:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696239021; 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=1nvcBaLCmY8mO5vCFGklzXqpSCLTGt+OF1cfRa4tU1I=; b=Gcu7m0Pp90GHp77BmLulIh3lxJ0ZsmBaZP25G4W3qzZoxP5zDxpwxd9xrPi9jXYNVEHQHl gs5ksdF8QBLn0dDh7DneFcTXW7sWyJgEvjsDusTLTZLpdY2bIbfiJ/qCO69QGqCnPEnM1X 5v4Zjj2T2t2a1urSFGseCBBWjFk/9JiBLRvr6FC8HksUeu2Fxuj7Xu9eGJD+KVSmqShlqx 9mAy6i19fqNtvGZ/y9RLOKrO2s07JQtVmjQjfUM7c9cTLYzzrVj/wCMHeVcmoAfYh/VF2X O2NlsZbI442Ie1NYSl6+Cnptn2zDykeaCUokAp6Gmm1dSL8uIWXqTWtwZnMH1A== Date: Mon, 2 Oct 2023 11:30:17 +0200 From: Miquel Raynal To: Nikita Shubin Cc: Rouven Czerwinski , Richard Weinberger , Vignesh Raghavendra , Arnd Bergmann , Linus Walleij , Jean Delvare , Neil Armstrong , Christophe Kerello , Chris Packham , Johan Jonker , Daniel Lezcano , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [RFC PATCH] mtd: nand: add support for ts72xx Message-ID: <20231002113017.481aae31@xps-13> In-Reply-To: <8bbe66a23eb5c8a2404b72d754b1bcb6f4d23867.camel@maquefel.me> References: <20230927141532.25525-1-nikita.shubin@maquefel.me> <20230927172947.33106fe2@xps-13> <8bbe66a23eb5c8a2404b72d754b1bcb6f4d23867.camel@maquefel.me> 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-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 02:30:41 -0700 (PDT) Hi Nikita, > ``` > # modprobe technologic-nand-controller > nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1 > nand: Samsung NAND 128MiB 3,3V 8-bit > nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 > Scanning device for bad blocks > Bad eraseblock 137 at 0x000001120000 > Bad eraseblock 310 at 0x0000026c0000 > 3 fixed-partitions partitions found on MTD device 60000000.nand- > controller > Creating 3 MTD partitions on "60000000.nand-controller": > 0x000000000000-0x000000020000 : "TS-BOOTROM" > 0x000000020000-0x000007d20000 : "Linux" > 0x000007d20000-0x000008000000 : "RedBoot" > ``` >=20 > This looks like Samsung K9F1G08U0D or K9F1G08U0B. >=20 > And the patch above totally solves my issues with READCACHE - thank > you! >=20 Great! > > If you are using a Micron chip that specifies not supporting ECC > > correction together with sequential cache reads, then it's a problem > > that we will solve soon (you can hardcode > > chip->controller->supported_op.cont_read to 0); > >=20 > > Otherwise we can discuss it. > > =20 > > > - legacy wait implementation had no delays - only timeout and if i > > > set=20 > > > =C2=A0 readb_poll_timeout() to something reasonable i experience speed > > > degradation=20 > > > =C2=A0 on mtd_speedtest, can it be left as 0 ? =20 > >=20 > > Looks like the legacy implementation used cond_resched(). The delay > > needs to be observed before first checking for the status, it's a > > delay > > that is described in the spec, if you get the status before you might > > just not see a consistent value. I believe that is worth taking into > > account in your implementation below (don't wait then delay, it's > > not relevant). Can you share the values you've tried and the > > performances you've got? =20 >=20 > The numbers are pretty stable, so indeed legacy is a bit faster, > followed up by new one with zero interval. ... > Legacy speedtest (old version of nand controller): > mtd_speedtest: eraseblock write speed is 3793 KiB/s > mtd_speedtest: eraseblock read speed is 3567 KiB/s > mtd_speedtest: page write speed is 3682 KiB/s > mtd_speedtest: page read speed is 3488 KiB/s > mtd_speedtest: 2 page write speed is 3724 KiB/s > mtd_speedtest: 2 page read speed is 3521 KiB/s > mtd_speedtest: erase speed is 198709 KiB/s ... =20 > New version with interval zero: > mtd_speedtest: eraseblock write speed is 3685 KiB/s > mtd_speedtest: eraseblock read speed is 3517 KiB/s > mtd_speedtest: page write speed is 3592 KiB/s > mtd_speedtest: page read speed is 3444 KiB/s > mtd_speedtest: 2 page write speed is 3608 KiB/s > mtd_speedtest: 2 page read speed is 3475 KiB/s > mtd_speedtest: erase speed is 194499 KiB/s Looks almost the same as above, I believe the difference is just noise between measurements. ... > New version with interval 100: > mtd_speedtest: eraseblock write speed is 2722 KiB/s > mtd_speedtest: eraseblock read speed is 2175 KiB/s > mtd_speedtest: page write speed is 2598 KiB/s > mtd_speedtest: page read speed is 2070 KiB/s > mtd_speedtest: 2 page write speed is 2627 KiB/s > mtd_speedtest: 2 page read speed is 2106 KiB/s > mtd_speedtest: erase speed is 175851 KiB/s ... > Also providing version with zero interval and "if (instr->delay_ns)" > dropped - it's optional as far i understood: It's not optional, sorry for the wrong comment, please keep it as it is, knowing that it will be null after a wait_rdy. > mtd_speedtest: eraseblock write speed is 3695 KiB/s > mtd_speedtest: eraseblock read speed is 3532 KiB/s > mtd_speedtest: page write speed is 3593 KiB/s > mtd_speedtest: page read speed is 3457 KiB/s > mtd_speedtest: 2 page write speed is 3640 KiB/s > mtd_speedtest: 2 page read speed is 3488 KiB/s > mtd_speedtest: erase speed is 195451 KiB/s Thanks, Miqu=C3=A8l