From patchwork Thu May 3 12:20:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 908003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aWM0p1SZ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="grPRELbr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="grPRELbr"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40cDn648dsz9s3q for ; Thu, 3 May 2018 22:22:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oqUE6hIbajL6A6vrs+R7Y7XAWQynzyo9BaLszj9tt1M=; b=aWM0p1SZmNr+Xh w8+mfX/FFslod5j6dUq4JG9ychGyDwGiFbjEgN/CgyWcchPp8/3BtG0bydjtXmiRBJl+plTVGFW5H 7IzhJFgViLtk00HNyGDE5a4NLiwW5tjb80OMVj36gr+SQrtBLWqSCkOPoJ2GYHg8lMZDx57OPjj+V hPZ9x7pdUoqZxP4QuAe2A0sLjYX5/GOB05IQdL174t41aF4grHd1AayN62D+CFA0H6u0arm1cZ7BU 7uA3vvu/t/9prxfWpPcM3Ml+pjxQkuI/ZidZDvya7n3TCIjImB2BDmE5pNZnYf2prG1qCn3i92bDM FVNeJz7xfp6XNBGDIjDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEDFy-0008Kp-TM; Thu, 03 May 2018 12:22:43 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEDEN-0007Zc-I4 for linux-mtd@lists.infradead.org; Thu, 03 May 2018 12:21:12 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E097E6090E; Thu, 3 May 2018 12:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525350052; bh=18fTFPcONr/7RfMDORlgYJO66I6ABXJsXgQygitN7VM=; h=From:To:Cc:Subject:Date:From; b=grPRELbr2MB+NTyt/4i/qQlZA1AGV/ZIDCjVoXdJew+n8UDd9DlkoXzAQxliw+GGw ftzjYxpGR9YdBs2zerd8RW8PNCTZV1fPVhqaR3h4F344IKpNa5Mk1VJMFhlxLHuTw0 IDhk1UrbnPGF+827Pg85UZOa+5KY3YUdYW5Y4/6Q= 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 3101860588; Thu, 3 May 2018 12:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525350052; bh=18fTFPcONr/7RfMDORlgYJO66I6ABXJsXgQygitN7VM=; h=From:To:Cc:Subject:Date:From; b=grPRELbr2MB+NTyt/4i/qQlZA1AGV/ZIDCjVoXdJew+n8UDd9DlkoXzAQxliw+GGw ftzjYxpGR9YdBs2zerd8RW8PNCTZV1fPVhqaR3h4F344IKpNa5Mk1VJMFhlxLHuTw0 IDhk1UrbnPGF+827Pg85UZOa+5KY3YUdYW5Y4/6Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3101860588 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 Subject: [PATCH v2 00/14] Update for QCOM NAND driver Date: Thu, 3 May 2018 17:50:27 +0530 Message-Id: <1525350041-22995-1-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180503_052103_669380_6FDF5248 X-CRM114-Status: GOOD ( 19.15 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [198.145.29.96 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Richard Weinberger , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , Abhishek Sahu , linux-mtd@lists.infradead.org, Miquel Raynal , Andy Gross , Brian Norris , David Woodhouse Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org * v2: 1. Addressed all review comments in v1. 1. Make the generic helper function for NAND ECC parameters setup and used this helper function for QCOM and Denali nand driver for ECC setup. 2. Modified commit message for some of the patches and added more comments. 3. Added new patch for fixing ‘return 0’ for raw read. 4. Removed the read last codeword part for nand oob write. 5. Reorganized bad block check function and removed the read_last_cw function completely. * v1: This patch series mainly deals with error handling and erased page bitflip detection for QCOM NAND driver. 1. The error handling was missing for some of the cases so fixed the same. 2. Add the support for taking ECC strength from ONFI parameter. The earlier QCOM boards were coming with 4-bit ECC chip but now the same boards are coming with 8-bit ECC chip since the earlier 4-bit parts are obsolete from some vendors. 3. We got few issues related with NAND erased page bitflips. The QCOM NAND controller can’t detect the bitflip in completely erased page so added the support to detect the same. It implemented the logic mentioned in patch [1] which didn’t go in mainline and later the generic functions were provided [2] to count the number of bitflips and make all 0xff. This patch series did some optimization logic to prevent the unnecessary full page raw read and data copy from QCOM NAND controller to DMA. 4. Following are the testing done for these patches in QCOM IPQ8074 HK01 (4-bit and 8-bit ECC chip) and IPQ806x AP148 boards. a. Run all mtd test and check if it passes b. Introduce custom bitflips in erased page and check if it returns no error/EUCLEAN/EBADMSG depending upon number of bitflips and position. c. Introduce failure condition for operational failure and check if it detects the same. [1]: https://patchwork.ozlabs.org/patch/328994/ [2]: https://patchwork.ozlabs.org/patch/509970/ Abhishek Sahu (14): mtd: rawnand: helper function for setting up ECC parameters mtd: rawnand: denali: use helper function for ecc setup dt-bindings: qcom_nandc: make nand-ecc-strength optional mtd: rawnand: qcom: use the ecc strength from device parameter mtd: rawnand: qcom: wait for desc completion in all BAM channels mtd: rawnand: qcom: erased page detection for uncorrectable errors only mtd: rawnand: qcom: fix null pointer access for erased page detection mtd: rawnand: qcom: parse read errors for read oob also mtd: rawnand: qcom: modify write_oob to remove read codeword part mtd: rawnand: qcom: fix return value for raw page read mtd: rawnand: qcom: minor code reorganization for bad block check mtd: rawnand: qcom: check for operation errors in case of raw read mtd: rawnand: qcom: helper function for raw read mtd: rawnand: qcom: erased page bitflips detection .../devicetree/bindings/mtd/qcom_nandc.txt | 4 +- drivers/mtd/nand/raw/denali.c | 30 +- drivers/mtd/nand/raw/nand_base.c | 42 ++ drivers/mtd/nand/raw/qcom_nandc.c | 622 ++++++++++++++------- include/linux/mtd/rawnand.h | 3 + 5 files changed, 461 insertions(+), 240 deletions(-)