From patchwork Mon Mar 4 22:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10838785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C37D922 for ; Mon, 4 Mar 2019 23:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 357FD2B80E for ; Mon, 4 Mar 2019 23:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2993A2B819; Mon, 4 Mar 2019 23:11:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C88022B80E for ; Mon, 4 Mar 2019 23:11:33 +0000 (UTC) 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YpNj5STAJLgQaoXjy27FafcLSGsXMBQMXb9LznoQAoU=; b=H3n36X7YULG8+j 4k/sMrDi2kxNXQqYWtX8iGqglq7UJhDzS4ugY2lDdh5z+QQ3+OTR7b75G5wDj1wMuGY6L8Eo34f8x k63kR+bCR0AMx3cp2YN2d3HI26KIEDQ5iXRPpQYVcjCVKWVX2eIfUeaSLgLnkGYZT1ZyxD1VVc4Yr RfVyAqkVSN4rnwmNiVDj/fa1n1OVGtceW2pLEEtyz8f3N4oJQsj3sLByWh/MzomQD9HUGKQ/T2daf NpqzJ95SxKedTLmwsRIOCU8rdYpIXt7LFe1sDNbT4PQnryqP8Bh9yu33LX1ZnW9JEDLICDOS5JCDt QDfcrR75wa1N7lgfDNvA==; 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 1h0wk5-000878-MD; Mon, 04 Mar 2019 23:11:29 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0wjS-0007DE-GX; Mon, 04 Mar 2019 23:10:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=paHqY1gVLmb3fF/WCr7pektdHu8zbKhb5DDQjcsSYHY=; b=Z6DvBcT9u7cNynX2tv1nmKwwOq g/PLv0y4MkswbrZUKqona90OtV34Un93sEGaKxUCt07nCqtGSxWGUTMOLUuaSNJJ82+5JPhEMEI1+ 0NMsVUJEPBQDHAxd6jwXRrKlhLxKhJRzUEbvlvWQNlf3m9uME9FLqnwPGktK29taUAd0qX1vZVSVE VkHUSorIw5j8SnILxcXcVX7F9VD3EcAQFtUPv+Ecrp7MKuShhDuWxiNUHE6iOPOMninZCzSvcueTD KRuTtlfd/LMgxFbW8lGSirGC/XT3HwBODMP2oSrPzsvTdXpRvbFtbwUC5DmeHTKmj/3o5x4RU6VH1 /rhltdRg==; Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0w7p-0001Eu-UX; Mon, 04 Mar 2019 22:31:58 +0000 X-Originating-IP: 90.5.42.199 Received: from localhost.localdomain (atoulouse-657-1-1088-199.w90-5.abo.wanadoo.fr [90.5.42.199]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C51C0240009; Mon, 4 Mar 2019 22:31:31 +0000 (UTC) From: Miquel Raynal To: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Tudor Ambarus Subject: [PATCH v2 32/36] mtd: rawnand: Fill a default ECC provider/algorithm Date: Mon, 4 Mar 2019 23:28:37 +0100 Message-Id: <20190304222841.13899-33-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190304222841.13899-1-miquel.raynal@bootlin.com> References: <20190304222841.13899-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_173158_133995_77370C11 X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh R , Tudor Ambarus , Julien Su , Schrempf Frieder , Paul Cercueil , linux-mtd@lists.infradead.org, Thomas Petazzoni , Miquel Raynal , Mason Yang , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The raw NAND layer may want to use one or another ECC provider if the user did not explicitly broadcasted his choice through the DT. Raw NAND controllers can also want to force these values. In any case, the NAND core must be able to know their preference and this works by letting subsystems/drivers filling/changing the "defaults" ECC structure. Signed-off-by: Miquel Raynal --- drivers/mtd/nand/raw/nand_base.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 3149af72f519..f4b9374a8729 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5596,6 +5596,13 @@ static int nand_scan_tail(struct nand_chip *chip) break; } + /* + * If there is no specific user request for the ECC engine provider, use + * the one chosen by the driver being instantiated. + */ + chip->base.ecc.defaults.provider = ecc->mode; + chip->base.ecc.defaults.algo = ecc->algo; + ret = nanddev_init(&chip->base, &rawnand_ops, mtd->owner); if (ret) goto err_nand_manuf_cleanup;