Received: by 10.192.165.148 with SMTP id m20csp1775701imm; Thu, 3 May 2018 05:21:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrXxZKkpzXzsD8chms09uhDjkvljvXlfYJqFYSkUjzwGK6mGj6rqIfdOVmAR9frpT6hXoag X-Received: by 2002:a17:902:b60c:: with SMTP id b12-v6mr5586165pls.44.1525350085821; Thu, 03 May 2018 05:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525350085; cv=none; d=google.com; s=arc-20160816; b=OjxR02WRYLoPxkkvhkqtC+2Irz3GmQJLc0OGjqJKVhG5eiS9SqBrXnT2vTq3K97ShJ 1G6ww95Q9+OkQR2hDRDQfELVif/1PZRJt9mD44XBH9vYaylJiF8Ko7nHNFXPVwd1dWZz Kh2tSzU7ighjJE3dfHRy13gQAkFrAdIB/JmCOVTGqef7TFA37E4UmBM503a5Z0oqUA2b Y7+4h1P1YinxfsBWdTz5+CNm8gWY6/NkIUL602N80yCR+9Y985poy55fbuaLM4QgGTYr HmgKUT3A0HyDtVzk3rzNbrBwiPHB3l0Sgx1fS2AqtDF4ObOZ2XMT8W0oqVyhMyZRzw5u S7fw== 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 :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=W4vV1SGuHyF7E/sYpy0Dl5yer6aRQ6rXwCfFG7qx74c=; b=M2kQhD4OQMIVYUe4v0ViTvVZSjqSuTWpRBV+Cw/923DQQkUypF9VNlpdfnrB8hNUqy Xi3BAsinjO3rVI15VPmUf60mUF1NdrPMtMlLpfcMCT4XedoU0aPFYxHYbscM34H4sLPY VLRSFOs/wkk+lDhDqbTt/JowSXfyD3Cmg9eziestVEA63yEP8cFKUYEMpuT0SbFON0f2 bscQCGn/q5SXj5f+oYUDQhaaz+f4hwHlqYcaWrmu8joGRnH88g0PWg2u+7WgtFMhfaWq 3fWb5Mv/iTo6V8PeiWmifrdF9/xGpIFLwPsNxlE9qZOP9FbvQmW4BJCQrQ4GqsvpMzZc qzjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=mSz79us1; dkim=pass header.i=@codeaurora.org header.s=default header.b=grPRELbr; 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 a81si13475362pfj.300.2018.05.03.05.21.09; Thu, 03 May 2018 05:21:25 -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=mSz79us1; dkim=pass header.i=@codeaurora.org header.s=default header.b=grPRELbr; 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 S1751763AbeECMU4 (ORCPT + 99 others); Thu, 3 May 2018 08:20:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40916 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbeECMUx (ORCPT ); Thu, 3 May 2018 08:20:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 07DED607F5; 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=1525350053; bh=18fTFPcONr/7RfMDORlgYJO66I6ABXJsXgQygitN7VM=; h=From:To:Cc:Subject:Date:From; b=mSz79us1Dt4LVSKiE6Jaw29SJK1CPH068x+p1EAAm+SENB1249rvn6T51b6yTBoYY eO2ZRhfGPihYxDvaKrt8soPycCJuIRgjeDD1LasNBo8z8Cti5+qOjMsk9KoZInVywn xknbG5ycrUKlD+Fk45vaqrJJ1Lp0VrJzHK7m1/7g= 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 Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Miquel Raynal , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross , Archit Taneja , Abhishek Sahu 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation