Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1263441imm; Sun, 27 May 2018 02:27:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqn7NyASXNdc7CmR8e9SZezWd7lt1rKanJa9zDvLBuankQYn5qezKTaqtIBUvlTuKZdL0P5 X-Received: by 2002:a65:61c8:: with SMTP id j8-v6mr7145202pgv.370.1527413261600; Sun, 27 May 2018 02:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527413261; cv=none; d=google.com; s=arc-20160816; b=NqxvcskqJLVFWrqLylyXUbLjuMxbrFndEXRGSWJKnIZFDSbXVQtEc4TkvnDNj1nWLB 3pAeVKfVnDlA3dMravR0tmeomh8FGBYO5qJ0ySsrlv0eI0nuSB+QLDqn2CKEvDHBjZ9y ZuDLn7Cx6t1X6mNAPI76co+8lBbUsdiXuXEpt/zMXKfGF/MFu/vNXoHhDZGovZZYvy3E uxvn2mCkVi6M+ddHDrPT6L1ntqV5AL92Iein5sYoQuXJtvSJDpxhNQL9dflGpjwATo6d 4/0BrITT9ed3huGgvIbi4LYSYUvGUjQWzQlI85d1J1Eixrgt7fo15gs0dJhejWrBe5KX kzqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=6ErVC2o/eIvMj+/dixU+wrt+QPXGuRc/2TaxMkUmYiQ=; b=b6c+xxD6Kycby1O8T9uJRDZKJagk9kRwcOeH+mHJGHHAGwE+dV7q43HGsUQ+qnkcA6 mFkqFJ2iTglVX48KMFVbxoHdFaHL5O/V+HiK4tAM7z4T70XrXna23e/kOUYygNCpIk+S L23g0XY6mFrxcEm11GxXZjdFxVvOaJPDhOoVcnOLC3nSb3kTKLlrLss702C6fBbtlBCm zhYRLEusu+wVpsLbsSE4B9xjzOHhRwKdF3UVaP4yaKFbSWVFJFYjtBQeyOPwxHDMcj+Z rImoSTZU+5TNsL6QQMKqqEeih4tbXo1KAYyVOPm74X1xSYsEHh9spZR4W/0pUcpPazpD vplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=j3gTczPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4-v6si28602681pff.24.2018.05.27.02.27.24; Sun, 27 May 2018 02:27:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=j3gTczPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936342AbeE0J1P (ORCPT + 99 others); Sun, 27 May 2018 05:27:15 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:22497 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934567AbeE0J1N (ORCPT ); Sun, 27 May 2018 05:27:13 -0400 Received: from mail-vk0-f50.google.com (mail-vk0-f50.google.com [209.85.213.50]) (authenticated) by conssluserg-02.nifty.com with ESMTP id w4R9Qx6Q001953; Sun, 27 May 2018 18:27:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com w4R9Qx6Q001953 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527413220; bh=6ErVC2o/eIvMj+/dixU+wrt+QPXGuRc/2TaxMkUmYiQ=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=j3gTczPj4IUM5mxqdzMcTNmuoa8VRuic8ANXmQFWux8YVUJMRFCLVQ0CwKDhH3mb3 kLQnC5YPdDbBq2vF/HiR3cS+1diXyDFZ6rBnxwkjzsEIBzi10YX7obXm3A9ljpTwJR uCuzOxg+JBqw2ivx0AUmmZX3nRt7ibfoG9EJsS3r2fN5cbQGG+DQVgoj/st5oTmHG+ 7jnk0mC1O0UP/sFNPbcGFkSglLWope4mLhKTN95XRNwfQU0qDu7NDuijEt29ab45Gh 0pQEIiPwvX44taQhcmAP1cRciQv8nXN0Ixgr55m677/AsTZkVcuFsI/cv+iitfDaex M3+oVLlTr7t2g== X-Nifty-SrcIP: [209.85.213.50] Received: by mail-vk0-f50.google.com with SMTP id i190-v6so5511201vkd.13; Sun, 27 May 2018 02:27:00 -0700 (PDT) X-Gm-Message-State: ALKqPwcqxb7a3pxRVPD902+ky/234ewOiczkkq/xYZiEzSMMhSkBKCL4 ovrE7VO458mGqVWihpgH0HsVu4BCnN8CLSyyIGo= X-Received: by 2002:a1f:a991:: with SMTP id s139-v6mr5581510vke.54.1527413219194; Sun, 27 May 2018 02:26:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:55d8:0:0:0:0:0 with HTTP; Sun, 27 May 2018 02:26:18 -0700 (PDT) In-Reply-To: <1527250904-21988-3-git-send-email-absahu@codeaurora.org> References: <1527250904-21988-1-git-send-email-absahu@codeaurora.org> <1527250904-21988-3-git-send-email-absahu@codeaurora.org> From: Masahiro Yamada Date: Sun, 27 May 2018 18:26:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/16] mtd: rawnand: denali: use helper function for ecc setup To: Abhishek Sahu Cc: Boris Brezillon , Archit Taneja , Richard Weinberger , linux-arm-msm , Miquel Raynal , Linux Kernel Mailing List , Marek Vasut , linux-mtd , Cyrille Pitchen , Andy Gross , Brian Norris , David Woodhouse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-25 21:21 GMT+09:00 Abhishek Sahu : > Use the NAND core helper function nand_ecc_choose_conf to tune > the ECC parameters instead of the function locally defined. > > CC: Masahiro Yamada You can replace the CC with my Acked-by: Masahiro Yamada > Acked-by: Miquel Raynal > Signed-off-by: Abhishek Sahu > --- > * Changes from v2: > > 1. Changed commit message > > * Changes from v1: > NEW PATCH > > drivers/mtd/nand/raw/denali.c | 30 ++---------------------------- > 1 file changed, 2 insertions(+), 28 deletions(-) > > diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c > index 2a302a1..a586a1d 100644 > --- a/drivers/mtd/nand/raw/denali.c > +++ b/drivers/mtd/nand/raw/denali.c > @@ -1120,33 +1120,6 @@ int denali_calc_ecc_bytes(int step_size, int strength) > } > EXPORT_SYMBOL(denali_calc_ecc_bytes); > > -static int denali_ecc_setup(struct mtd_info *mtd, struct nand_chip *chip, > - struct denali_nand_info *denali) > -{ > - int oobavail = mtd->oobsize - denali->oob_skip_bytes; > - int ret; > - > - /* > - * If .size and .strength are already set (usually by DT), > - * check if they are supported by this controller. > - */ > - if (chip->ecc.size && chip->ecc.strength) > - return nand_check_ecc_caps(chip, denali->ecc_caps, oobavail); > - > - /* > - * We want .size and .strength closest to the chip's requirement > - * unless NAND_ECC_MAXIMIZE is requested. > - */ > - if (!(chip->ecc.options & NAND_ECC_MAXIMIZE)) { > - ret = nand_match_ecc_req(chip, denali->ecc_caps, oobavail); > - if (!ret) > - return 0; > - } > - > - /* Max ECC strength is the last thing we can do */ > - return nand_maximize_ecc(chip, denali->ecc_caps, oobavail); > -} > - > static int denali_ooblayout_ecc(struct mtd_info *mtd, int section, > struct mtd_oob_region *oobregion) > { > @@ -1317,7 +1290,8 @@ int denali_init(struct denali_nand_info *denali) > chip->ecc.mode = NAND_ECC_HW_SYNDROME; > chip->options |= NAND_NO_SUBPAGE_WRITE; > > - ret = denali_ecc_setup(mtd, chip, denali); > + ret = nand_ecc_choose_conf(chip, denali->ecc_caps, > + mtd->oobsize - denali->oob_skip_bytes); > if (ret) { > dev_err(denali->dev, "Failed to setup ECC settings.\n"); > goto disable_irq; > -- > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. > is a member of Code Aurora Forum, hosted by The Linux Foundation > > > ______________________________________________________ > Linux MTD discussion mailing list > http://lists.infradead.org/mailman/listinfo/linux-mtd/ -- Best Regards Masahiro Yamada