From patchwork Tue May 26 18:52:26 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: 225296 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=unavailable 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 18FFDC433DF for ; Tue, 26 May 2020 19:21:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED3DE20776 for ; Tue, 26 May 2020 19:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520886; bh=5dYKczIvQ+iFI127IXOGGHsWU0/YsZaZeXftt1nV9sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dvKXW5yIVZDz+L7bm8YlYrvsNYBXRltQNf15AP5AQlF7pH/RdBp2t9E9pxuVXig/E DncrOMOCpRcj5yTfjZTCBESJQeSid2vPs1LBfE/ruSy9d5c4xA1CAYQINx6PlA/bqE r6ARRr5EDeXFrsIoHQD2jm1NJI2aLkUzuMX4hu2Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391976AbgEZTLy (ORCPT ); Tue, 26 May 2020 15:11:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391316AbgEZTLv (ORCPT ); Tue, 26 May 2020 15:11:51 -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 9216C20888; Tue, 26 May 2020 19:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520311; bh=5dYKczIvQ+iFI127IXOGGHsWU0/YsZaZeXftt1nV9sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D39f1VCS3kTRdOqZnNWknwJlxU3aZY2aweunWm+EtVrUPWjWYB4yXDqNcwhr+RUtd PUpb2Lfk+H1jID3LS2EfymYbbawEivkWCJ246aC0SyUPr4jugmEczO+afQ2bBd6kqN onaUAmvk5mwskfStdKPxR2WRQ5BJITAL0eH/P7J0= 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 5.6 009/126] mtd: spinand: Propagate ECC information to the MTD structure Date: Tue, 26 May 2020 20:52:26 +0200 Message-Id: <20200526183938.309643594@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183937.471379031@linuxfoundation.org> References: <20200526183937.471379031@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 8dda51bbdd11..0d21c68bfe24 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1049,6 +1049,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: