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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 367E7C83000 for ; Wed, 29 Apr 2020 16:09:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 05DBC2072A for ; Wed, 29 Apr 2020 16:09:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gyetR4LY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05DBC2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject: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=6IrxLESb78rxA+fJJ5v2kHgdOhJegH6Y0kBDEU2xpYQ=; b=gyetR4LYMlv+W9 wb+SHj9wYxWi8tM3DD5paZU/Pj/dXAVSancIhJ9DbF0Q6tELIesS7W/T6YkdUrK2X/ec5AiWN1mdo NkVJ2LTgDxjGV8yGwGI03jvIqjs643iaffAZd8yimja5oceXBh9BeiyO4luDUSSvw1LTS5cV9xpZz XBjM3uamb+x+Jo14qB4T4H3RXNCEYwpVGNWRBjhdEfnGdOmcDbQEEzVoKQBdKUN1EjqJCm0EGqMb4 FATeSp/xSnE92Q6Z/ecOnsFJtJPjhVaLSyvzexOgm3WLK5+nR8Lm5Qsx2wcKHHItVy8eiqU0mQLEB C9UpZ3Z/Frp0VGIrPP1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTpHI-0007cT-5s; Wed, 29 Apr 2020 16:09:40 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTpHF-0007bu-Il for linux-mtd@lists.infradead.org; Wed, 29 Apr 2020 16:09:38 +0000 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 3A1A22A2258; Wed, 29 Apr 2020 17:09:36 +0100 (BST) Date: Wed, 29 Apr 2020 18:09:34 +0200 From: Boris Brezillon To: Miquel Raynal Subject: Re: [PATCH v2 07/11] mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers Message-ID: <20200429180934.6a11c888@collabora.com> In-Reply-To: <20200429155540.22048-8-miquel.raynal@bootlin.com> References: <20200429155540.22048-1-miquel.raynal@bootlin.com> <20200429155540.22048-8-miquel.raynal@bootlin.com> Organization: Collabora X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200429_090937_746771_602B5AC1 X-CRM114-Status: GOOD ( 22.59 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Simek , Vignesh Raghavendra , Tudor Ambarus , Richard Weinberger , linux-mtd@lists.infradead.org, Thomas Petazzoni , Naga Sureshkumar Relli Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Wed, 29 Apr 2020 17:55:36 +0200 Miquel Raynal wrote: > We already know that there are controllers not able to read the three > copies of the parameter page in one go. The workaround was to first > request the controller to assert command and address cycles on the > NAND bus to trigger a parameter page read, and then do a read > operation for each page. > > But there are also controllers which are not able to split the > parameter page read between the command/address cycles and the actual > data operation. > > All controllers are expected to be able to change the read column > though. So let's use a regular parameter page read operation for the > first iteration and use a change read column operation for the > following copies. > > The extra command and address cycles sent over the NAND bus are > negligible compared to the amount of data that is being transferred > anyway. > > Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon > --- > drivers/mtd/nand/raw/nand_onfi.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c > index ee0f2c2549c1..19e1be94c7e3 100644 > --- a/drivers/mtd/nand/raw/nand_onfi.c > +++ b/drivers/mtd/nand/raw/nand_onfi.c > @@ -160,14 +160,14 @@ int nand_onfi_detect(struct nand_chip *chip) > if (!pbuf) > return -ENOMEM; > > - ret = nand_read_param_page_op(chip, 0, NULL, 0); > - if (ret) { > - ret = 0; > - goto free_onfi_param_page; > - } > - > for (i = 0; i < ONFI_PARAM_PAGES; i++) { > - ret = nand_read_data_op(chip, &pbuf[i], sizeof(*pbuf), true); > + if (!i) > + ret = nand_read_param_page_op(chip, 0, &pbuf[i], > + sizeof(*pbuf)); > + else > + ret = nand_change_read_column_op(chip, sizeof(*pbuf) * i, > + &pbuf[i], sizeof(*pbuf), > + true); > if (ret) { > ret = 0; > goto free_onfi_param_page; ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/