Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1270157rdb; Wed, 24 Jan 2024 09:42:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYO9xm9v9vYqqPojPfp/0UAPhzYzS4USEoSlV5tTs7cUg69kPiQYoImpa8280N7nfDVU83 X-Received: by 2002:a17:906:3613:b0:a2e:d377:a9d3 with SMTP id q19-20020a170906361300b00a2ed377a9d3mr1200623ejb.59.1706118154941; Wed, 24 Jan 2024 09:42:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706118154; cv=pass; d=google.com; s=arc-20160816; b=aCtUi2ycmNn6+xS4vNnlJMJv09veEvvNab+S+zS/gESwY4bD7aqmDOivLuPRBAht3H 1ZvVok3UseguRuApqTFUJxprvmSKEJGgjJmK68u1oCUN7++qt8Nr/VYXBoU/HlIvjciH RCLWNjlTAoJC5Wk/feLc1M9zCLg+yLCF4QRkDG4u9zu7qIE7T5EF9TzMdxtkMrFyonLn 5oAkd0S5RK9Vwkrtdnlr4H3b/H6aYFKjrdtEiHHPPCITBhXSgGF0nKu0HUEXa+NNQ5oX nt9Ot+g78Plva+/fmcmvUFt2M6qKO59NdCvw+Fe1gxPut8JcOnjXz9pFTg5V9N2WKrsM S7LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=+9fxvXwre8RvANs3toNyR8cUFT2cBUQEnb6nLZSDgnE=; fh=gLt+cnykpILK4YTA66t+9s3HhcQrFf/tI2cYSjWPBuA=; b=pqtiKan6ker1i4cpxjm53ifhUU+1tjegy+lYeQNgVz0otBjTjwxbNcFXeikUt2Z02i ss4DtiPloybVwQoEG7vRiJN/27kMbMn6qUlj2qCd9zses2p/e1jO0H7RLwoXRs8BD9pP HInHFRAqvj/48BFiOI5sh6YD714TWY5DBNTCa4J6yDc8yCOlhFs3okydr55dbZqYbWWW T13BQvbUQEOJpgK6zGWqkwkXPD/cyR3NvCRSJA5ICIsHe6Z/lzuoPwLHzRdneLH+zAn5 drcF4DgsEEURRCdn0Ftlwwr81r15M4rysUU5IFANum6craP/QWYOBDAToic4dHX2ytCd EyJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GTartNSV; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-37450-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37450-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z20-20020a1709060ad400b00a2c5ea13b34si85959ejf.1050.2024.01.24.09.42.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:42:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37450-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GTartNSV; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-37450-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37450-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D44B91F226CE for ; Wed, 24 Jan 2024 17:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB61981AA5; Wed, 24 Jan 2024 17:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GTartNSV" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E886C86129; Wed, 24 Jan 2024 17:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706118035; cv=none; b=PCwAaIPuGKsMghXVKZuugIwvJusiwcM7jYsC2jX5BSaiXxo1fJZzxpr9jb5xbPymmodsE32LQ1a5bRsxixOayFb/rE7oZUkitVmmeWO5tbOiDU1FZkHp7+JHw18gcMYsdxS6LkH32K++PQa3qr2y9T/a+9qYJeCrs/Vj7MdovrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706118035; c=relaxed/simple; bh=8gQF0U6eHH6iUkLw6yhHPNLgdvAzk3OMbv/DK+aIbko=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fTHisE8fRoTsZnE1tO5SypMqEqWyQIFGLZKA9C0gQaUQUcplwTuJg/WvRjRt8qJr5NuOIDhhyPQGDe2MdQUN3YL/u7j+LuifJ0VUVL//4uSO/ymPwkt1oUqly99VLxvIggTUk2gJNEFa4IAh21k4XLWE3EsO5nVC5g8Xvk/9Fmc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GTartNSV; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id DCF851BF20E; Wed, 24 Jan 2024 17:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706118030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9fxvXwre8RvANs3toNyR8cUFT2cBUQEnb6nLZSDgnE=; b=GTartNSV42U1nllXnMMP3aHwlGI/uQS1npcEBCAhl82CqzmhpWZyy0umHbMQZvndvILcei +MzcRQdSS1m/SffVGt+DBHi1UneiynjaI+ZoON+wxOloCR1MWHkivqQcex1aGBj2A4otll BKR/wB/kNds+aHS8FpUH6HuTLci1NVg33cDOFWLZV+H+RaIadaxRap2pgvkPlgtMunlB6r pCCb/fPnrzaV1a6Iz7PjlF9c0IXZ7Xr8iup3NuWDjy6TqJ1akkpsAuYCEc2DbHQdrTmdhI v9okB9VMwgbEDboKsfT0uyjTvjB7gPsEWBA7obVIB1ACu54CKMnVzexPyged5g== Date: Wed, 24 Jan 2024 18:40:27 +0100 From: Miquel Raynal To: David Regan Cc: dregan@mail.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, computersforpeace@gmail.com, kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, florian.fainelli@broadcom.com, rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com, baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org, dan.carpenter@linaro.org Subject: Re: [PATCH v3 10/10] mtd: rawnand: brcmnand: allow for on-die ecc Message-ID: <20240124184027.712b1e47@xps-13> In-Reply-To: <20240124030458.98408-11-dregan@broadcom.com> References: <20240124030458.98408-1-dregan@broadcom.com> <20240124030458.98408-11-dregan@broadcom.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi David, dregan@broadcom.com wrote on Tue, 23 Jan 2024 19:04:58 -0800: > Allow settings for on-die ecc such that if on-die ECC is selected > don't error out but require ECC strap setting of zero >=20 > Signed-off-by: David Regan > Reviewed-by: William Zhang > --- > Changes in v3: None > --- > Changes in v2: > - Added to patch series > --- > drivers/mtd/nand/raw/brcmnand/brcmnand.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/= raw/brcmnand/brcmnand.c > index a4e311b6798c..42526f3250c9 100644 > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c > @@ -2727,9 +2727,11 @@ static int brcmnand_setup_dev(struct brcmnand_host= *host) > cfg->blk_adr_bytes =3D get_blk_adr_bytes(mtd->size, mtd->writesize); > =20 > if (chip->ecc.engine_type !=3D NAND_ECC_ENGINE_TYPE_ON_HOST) { > - dev_err(ctrl->dev, "only HW ECC supported; selected: %d\n", > - chip->ecc.engine_type); > - return -EINVAL; > + if (chip->ecc.strength) { > + dev_err(ctrl->dev, "ERROR!!! HW ECC must be set to zero for non-hardw= are ECC; selected: %d\n", > + chip->ecc.strength); Can you use a more formal string? Also clarify it because I don't really understand what it leads to. > + return -EINVAL; > + } > } > =20 > if (chip->ecc.algo =3D=3D NAND_ECC_ALGO_UNKNOWN) { > @@ -2797,7 +2799,11 @@ static int brcmnand_setup_dev(struct brcmnand_host= *host) > if (ret) > return ret; > =20 > - brcmnand_set_ecc_enabled(host, 1); > + if (chip->ecc.engine_type =3D=3D NAND_ECC_ENGINE_TYPE_ON_DIE) { > + dev_dbg(ctrl->dev, "Disable HW ECC for on-die ECC\n"); Not needed. > + brcmnand_set_ecc_enabled(host, 0); > + } else > + brcmnand_set_ecc_enabled(host, 1); Style is wrong, but otherwise I think ECC should be kept disabled while not in active use, so I am a bit surprised by this line. > =20 > brcmnand_print_cfg(host, msg, cfg); > dev_info(ctrl->dev, "detected %s\n", msg); Thanks, Miqu=C3=A8l