Received: by 10.213.65.68 with SMTP id h4csp689661imn; Wed, 4 Apr 2018 05:44:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4875uhBigAN4AZKEjqRg2Smj4kT6lFf4hNlzXdJ7pg407nDP1WaI5LAK3a/QAyXD2VHcHn/ X-Received: by 2002:a17:902:9308:: with SMTP id bc8-v6mr18441941plb.189.1522845895541; Wed, 04 Apr 2018 05:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522845895; cv=none; d=google.com; s=arc-20160816; b=ttqCsI6LcAvx+ekGKS0pxbyxoHsOSuqiDz7WX4f9RXoV7N5Lkxy9lGVPCBAH8bsQZE rPREw9+QfAVCIhrE4o0UMmdlBZu9FDzxj4HZHSTTQM9k3d/u+/KEIzoMj00pJR0gCfs2 9xGd+oXyoxnxSp/Dqgr9c6g56uZvdq4M7ZHsm2l0mzGEdlnxCxa+oQ+XeyWmcEC+80MV kbo0FCEpqNQAY/sJoK8fSbKpatah7VMBTnxOAUKTdZlviFRI14XUMDPVZ63Hyb9deOf2 Hd4BVB/Nb9kXVXHgHJf6LRMD73355Qr5Facnbroe/eTE1ebs52wGA5IXtMtqN4GHKbga DLww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=AYKYdwGg139tiIvjG8EY4PkVfU2+p0eK9HrfW2S1Fx8=; b=tMOAbuZazrxXJLFAuK+sFtf8k+BGF83siYGHeZP4CL8qZq93ZLM9HvwKMIU9ZvaMoa e7C6KiuBZXibdvshKU3hpF1GtGo1HH47eI7fJto/O639En4CFUOKaxHYldyD343BnBoG QTWAh2ZdJjgMfDM5TwF6Ra2Eucp+i7g5KFyklsZG81OL5aNNghfDxWdwVaB6UOodZ/Qz oUSQhtjf/n0uQ/QmXqd5qmPEyrYTK+iUcWL6szP3FSPejwRXnXWDqQDtYPRdyE1doivk y9FtmbK5pJ7+In169S18+HsLYHZpgvyIpigpfdP1gek1x3TECKtBSGA/xi2DXTsTlotH lIYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=FxrPP9e9; dkim=pass header.i=@codeaurora.org header.s=default header.b=gOj4RXmo; 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 v9-v6si3163209plz.134.2018.04.04.05.44.41; Wed, 04 Apr 2018 05:44:55 -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=@codeaurora.org header.s=default header.b=FxrPP9e9; dkim=pass header.i=@codeaurora.org header.s=default header.b=gOj4RXmo; 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 S1751571AbeDDMnY (ORCPT + 99 others); Wed, 4 Apr 2018 08:43:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41342 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbeDDMnV (ORCPT ); Wed, 4 Apr 2018 08:43:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B55A560F61; Wed, 4 Apr 2018 12:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522845800; bh=8+jsla+r4izk00dhvCnWT/GY2JuV7I8tqjKpmGJEtLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxrPP9e9LsJIst/5f7N3hD4z3KaMYajTgVmBWESLcjGHfxNdX/n/V5YEzzsRua4fB wjpycsJjpowoMFYSW7d/X4KhzO7K5DTsFhSy1c1Z42tlIWURDYT5M6Foa9QOAEj+J9 aGNvUzNvrrxLrYEOKY6HBbSHe2hhdhgpt1Ss53bk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from absahu-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2294D6055B; Wed, 4 Apr 2018 12:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522845799; bh=8+jsla+r4izk00dhvCnWT/GY2JuV7I8tqjKpmGJEtLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gOj4RXmoiNP8PtOenOziDGlNJ60yf8qoknpNnumvMC9d1seShErb3IaLTFopF9p8c 2oIhYevJdORiin45VjWWFqd2JeKVQKOd1chKsT7n1bhaxLz0D7eDUmkG3jYsqoTCeV AhRGQnsJH5g79NkY+0QbD17wH6LoDe5B1d8RyqhQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2294D6055B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: Boris Brezillon Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross , Archit Taneja , Abhishek Sahu Subject: [PATCH 6/9] mtd: nand: qcom: support for checking read errors for last codeword Date: Wed, 4 Apr 2018 18:12:22 +0530 Message-Id: <1522845745-6624-7-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1522845745-6624-1-git-send-email-absahu@codeaurora.org> References: <1522845745-6624-1-git-send-email-absahu@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add boolean function argument in parse_read_errors to identify whether the read error has been called for complete page read or only last codeword read. This will help in subsequent patches to detect ECC errors in case of last codeword read. Signed-off-by: Abhishek Sahu --- drivers/mtd/nand/qcom_nandc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c index ba43752..dce97e8 100644 --- a/drivers/mtd/nand/qcom_nandc.c +++ b/drivers/mtd/nand/qcom_nandc.c @@ -1570,7 +1570,7 @@ struct read_stats { * errors. this is equivalent to what 'ecc->correct()' would do. */ static int parse_read_errors(struct qcom_nand_host *host, u8 *data_buf, - u8 *oob_buf) + u8 *oob_buf, bool last_cw) { struct nand_chip *chip = &host->chip; struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); @@ -1579,12 +1579,12 @@ static int parse_read_errors(struct qcom_nand_host *host, u8 *data_buf, unsigned int max_bitflips = 0; struct read_stats *buf; bool flash_op_err = false; - int i; + int i, cw_cnt = last_cw ? 1 : ecc->steps; buf = (struct read_stats *)nandc->reg_read_buf; nandc_read_buffer_sync(nandc, true); - for (i = 0; i < ecc->steps; i++, buf++) { + for (i = 0; i < cw_cnt; i++, buf++) { u32 flash, buffer, erased_cw; int data_len, oob_len; @@ -1743,7 +1743,8 @@ 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); + ret = parse_read_errors(host, data_buf_start, oob_buf_start, + false); return ret; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation