From patchwork Tue May 26 18:52:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E003FC433E1 for ; Tue, 26 May 2020 19:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBD8120849 for ; Tue, 26 May 2020 19:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590519899; bh=fQ0DWWGOqMI2LHCgElUKESIoUuz8FVVSSn09zsHcakU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HGo929QSpZuUTT3xsQhwYusfWioIFYio6TAr0M6RX+v/tOdvqCicDV3dpC49gizw5 47rAGZgsS4KOrckzsMwAW6cH+njLPJFank9ifDo5G1WQkeG1H6/tWGXMcjRDgAgiw0 OMqN9K09OrSjGRtTz/iot0Yl0y7xbcDpPM1B1H1M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390537AbgEZTE6 (ORCPT ); Tue, 26 May 2020 15:04:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391440AbgEZTE6 (ORCPT ); Tue, 26 May 2020 15:04:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7AE7920776; Tue, 26 May 2020 19:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590519897; bh=fQ0DWWGOqMI2LHCgElUKESIoUuz8FVVSSn09zsHcakU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zby7Ct47lAZWYr028qjFEEMk+rLy4ADnOrxl7xZNTf2Byg1k/lgUOWfZc8AWEIofi P+65YofK2Ls5fUpE+FVKZLvFvpFocPmRvbd0hunt8d8PaxlNaGKPq4cYLs2bEDZIwU 7X4v6X1F8QrH0yT5UCvKA08Ticts9tERDJkupeoM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Boris Brezillon , Richard Weinberger , Sasha Levin Subject: [PATCH 4.19 09/81] mtd: spinand: Propagate ECC information to the MTD structure Date: Tue, 26 May 2020 20:52:44 +0200 Message-Id: <20200526183926.164686852@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183923.108515292@linuxfoundation.org> References: <20200526183923.108515292@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Miquel Raynal [ Upstream commit 3507273d5a4d3c2e46f9d3f9ed9449805f5dff07 ] This is done by default in the raw NAND core (nand_base.c) but was missing in the SPI-NAND core. Without these two lines the ecc_strength and ecc_step_size values are not exported to the user through sysfs. Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- drivers/mtd/nand/spi/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index a2f38b3b9776..1d61ae7aaa66 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1045,6 +1045,10 @@ static int spinand_init(struct spinand_device *spinand) mtd->oobavail = ret; + /* Propagate ECC information to mtd_info */ + mtd->ecc_strength = nand->eccreq.strength; + mtd->ecc_step_size = nand->eccreq.step_size; + return 0; err_cleanup_nanddev: