Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1029364imm; Thu, 4 Oct 2018 07:12:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV62+QE/3aYSGn1glPvGnu0Mlk69URjVD5U0rvGYFQ2z8IztkNQF/kruOnNK7k1UvrMu7B8Du X-Received: by 2002:a62:8145:: with SMTP id t66-v6mr6786382pfd.192.1538662320675; Thu, 04 Oct 2018 07:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538662320; cv=none; d=google.com; s=arc-20160816; b=DxPO3hE4rIKt2b8ygkqFRPyBgCQDjhNoK41Bp2BGlAsVzwKViC4JLXCAQ3UlPqG71i nJ/P5nAt3tqhaHsww9YHpncbmwG56oKXqpKK9YuYW2k33Udimv9U1AjIhGV8P+Mh95gT A0Builsr7WMygKCFzTfSV2mHMap+ej+KBv3zQ1KNf0cZ9FXRp2fX64TugIl9IFP3f42I uvwcCgSPVW5V+AToxaQJpIq1AFYKSxHYF/V4tFA0vaD4DZT/qDNF/GKMndRPIj7zfw74 6vMUnefwrRrUgbNl9YHQ/loCpLSUDKJ2ctx3bqk4TCV/NFBGxCafnY5A+sPXVSew4Q2+ vdCA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=26OpygXkVkQ+yy/bOBSZug/4KNAD5akX+cDA2JpwiYI=; b=PrW7MDSF9udmHLmeR0debet5d8VRiolKk79mawv+KY+AEhbFzs6vp5YAlqQEpR+PYC 63TjfBOp7V3UmPVqiFZHN40BHmYnEvzPDbk79BqVP9q61X61RYQmxOSmOXM2U23155JC bu6+HSkgYdIMP0Fp6glXRBe+UdACrX/xApvQgVYUtWQssxC+cBCnWx33TQ9vuWhiFEKk zZS+24Ni1RIkqs+1sUsBWa4MdKvCAlsIuTK61lhRWkb9HYiaA5tqifn6m/DodvVcfLhx lEIWJ9QHdLxLbHFw4PSZzCpZy9ttg97acRodobruppqC1MERbliMnsCcA3JdAHy8eEC8 ZxsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lo1JyTuL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l136-v6si5913749pfd.132.2018.10.04.07.11.45; Thu, 04 Oct 2018 07:12:00 -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=@gmail.com header.s=20161025 header.b=Lo1JyTuL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbeJDVDm (ORCPT + 99 others); Thu, 4 Oct 2018 17:03:42 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36261 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727369AbeJDVDm (ORCPT ); Thu, 4 Oct 2018 17:03:42 -0400 Received: by mail-lf1-f65.google.com with SMTP id d4-v6so6907940lfa.3 for ; Thu, 04 Oct 2018 07:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=26OpygXkVkQ+yy/bOBSZug/4KNAD5akX+cDA2JpwiYI=; b=Lo1JyTuLy0JkdfX/5X2hYieCvqUgyGKcs5fa8U3FhZLoOJ8bBMWtmXrR5Tfley5Xtk TAHilvZ15Tnr1O7LsI3oLi/yDq2p23lugoLLYvF19yonOivzRETbZzrMMys71/+vUXVj pbDNuvaSO0LCjfzMHiaGrMsY5UISaGBvZpmIgJNlu3tP7NAKArDZHzSacvnEVQXicYjV 0b+MBQLIyb6OruaT86QogT6fcDLDBrfRWY6+XN8vTr652kVK5xcMvRH3hRJXuIFQc3To dXtFKRw+Ql7lbCXSTApqa7Xaj9u6KyVk8sHQwHySCj2pY48gVyPP0CPuPWnTZUu4QZ4X La9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=26OpygXkVkQ+yy/bOBSZug/4KNAD5akX+cDA2JpwiYI=; b=ui+BLhVob7I73kn6dkbVzn/rRYMgSMj3X7lyHCk/wFlc45NYSt9z1BwXptQuUEiiP/ fvcwx/yDdk0OF7qd0Wmk4qkO3aBP2iK3MPsO5hQbZOEbzkgICYvPHeLntj0hGMpvHYXZ P8C8JM21hbiiv4PwsSFcSIMOeueOxLiHqXDLy2jsJE5+GE99UYrj2pXRpRZrVG858RXj XNR/upXA40koDnE9wyNDUjEzW6MrfZvDFLYLQKWQ77JNMREHL1uiYxjNIEG952XPg+DJ 6FLEo+Miggup3Z89w25Dsq04oUoEY5pS32ntfYStShzqWF8ErOwO43MK0+uKd0+/IvTW oqwA== X-Gm-Message-State: ABuFfohXvjNLsdNvQ6PpbR5FLkA2KSCaffEywmhMgjWZ2XalU8wefRY8 nt5zYpvCNwV2QdMKp8/4Ujk= X-Received: by 2002:a19:d3c4:: with SMTP id k187-v6mr4160505lfg.101.1538662210873; Thu, 04 Oct 2018 07:10:10 -0700 (PDT) Received: from z50.localnet (78-10-164-223.static.ip.netia.com.pl. [78.10.164.223]) by smtp.gmail.com with ESMTPSA id p11-v6sm1105856lji.87.2018.10.04.07.10.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 07:10:10 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon Cc: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mtd: rawnand: ams-delta: use ->exec_op() Date: Thu, 04 Oct 2018 16:11:42 +0200 Message-ID: <38470936.GRFaOSl3cF@z50> In-Reply-To: <20181004155933.0a32c4ac@bbrezillon> References: <20180719081508.5dafebde@bbrezillon> <7546835.d2Xs8Qh0bZ@z50> <20181004155933.0a32c4ac@bbrezillon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, October 4, 2018 3:59:33 PM CEST Boris Brezillon wrote: > On Thu, 04 Oct 2018 15:52:57 +0200 > Janusz Krzysztofik wrote: > > > Hi Boris, > > > > On Wednesday, October 3, 2018 4:06:34 PM CEST Boris Brezillon wrote: > > > On Wed, 03 Oct 2018 15:55:25 +0200 > > > Janusz Krzysztofik wrote: > > > > > > > > > > > > > > > Implementation of NAND_OP_WAITRDY_INSTR has been based on legacy > > > > > > nand_wait_ready(), > > > > > > > > > > I don't remember what the ams-delta ->dev_ready()/->waitfunc() hooks > > > > > are doing, but is shouldn't be too hard to replace them by an > > > > > ams_delta_wait_ready() func. > > > > > > > > Default nand_wait() is used as ->waitfunc(), and ->dev_ready() returns R/B > > > > GPIO pin status. > > > > > > Okay. Then it might make sense to provide a generic helper to poll a > > > gpio. > > > > > > void nand_gpio_waitrdy(struct nand_chip *chip, struct gpio_desc *gpiod) > > > { > > > ... > > > } > > > > How about a still more generic helper which accepts dev_ready() callback as an > > argument? > > Nope, I still prefer the GPIO based one. We'll see if others need a > a more generic helper, but I doubt it. OK. Legacy nand_wait_ready() uses a hardcoded timeout value of 400 ms. Should we follow the same approach in nand_gpio_waitrdy(), or should we rather let drivers pass the timeout value, like in case of nand_soft_waitrdy()? Thanks, Janusz