Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp150005iog; Fri, 17 Jun 2022 00:24:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tV+sHBMzzUp4IgLLiAE3oZ3RMEwO6gH4zFeBpTOSR/6kNnk8iLhK3mmv7/iW2H85disIv0 X-Received: by 2002:a05:6a00:ad0:b0:50a:51b3:1e3d with SMTP id c16-20020a056a000ad000b0050a51b31e3dmr8777798pfl.18.1655450662971; Fri, 17 Jun 2022 00:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655450662; cv=none; d=google.com; s=arc-20160816; b=dVZ9Te1eGyTOQqOUSDPNVTQitQ4jjFMpLh8g5g8RWSlk1mM80nhtkVGwH2iStljv+a edQbcYm6zfswwqwIEoSF4nvHmsE3FDgGrVRSssqWK8yBehX1id/6KjcK6Jbh1nprmfAV I6W7U7q11xwfa5VS5Ttv58gvTCtEG0WXouQ79NJZmV99LrCN/N44RXm8GOSoJ/6Eyw9v vjn1RaspCxwjAYKLUK3oyI2T46fdwgh8iv1q4PgYJHbtxzvJ7+6UFgvQ2W7WQZ3I12Q+ 1Y4b72m7msFNJhfeAMoa+7ZzOjFs88Cb6tY6rmOiA8dR2vaNjwoGzyHCOoyMbszzNakL haMA== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=f8tXznjMvYmeHTU3FtjUVkstIS/LPI1XXnIM1Arfyjk=; b=Q+XpqJFnMbLMpcKJ0hFKvQU0Sv0FsRHeAWuzqDBPvi6dsyCV+Vf6QR2z2d/Ga9jpyN OzcHl/23+4NDwuwH6TdxzEUYsAC0PXuragTuhR1DFGie/5I2Cf70QMW2OOXtjMInTltG 4yBH2u+vSgZ5Popdvvll03jZYBLXOg+sPWFFWeXdoZrila+cMRYoTePI+sG2w1nZLmzo 2c0Ekw2pnmhgxWKC/jqpKQhdtU7sGfZVuFqeb0fYvoaiv7ur/tNN8T4Haq6OQS0B9r9S tAPTajo5VWuH9Y5i75XxCCctQn49uhi3pstXgnWtHFWG10VmDCc101+cKPvGeszdAVDC zvIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="YyzmBzQ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a631850000000b003fc75297698si5004301pgy.36.2022.06.17.00.24.08; Fri, 17 Jun 2022 00:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="YyzmBzQ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380303AbiFQGbq (ORCPT + 99 others); Fri, 17 Jun 2022 02:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380246AbiFQGbh (ORCPT ); Fri, 17 Jun 2022 02:31:37 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 111C85401B; Thu, 16 Jun 2022 23:31:34 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 71BB5C0009; Fri, 17 Jun 2022 06:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1655447492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f8tXznjMvYmeHTU3FtjUVkstIS/LPI1XXnIM1Arfyjk=; b=YyzmBzQ/mA9+hQrDOGXRaXbKPmUqe93b5UpijnHVL+c7TTJLW4oUt6s0cbYFx+E5qboLqa YRZcoNWkMMoGuL/qW0vKk1U+O+XORvj6u1pezHBwYpLYF1EdWsiIg1nSgDnbZMwbxLJ/B6 jSQTRl2eAJGAQVF0JsqN+4Wh7gWV2onmvqAYYCKsgaZsVY6E9wF5DJKSIGNitNOwzWIE44 uhYssYfkgE9KXn7o0z679oXR0RyDo3ylNBlWwCPXyMVabS/EXZM85KJMRfQebSVsxKbXL1 xIv6JeMJThE14HDIhgX2KwHfcysW9Us1RcGw32vmHgC6bpmh4M3mJLApUZUFvg== From: Miquel Raynal To: Christian Marangi , Andy Gross , Bjorn Andersson , Manivannan Sadhasivam , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 2/3] mtd: nand: raw: qcom_nandc: add support for unprotected spare data pages Date: Fri, 17 Jun 2022 08:31:29 +0200 Message-Id: <20220617063129.446718-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616001835.24393-3-ansuelsmth@gmail.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'862bdedd7f4b8aebf00fdb422062e64896e97809' Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-06-16 at 00:18:34 UTC, Christian Marangi wrote: > IPQ8064 nand have special pages where a different layout scheme is used. > These special page are used by boot partition and on reading them > lots of warning are reported about wrong ECC data and if written to > results in broken data and not bootable device. > > The layout scheme used by these special page consist in using 512 bytes > as the codeword size (even for the last codeword) while writing to CFG0 > register. This forces the NAND controller to unprotect the 4 bytes of > spare data. > > Since the kernel is unaware of this different layout for these special > page, it does try to protect the spare data too during read/write and > warn about CRC errors. > > Add support for this by permitting the user to declare these special > pages in dts by declaring offset and size of the partition. The driver > internally will convert these value to nand pages. > > On user read/write the page is checked and if it's a boot page the > correct layout is used. > > Signed-off-by: Christian Marangi > Reviewed-by: Manivannan Sadhasivam Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel