Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp99540pxb; Mon, 16 Aug 2021 00:32:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb92bT+iA5rcil+VFEwU2xQrFJeT7Msb8hpEfH4bMbldKLR40qDzdlEbovxPlc4JHRJwMM X-Received: by 2002:a92:194c:: with SMTP id e12mr10287981ilm.199.1629099147018; Mon, 16 Aug 2021 00:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629099147; cv=none; d=google.com; s=arc-20160816; b=s8P90XgShcv894+I/Z58YehkKr1XaeuMt1YUrbnHCSGjkkA8rifE3nUuh3GzY6gV+d bvtOda3dmvy7HlL7oshCzgHZWBL2OELxxvpmlyeD7JS60cNHVK+tMzW9aeJ/4EpZiGRB Lx1Q2Ct8GuVNNbGpx6m152h8PoW41MO2fxnZX0ygY2AZWw48KzLgGJx7OUpRvk5rDonY gEi6tG/brNR5YatUIsFAarGrJPamQSuUYKSfQ386FFog6AoTm9AYXlBSMSmavLJIkVxW 8budFkTnHwOv169J6uMdcmsPzNvhiuK78TEdyt4v6IDm/3fVf8+G9B6e7JFaCWC88d8l FV/w== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=yFXjUKSSXhsD+g810P+KflJB0NR9MWsITjmLCjvTugM=; b=Uy0m1+iOmbIm3RLmEr84UKlTrkTcm5bWE6N9/r4YSCepyLKh4wFUpmKCYRty6ibHrk bZLCNpVf+bQuYtqQuldsoAqVD+cfZclPKH/aLJbSncmv3BqcQaIm9tB88oCTlCfGlTTj WDbn5puZSJWjnjfxcYBY4y1lEKJuUqlvVj2x8vaLK3Gna80iW8vrt+MmhAyDUk5X+QqD gBtu0dfR9sH3uIn8YkLXI4P9l7i9rIOXsNQbuvSeY286UNkolQ1J/ad8D+9PAgN5M+bM rHG24ffa527oEiXb/PJunPhd9f959udm+WebRuEOqAylKeS2KoZkEM0RjPUMchn7cnZD kw4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si11775932ile.87.2021.08.16.00.32.16; Mon, 16 Aug 2021 00:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234060AbhHPHcB convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Aug 2021 03:32:01 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35503 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233906AbhHPHcA (ORCPT ); Mon, 16 Aug 2021 03:32:00 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 8CE7540002; Mon, 16 Aug 2021 07:31:27 +0000 (UTC) Date: Mon, 16 Aug 2021 09:31:26 +0200 From: Miquel Raynal To: Daniel Kestrel Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mtd: rawnand: xway: No hardcoded ECC engine, use device tree setting Message-ID: <20210816093126.442f74a1@xps13> In-Reply-To: <20210808072643.GA5084@ubuntu> References: <20210808072643.GA5084@ubuntu> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Daniel Kestrel wrote on Sun, 8 Aug 2021 09:26:43 +0200: > Some devices use Micron NAND chips, which use on-die ECC. The hardcoded > setting of NAND_ECC_ENGINE_TYPE_SOFT makes them unusable, because the > software ECC on top of the hardware ECC produces errors for every read > and write access, not to mention that booting does not work, because > the boot loader uses the correct ECC when trying to load the kernel > and stops loading on severe ECC errors. > This patch requires the devices that currently work with the hard coded > setting to set the nand-ecc-mode property to soft in their device > tree. > Please add a Fixes: and Cc: stable tags, you will also need to send to stable@vger.kernel.org a different version of the patch for the kernel 5.4 IIUC. > Signed-off-by: Daniel Kestrel > Tested-by: Aleksander Jan Bajkowski # tested on BT Home Hub 5A > --- > drivers/mtd/nand/raw/xway_nand.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/xway_nand.c b/drivers/mtd/nand/raw/xway_nand.c > index 26751976e502..0a4b0aa7dd4c 100644 > --- a/drivers/mtd/nand/raw/xway_nand.c > +++ b/drivers/mtd/nand/raw/xway_nand.c > @@ -148,8 +148,6 @@ static void xway_write_buf(struct nand_chip *chip, const u_char *buf, int len) > > static int xway_attach_chip(struct nand_chip *chip) > { > - chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT; > - > if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN) > chip->ecc.algo = NAND_ECC_ALGO_HAMMING; You also need to only set the Hamming algorithm when engine_type is TYPE_SOFT. Thanks, Miquèl