Received: by 10.213.65.68 with SMTP id h4csp3687730imn; Tue, 10 Apr 2018 03:07:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4EVxSjkroGZaRV5SAvSeJE570Vl6pSCLVHEPXtkX62vpB6NrMYM070BUOtYO0OrAEXXDh X-Received: by 10.99.179.68 with SMTP id x4mr23077947pgt.132.1523354830521; Tue, 10 Apr 2018 03:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523354830; cv=none; d=google.com; s=arc-20160816; b=NQ8kXVBO2zGUvA5OsXEWr1d6zjXm6V5XhF1J5smZeogAbbjQHMM7mLml5zHqSB1TKb k094hTuc9XRGMMpLPLXnHVBiF9T3pPB/yo1dDk/LOXMLznlSlcgqI4qxaKRiYweTmIp9 yjjQ040m4MouAS4D3FuLLyGoxZnVaUoRODsxo3amORPZ0SnQTqSTxTsomfOMuzwgOnyp gab80HbHFt/NNfkGvgQ6wGc3QVtqq1+v5Cgw5tIo7ph35QJVB4t9/21Wvt0kB8MUY9Gn aFSl0OFZ036QGUeVJhNEt6Dn8pHDWSP60IgdohSsblSQmPBcJq/fc4E/DOlKmobe52QB OseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=tbGRVUUOuyT1cCc++eOvflHPN1/w2tCm8HRPLHUnmrg=; b=TRrm+ktsCs6m64i9MhtlMqCgZ/tP9EIwm9t+Ys5nw860xaISOKFRVrET4KCoPb0fKB yQvPG3ARYiqaxZcQ2YATakKV2lHKEVRCe/02RG1HDzbXQVswIwscVTKNd3Lpfa11KvJK y3uP07c34N5s1VDIv80vZnpVgWEvAvKBCDyImsdA/oIz2ZjuY6tp9TJaS5Lfcc7ZtboT M0+FTx1VzdAKtVDsvXTJSS2kSesrJBhqTmSQEQAiWaeE7eO3v5TcVXZj00+A1QGZG2Ug FULXMpO8rM5wb5mbrlBxlX2HHiUl5hzP9/HEW17Tmom35ffRl3elVsAXFpPPmla1JGg0 KHZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t83si1817088pfj.167.2018.04.10.03.06.33; Tue, 10 Apr 2018 03:07:10 -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; 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 S1752258AbeDJKDw (ORCPT + 99 others); Tue, 10 Apr 2018 06:03:52 -0400 Received: from mail.bootlin.com ([62.4.15.54]:43354 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbeDJKDu (ORCPT ); Tue, 10 Apr 2018 06:03:50 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 1DEF020728; Tue, 10 Apr 2018 12:03:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id B3E4D20384; Tue, 10 Apr 2018 12:03:38 +0200 (CEST) Date: Tue, 10 Apr 2018 12:03:38 +0200 From: Miquel Raynal To: Abhishek Sahu Cc: Boris Brezillon , Archit Taneja , Richard Weinberger , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Cyrille Pitchen , Andy Gross , Brian Norris , David Woodhouse Subject: Re: [PATCH 5/9] mtd: nand: qcom: parse read errors for read oob also Message-ID: <20180410120338.663d5925@xps13> In-Reply-To: <1522845745-6624-6-git-send-email-absahu@codeaurora.org> References: <1522845745-6624-1-git-send-email-absahu@codeaurora.org> <1522845745-6624-6-git-send-email-absahu@codeaurora.org> Organization: Bootlin X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abhishek, On Wed, 4 Apr 2018 18:12:21 +0530, Abhishek Sahu wrote: > read_page and read_oob both calls the read_page_ecc function. > The QCOM NAND controller protect the OOB available bytes with > ECC so read errors should be checked for read_oob also. Now > this patch moves the error checking code inside read_page_ecc > so caller does not have to check explicitly for read errors. > > Signed-off-by: Abhishek Sahu Nitpick: the prefix should be "mtd: rawnand: qcom: " now as this driver has been moved to drivers/mtd/nand/raw/. Otherwise: Reviewed-by: Miquel Raynal > --- > drivers/mtd/nand/qcom_nandc.c | 19 ++++++------------- > 1 file changed, 6 insertions(+), 13 deletions(-) > > diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c > index 0ebcc55..ba43752 100644 > --- a/drivers/mtd/nand/qcom_nandc.c > +++ b/drivers/mtd/nand/qcom_nandc.c > @@ -1676,6 +1676,7 @@ static int read_page_ecc(struct qcom_nand_host *host, u8 *data_buf, > struct nand_chip *chip = &host->chip; > struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); > struct nand_ecc_ctrl *ecc = &chip->ecc; > + u8 *data_buf_start = data_buf, *oob_buf_start = oob_buf; > int i, ret; > > config_nand_page_read(nandc); > @@ -1741,6 +1742,9 @@ static int read_page_ecc(struct qcom_nand_host *host, u8 *data_buf, > > free_descs(nandc); > > + if (!ret) > + ret = parse_read_errors(host, data_buf_start, oob_buf_start); > + > return ret; > } > > @@ -1786,20 +1790,14 @@ static int qcom_nandc_read_page(struct mtd_info *mtd, struct nand_chip *chip, > struct qcom_nand_host *host = to_qcom_nand_host(chip); > struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); > u8 *data_buf, *oob_buf = NULL; > - int ret; > > nand_read_page_op(chip, page, 0, NULL, 0); > data_buf = buf; > oob_buf = oob_required ? chip->oob_poi : NULL; > > clear_bam_transaction(nandc); > - ret = read_page_ecc(host, data_buf, oob_buf); > - if (ret) { > - dev_err(nandc->dev, "failure to read page\n"); > - return ret; > - } > > - return parse_read_errors(host, data_buf, oob_buf); > + return read_page_ecc(host, data_buf, oob_buf); > } > > /* implements ecc->read_page_raw() */ > @@ -1889,7 +1887,6 @@ static int qcom_nandc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, > struct qcom_nand_host *host = to_qcom_nand_host(chip); > struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); > struct nand_ecc_ctrl *ecc = &chip->ecc; > - int ret; > > clear_read_regs(nandc); > clear_bam_transaction(nandc); > @@ -1898,11 +1895,7 @@ static int qcom_nandc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, > set_address(host, 0, page); > update_rw_regs(host, ecc->steps, true); > > - ret = read_page_ecc(host, NULL, chip->oob_poi); > - if (ret) > - dev_err(nandc->dev, "failure to read oob\n"); > - > - return ret; > + return read_page_ecc(host, NULL, chip->oob_poi); > } > > /* implements ecc->write_page() */ -- Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com