Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2595267lqo; Tue, 14 May 2024 03:46:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPtO32omlvJOWcLp/F6Sg0cxVY6GhYHzCq4EI9NhEMoH1YFLX4KfxAbzxZDGe3Dx/3fYXADrqvgYvUv+ADzOxjwFyl3XSaUdfnAnePZw== X-Google-Smtp-Source: AGHT+IH/DHtyad3Ht6oKUdSOIwVNbWYDdfOUSektk1J0tKsRDmIFVzwn5igMawC4rSsnu8bORTDS X-Received: by 2002:a05:6902:1504:b0:dee:6033:59d0 with SMTP id 3f1490d57ef6-dee60336099mr10926226276.49.1715683580131; Tue, 14 May 2024 03:46:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715683580; cv=pass; d=google.com; s=arc-20160816; b=xZ6SqlXFlp0MD95d1KPp/eoecn9rZbphc9V67Q9fQ5joAnDnqWzMJ9wDUK2yzUFuU+ fnty+UeUjSTp3zgT7NQ9CRLzxXLXs9WwXaVnwow2GprtKk1+vf/jBTkwWmrrjKqpONLA AVwDvFZjTO2kW8PLohAX2CHGtCJjOAe28aQDXj4EDL1jtonWFBYQHb5GQU/TT7hzdbYM wZbKnykj1SolAVpMaKt9WlZZV2L0SKTEdjipJFaNuDgemSO02jSZpvTV/MPi0M4v1NS/ lUflIQsMhtLZCPK//IEGWonTKmqqqdIeUDK0T/mIXc0fC+wTuBp5ez3aNidCmpn/2vRp atKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=JwCC6DgkYOnVAxgMfGgxDNcG6VVfSmS67z1fSU/thog=; fh=RsD2Wu/PkL4LmNZy/9z1j6mcj+O7Tm7PbiyQTKBxpww=; b=l3mVhdKapMV59Ofa6HyHIy7zRn/bKsT68j4UwdRswYd+0qbZlDpWAw2Z1uXlC1ZyB6 Y1k9W1pXC3RaHvVqOZ6RWmTNMVB7obIFKErFNNWCMoqU1ynddqpQemd7QjgH7lElWQKs N+fs+Aj7niYRrPaR1wIdGDox626WZz3XIrZ3gddHdQalQ0AsQwS3zHi33GyL8zxngN6a UjQo79D0ZxyIr11uTSb5HqSPyL9bdiQ/bwE3KwgrBZqRPQJZyar1O7CgBHH01DYmZVlx 0dDeMXB1WZb9R7ddWWfdgVTkn9053q2V91bxCIBMEhmJVufLHV2MwLOackHtoqnnAGQG UX8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NFTEov9i; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-178551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d7819si122031486d6.1.2024.05.14.03.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 03:46:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NFTEov9i; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-178551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D739E1C2108D for ; Tue, 14 May 2024 10:46:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20E536EB46; Tue, 14 May 2024 10:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NFTEov9i" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDB1F6E60F for ; Tue, 14 May 2024 10:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715681774; cv=none; b=FZOZ32taZdvz6hbO5vRjO0bw+FiK0/V0nQ/VXv1A8qPwFomxG6WgvPKmYWIS1h/NDzqCm2BiwvETEFCAE3mRsiPkk26OLeVqPfDmH3J52dDYNNRKdaZ4u/adFM7j/NpWgUwXGHjM2mh2t7o2pB+sYCVUYbqx7+OssgY831cTqr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715681774; c=relaxed/simple; bh=5KCYdPg1i7cRHUUyqTeytScT9jaxIL6krJbwXxLmzSo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WUn5pejWiM9ZDduAfqNrRyKYoZA3HefpdKUOrGhAfFDnuHvzCWOHgsvkV7H6glHiaKaX71PYrFtODGKdgYArT070g13b5q2f/gXhIcb0gpMYx17NZp/q9oEQcdFbDO4UANOFmBf/YgQAT+wzQTOjdzT7P2zvhHWuNgq1LJaUon4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NFTEov9i; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id EDDEBC0002; Tue, 14 May 2024 10:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715681764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JwCC6DgkYOnVAxgMfGgxDNcG6VVfSmS67z1fSU/thog=; b=NFTEov9iI5E64TeidBAdI2psIbgOEwyX5cRn4SJ9+5jKxszuZq/KTeBDioN+4kD5T6U1PJ xQKIzCNP/jYrLsLwk87WFrSI8JYwwEVkHRxrjkEoVu/riiPUWt0GQArqqhIj7gm0WLPzSW ZF0nRax0V84TMBbcHo1YDWbXgiaUzswHF7QU597f0BUCIqW1OCyDdOzg++5X9kg5IJfmgy I2b4fLhQluCYiLEt3hh/s0NdBy26ST2YkzAOdLG1JLH6I45C/IWVjjp2ZcEMPWDRxQehiq N4GRDvbZY10IuJ433U5mShBNHYppN8WQovPbGgDGAXPQ4z7C8aOExf6CCnodeg== Date: Tue, 14 May 2024 12:16:02 +0200 From: Miquel Raynal To: Sascha Hauer Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] mtd: nand: mxc_nand: implement exec_op Message-ID: <20240514121602.273f788e@xps-13> In-Reply-To: References: <20240508-mtd-nand-mxc-nand-exec-op-v2-0-6b7366b7831f@pengutronix.de> <20240508-mtd-nand-mxc-nand-exec-op-v2-2-6b7366b7831f@pengutronix.de> <20240513091902.2c00d30a@xps-13> <20240513093256.363861d1@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Sascha, > > > > + case NAND_OP_WAITRDY_INSTR: > > > > + /* > > > > + * NFC handles R/B internally. Therefore, this function > > > > + * always returns status as ready. =20 > > >=20 > > > This is no longer a standalone function, maybe: > > >=20 > > > "The controller handles the R/B pin internally, therefore there is > > > nothing to do here." =20 >=20 > Ok. >=20 > >=20 > > And this is actually very wrong. > >=20 > > You should call wait_op_done() instead. =20 >=20 > No, I don't think so. wait_op_done() is called to wait for the interrupt > of the controller indicating a basic operation is done. A basic operation > can be that a command is being sent or an address byte has been sent to > the chip during an address cycle. >=20 > With this arbitrary example: >=20 > struct nand_op_instr instrs[] =3D { > NAND_OP_CMD(NAND_CMD_READ0, 0), > NAND_OP_ADDR(4, addrs, 0), > NAND_OP_CMD(NAND_CMD_READSTART, NAND_COMMON_TIMING_NS(conf, tWB_max)), > NAND_OP_WAIT_RDY(NAND_COMMON_TIMING_MS(conf, tR_max), > NAND_COMMON_TIMING_NS(conf, tRR_min)), > NAND_OP_DATA_IN(len, buf, 0), > }; >=20 > I'll call wait_op_done() once for NAND_CMD_READ0, four times for the NAND= _OP_ADDR, > then once again for the NAND_CMD_READSTART command and four times (on i.M= X27, once > per subpage) for the NAND_OP_DATA_IN operation. Calling wait_op_done() fo= r the > NAND_OP_WAIT_RDY operation woul only timeout because there is no operatio= n in flight > currently. Ah, ok, makes sense as well. If you want (this is not mandatory) you may want to rename the function wait_instr_done() to fit the core's naming: an operation being an aggregate of instructions/cycles. Thanks, Miqu=C3=A8l