From patchwork Thu Feb 7 09:57:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 157685 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp435848jaa; Thu, 7 Feb 2019 01:58:34 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia7AY1MbVWdzucYXu3yZ8EAneKKx/oWDHDVxOgecu5Xrsz7RRTf8eCKCNzoKDSWvcu5kkxm X-Received: by 2002:a63:cf56:: with SMTP id b22mr14115596pgj.376.1549533514231; Thu, 07 Feb 2019 01:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549533514; cv=none; d=google.com; s=arc-20160816; b=su4TnP462rvteFa3ABllHcogwfcsYoeMO+JxRA0vm7rqz8U5YsqX3a/dLmIdr9OvE4 vqUNds086R4RjKbgJPTnf6TlJViBbwrsQm3t3f3xjv0OfPBm4Dyz3hiWX87V6q6Cws8Q ijnz686kC3LnsClq68FdqzSKkpzRYKb66YncUpb4xjc9Js2u32lIjyyPQ5jDyQt3fUzJ CAWsJEBCiWYKy18iu7GrnU5FR98IRZiLk3Rj822b6Z9NYTBJKabqx8FE5m6B+oBWjVyh ha4O1dfScsG5cSQL6YuiUp05SKGxMoeqXcwnkUZ+I2R5x/lJaccM44RDuxfME5ZEglZp knKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter:dkim-signature; bh=vfGNJAjEtSswSLz/xX8qHJ2SFGoqhGxT+YHLxTRj8Oo=; b=OSES1ZFtaZayQ9j2RlaJF8W1rjuFJ5jGP3bmLP7av8K7A+mt1UzUsZ5Uxy2Dv4dbrS nWFV7TUF0FOIMuhDf/jc4Q4fRwJ/2+QLjLPJW6QQ7Uz1bMgW0tXiL7fY8NjW+K6uifdx DVyJjHTIASs1JcEPm/0n8F5cV1xZ5aWjU4kBV+PManmDdGv9g0j0C7m2sHtZSLWyOLTq 9UUiaJnOQHnf6snphatrywgGO11PZ/BCHdt0sZmc970Jq3I7KPaYhKX1FzVKoAOhkOxE xvSmvKGMZTNHBoU63OJJctv2sMWMQF+j4Q5sYnzXGq/iE1cyzjm2VOhunApA56ZP250x Srvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=XhYKLdvh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BoFeItFZ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 133si8921708pfw.64.2019.02.07.01.58.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 01:58:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=XhYKLdvh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BoFeItFZ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=vfGNJAjEtSswSLz/xX8qHJ2SFGoqhGxT+YHLxTRj8Oo=; b=XhY KLdvhFet+HVG+zU4WXMs3MDqw8S3I57QzDoFKYTqiXY9B0TFsemhnDp0P+lnlj49aK5+akVXGUgMx bx1UJwTeVSWUUMBv9nSOj2GNHp0SPryd9i84R+qtwkfo9XbqvM+vcJZfjBoX4bi4yHRUIhLqfuIr+ 6vBHN1zO5IYTpSP1ILFTBkwgeTPop2R+2AHNnH3fwRLO8xj8ge8TSl++fIVsGiP1iDLhmE1bLB51l fTPsxHRXCsLyOLz/GP0rsQOrMRcWZZvTQ+1/3V63EVnfEkzroKHne3GA/gxBaP2iHWt58Cqu/ouyG Nv4x9fDXADkc7SGtv0HrIgd/vUqayeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgRq-00042O-KA; Thu, 07 Feb 2019 09:58:22 +0000 Received: from conuserg-10.nifty.com ([210.131.2.77]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgRm-00041W-7W for linux-mtd@lists.infradead.org; Thu, 07 Feb 2019 09:58:20 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x179vwEV007618; Thu, 7 Feb 2019 18:57:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x179vwEV007618 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1549533479; bh=iw6uQDkF1w+n1nuxwJnEKZ11rxlAfTizSmtetXPuvzE=; h=From:To:Cc:Subject:Date:From; b=BoFeItFZaWOYa+ARb66rUQVHzlgBVIkJe69Q1SVtImEfpDPJKKDp2BNu0jEo3Gpq/ qwch6dfKYrzbw2ZTWMPeQQAFdNpFot13waP4cMHsFz/pueGID3mok/VTMEVGnLgLIb IvqF9dYqylY0V4tWjEb6xwzWQFYOl+GxH5kc2FjUHGBfrnJDnTIkxYWrA4TTALbOt3 FOhPLiY2cOs7L4xK3t7d6xh7e2eUVjCRqEWxLWi7H/XtYWbMXHS4N/1ODxdNAXR47M MqlnAc2rwWJo9tsG0M3kai+8Dhv+iXlGalKcHiXG9PiS1IADQs7T+gYrrrkt5ZvtGQ z1r2zVPOVCvxw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon , Miquel Raynal Subject: [PATCH] mtd: rawnand: call onfi_fill_data_interface() once again after nand_detect Date: Thu, 7 Feb 2019 18:57:56 +0900 Message-Id: <1549533476-3742-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_015818_617703_1427F1C3 X-CRM114-Status: GOOD ( 10.24 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.131.2.77 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Richard Weinberger , Boris Brezillon , linux-kernel@vger.kernel.org, Masahiro Yamada , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org nand_scan_ident() calls onfi_fill_data_interface() at its entry to set up the initial timing parameters. The timing parameters are needed not only for ->setup_data_interface(), but also for giving the correct delay to NAND_OP_WAIT_RDY, for example. If the driver sets the NAND_KEEP_TIMINGS flag, or does not support ->setup_data_interface() hook, those parameters will never updated. Before nand_detect(), we never know whether the chip is ONFi or not. So, onfi_fill_data_interface() has to assume the worst case, i.e. non-ONFi. After nand_detect(), if the chip turns out to be ONFi-compliant, we can optimize tPROG_max, tBERS_max, etc. Call onfi_fill_data_interface() once again. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/raw/nand_base.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 9b3d7ff..35e543c 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5040,6 +5040,9 @@ static int nand_scan_ident(struct nand_chip *chip, unsigned int maxchips, nand_deselect_target(chip); + /* If the chip turns out ONFi, we can optimize timing parameters. */ + onfi_fill_data_interface(chip, NAND_SDR_IFACE, 0); + /* Check for a chip array */ for (i = 1; i < maxchips; i++) { u8 id[2];