From patchwork Sat Jan 30 03:54:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 373798 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2750381jam; Fri, 29 Jan 2021 19:56:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOFef+qln/n7PyQSiW+B81+2de8o1knufz9FIY74djN/a793pNeLSEYU0UXfoWAi7/G/FR X-Received: by 2002:a1c:730f:: with SMTP id d15mr6209260wmb.135.1611978963354; Fri, 29 Jan 2021 19:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611978963; cv=none; d=google.com; s=arc-20160816; b=gW5h5N6zSNGBG5EgBzMnnUe7eQYtNX9AQ3Y4NDrwl4ak7SOouRcKwOHEK4OIYKbxe4 gLZct0mQFKgulq4SAoF1Jf85x1GeMWZI8ZBq6Iqc+GOTXRBAtPfLhGvr40aJPKsNu03n a+k9eb+gs1YVIchQ7n1gU5bn2zN0vwL9IOgRzdBCHdQXTi119MbP3YUI8Yab5LkuTwCT +2YzbvzCBAFMLs28Mpn4fCqgU6hFb7ju0NEvT33R02ei8wJ4fa/APKz9sfrMFYVaPMIA 506bD87p40cd/xW1pn08zXsHeP4ib0Zu1ourjmvC0wC/5JSHSYqFGQ4fgUgk/et0POk+ WWxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=6JN70svoy/4yRlQKmZOOBHvWzSBWTYvMlVh71CSpa5E=; b=CtLouSgSNBj4AYNTwUtzLG0btI2/hChlukXR6QVihojCJwaWmYSlzf6SjKScdmMNOm gGWtcXUzJqlpwaQcw+TBu5wtepnrk+VFcLiSg/YfLa+C2G61jPMQYlKJYo/DKIYxVzhk NdPkPctn7elDV+zP94NVstV/SmGZXbGjdht/AdqyOX3+n6QaY2N9/hgI/veVtNaLfg8C RcVqxhGvIgaTww/tpq+j2MJzifTT4PS/nVhpFwMrfsFZQbZcUcNpLXpK4taAW2eVp+Yv ffOSmE48FPoVisryQWbiQhk1VwUf3EIz5LhCKnCHhBztAnqgIRpLiwI1ZxAFM31RTjeF 1p4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=qlxdb+pV; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QpSOCqCL; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id f22si8822114wml.135.2021.01.29.19.56.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 19:56:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=qlxdb+pV; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QpSOCqCL; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=6JN70svoy/4yRlQKmZOOBHvWzSBWTYvMlVh71CSpa5E=; b=qlxdb+pVW3yY5Mefz2ttoEm7eN x/focqQCCzhLjaQlTYwpd26U5RaiUX2KZRUwmQPSzdrcej3QTMJhDwrDoooU+xEQh0TwlXticbtZp jVVy9DYI+z6Q8CyIDP2d9BqGe4IpLHiHVfGLkL72w8iriQ27NVrK4PfNAi55apCuDwxrljrGU4c2h Xl9gggEZN4YvRmPMj+gA760xmYpwPsOP2zuzU//PAUYN1IN94PLLMPATA3H18ms7N3NcSxXWxviJA ZDurLieLp/5jF7uMdlkDTNG1duqncSWubechlamLF8GGaIdoRPAAkaWKXb6AXLEt26brSMUBOS19R hdWybCdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5hLB-0002p1-16; Sat, 30 Jan 2021 03:54:29 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5hL6-0002oK-NE for linux-mtd@lists.infradead.org; Sat, 30 Jan 2021 03:54:26 +0000 Received: by mail-pl1-x62f.google.com with SMTP id e9so6500930plh.3 for ; Fri, 29 Jan 2021 19:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oHqgS7ucbwBNs/xYikNa19+1cgFYDYneB3HI2cZIiLg=; b=QpSOCqCL06OtJJACvhlnNDSyMt6jGyXnBwTO22QdMm5Nq9s1zYPoQp0p2jRJz5+gbT qb2P7/62Fo440yVavgQPxjjCNbFGZG4VpaJTX1Vu04aP8c6lsrS412CZDypw39ZvfIaz +62HG5L1Qta0MvDf91m7XfbZYc7xpD8oVYrmeBNiUdiQCBfJJObDuwnvc1atDuMd3cRP Vp0yr4dyNWFDw3Ufi5Cf1j3Z10ZHn1z/xIxQPFQdmnS+/X6IeV2aFjYQLem5fXaFh538 XTg6TLmJceKf1XbAJ/Pua6X7jRQB4DKGSBtnIVG2UgjFUZNRn4TtD/4FNs54XhDSX9mv WD9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oHqgS7ucbwBNs/xYikNa19+1cgFYDYneB3HI2cZIiLg=; b=BJvG2lGjld8uzAa4iF8ngvJZfdCstTLr1u/WZMjP6Kpe9N3KCG0kn6ml5YTbwFn8r5 uC0Dn8f/PwqC0XfFd3yD9PnsRBPvKWGGcNeHsVDCfiCpwnhu0xTp+Cw7r5vxH5FBF67b 3hpNmm9kqh41IS8tN6US9yB09iM91/1RpIb1oHPQeL1XHna3tT/H+y4IkzctpFSj880b YrX/WfEzhKGU33d27LCRmgd1gb8JKdWFRMZAoPAaOo2wKSba+eMJFNfsuAJCsvRo2grD /RZZNjT4wb05UrECkIB4UHrca9Mk/9XhtQLLjaSr4WFiZdywtG2NpuLPlOHnCWZLADMp bcDw== X-Gm-Message-State: AOAM5331EtcKIGfOcGSUH2VcpHeL4qpzUUlSzJ4wETr4L8PdKLGZyqjQ nqOapw9dkNKtO49xlfdU7sJKR0MhQWbP X-Received: by 2002:a17:902:bb87:b029:e1:d1f:2736 with SMTP id m7-20020a170902bb87b02900e10d1f2736mr7723660pls.1.1611978860811; Fri, 29 Jan 2021 19:54:20 -0800 (PST) Received: from localhost.localdomain ([103.77.37.140]) by smtp.gmail.com with ESMTPSA id y22sm10309808pfr.163.2021.01.29.19.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 19:54:20 -0800 (PST) From: Manivannan Sadhasivam To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: [PATCH] mtd: rawnand: Do not check for bad block if bbt is unavailable Date: Sat, 30 Jan 2021 09:24:12 +0530 Message-Id: <20210130035412.6456-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210129_225425_069484_DC6D0986 X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: 3.4 (+++) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (3.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62f listed in] [list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [103.77.37.140 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, boris.brezillon@collabora.com, linux-mtd@lists.infradead.org, Manivannan Sadhasivam Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The bbt pointer will be unavailable when NAND_SKIP_BBTSCAN option is set for a NAND chip. The intention is to skip scanning for the bad blocks during boot time. However, the MTD core will call _block_isreserved() and _block_isbad() callbacks unconditionally for the rawnand devices due to the callbacks always present while collecting the ecc stats. The _block_isreserved() callback for rawnand will bail out if bbt pointer is not available. But _block_isbad() will continue without checking for it. So this contradicts with the NAND_SKIP_BBTSCAN option since the bad block check will happen anyways (ie., not much difference between scanning for bad blocks and checking each block for bad ones). Hence, do not check for the bad block if bbt pointer is unavailable. Signed-off-by: Manivannan Sadhasivam --- drivers/mtd/nand/raw/nand_base.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 ______________________________________________________ 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 c33fa1b1847f..f18cd1db79a9 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4286,6 +4286,9 @@ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) int chipnr = (int)(offs >> chip->chip_shift); int ret; + if (!chip->bbt) + return 0; + /* Select the NAND device */ ret = nand_get_device(chip); if (ret)