Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp991753imm; Wed, 18 Jul 2018 14:31:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnJJfGCnCv9Zly9HHafGfSRlxmy7/EsX5IWJWFVIHLqt73QTCvAzTnbIH1Dja/Z/W1H3bq X-Received: by 2002:a17:902:6bc7:: with SMTP id m7-v6mr7640309plt.162.1531949475939; Wed, 18 Jul 2018 14:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531949475; cv=none; d=google.com; s=arc-20160816; b=C20NoyRuX0UZ+dp2AAEK4C+bMXWRM3LgTLnlhD817EQedZHeS3T6iB+s4Xr4GQx5RV JPnYjt+ppA+dAm1/7eV3U8TbtMjJOP+QBg9kk44IKWw9noSpXbbUOtnIDE+D7SYkfmVl DLXBu31QyI0Jwhf87DqaPAvyCckmCEPEjGU9EIUDa+KO0vbP9zVDwkwpbYmRdu5NCJkt bvF1y2DSHvJjtma71SE7YLBKMdTumWm3vnnJvjz23pdKcDHRVpgTth5Nv5yAGYZBza1n YZqhiUnVn/V2ED3+qWJmRQt5hY8ox7+FI90VuhuMPoeXwcAe99CgN8AuDQFKM76p0Z/+ LuTw== 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=VOYvgXKGd+ApkGR27T3OiXodvXvVZcV8ZTPsltjI8R0=; b=UQjMYRi56DFnI6Eo9uQC2Li+oyQj9f/6iTZLCvtO3R2hpgi6TlWncVWDocuYxShoe8 qQpmurDVESvwRdHk+AMl7C9z208X2/Y/pmjK+wfgKEtqj3KupjmhOSWR7inSafK8aX+X GEgQKU8hqt1i3bp29OZrdksHk7F8+djEXAXwNHCwkhGtkRdB2IqafBwOgibuOJPte44J OMbBECVaeifEIJrqBfUSoNdf6zrlwBg5FCRDyUXj+C+CVCIN5DEwWHu77Pva9X4c2GSd +eWmy4na+KlhwkTzLPTyQIqdijJT+82S+BGIvrPVFaaFcsRV5UP3No6KCfSJfNYioQub /jrA== 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 r73-v6si4375152pfk.83.2018.07.18.14.31.01; Wed, 18 Jul 2018 14:31:15 -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 S1730469AbeGRWJp convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Jul 2018 18:09:45 -0400 Received: from mail.bootlin.com ([62.4.15.54]:41100 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeGRWJp (ORCPT ); Wed, 18 Jul 2018 18:09:45 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id D88C320731; Wed, 18 Jul 2018 23:29:56 +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 (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id 46D01206A6; Wed, 18 Jul 2018 23:29:46 +0200 (CEST) Date: Wed, 18 Jul 2018 23:29:45 +0200 From: Miquel Raynal To: Abhishek Sahu Cc: Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross Subject: Re: [PATCH 5/5] mtd: rawnand: qcom: reorganization by removing read/write helpers Message-ID: <20180718232945.407e22de@xps13> In-Reply-To: <1530863519-5564-6-git-send-email-absahu@codeaurora.org> References: <1530863519-5564-1-git-send-email-absahu@codeaurora.org> <1530863519-5564-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=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 Hi Abhishek, Abhishek Sahu wrote on Fri, 6 Jul 2018 13:21:59 +0530: > Driver does not send the commands to NAND device for page > read/write operations in ->cmdfunc(). It just does some > minor variable initialization and rest of the things > are being done in actual ->read/write_oob[_raw]. Thank you for cleaning actively this driver. I think you are comfortable enough now to switch to start the migration to ->exec_op(). I will take this patch as I think it shrinks a bit the driver (which is inordinately huge) but I would like to get rid of any kind of hackish ->cmdfunc() implementation. Boris and I can help you doing that, you can grep for drivers already converted and observe they structure (marvell, fsmc, vf610). > > The generic helper function calls for invoking commands during > page read/write are making this driver complicated. For QCOM NAND > driver, ->cmdfunc() does minor part of initialization and rest of > the initialization is performed by actual page read/write > functions. Also, ->read/write_oob() does not calls helper > function and all the initialization is being done in > ->read/write_oob() itself. > > Since after 'commit 25f815f66a14 ("mtd: nand: force drivers to > explicitly send READ/PROG commands")', sending of commands has > been moved to driver for page read/write, so this patch does > following changes to make code more readable: > > 1. Introduce qcom_nand_init_page_op() and qcom_nand_start_page_op() > helper functions which helps in removing code duplication in each > operation. > > 2. After issuing PROGRAM PAGE/BLOCK ERASE, QCOM NAND > controller waits for BUSY signal to be de asserted and > automatically issues the READ STATUS command. Currently, driver > is storing this status privately and returns the same when status > command comes from helper function after program/erase operation. > Now, for write operations, the status can be returned from main > function itself, so storing status can be removed for program > operations. > > Signed-off-by: Abhishek Sahu > --- Thanks, Miquèl