From nobody Fri Dec 19 04:53:10 2025 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 43EDD2253EC for ; Thu, 19 Dec 2024 14:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734618379; cv=none; b=iu9zQLz3ZG6o/egcedMYZ4vqQ/RNze7SsUfQP9KwYLhAM2WTShO55B8h58OZyAIDqjIFVSVCSfr8N9Gp9+l/0Z8bjYeyyi+ovuvCb+gNX6+vJIJ+H5MgB6ALpzWknWroAmiuaBONMH5wB98He97UXYkeE7s9Hf050H4yLH7qvSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734618379; c=relaxed/simple; bh=PhRbhBYMtBpLh2VdFBU87ez1vB2K+nuvpx7dutifzCY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=BA24MmzttqF1yxQawYtlYp33Pgre07XzTaHoE8jH7RECXvSJxYpUlfzfS+Z5Q+rvyRT1IcVqJESJkCAL3IyanPYnzYcene9UL0EvbCXEBJycIq/cXF/uOlI2Yssz/O+EskyQUFMat8bfTae+A3ZgOmutViw/RbCOKDsYNf52E+4= 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=fF3h3odk; arc=none smtp.client-ip=217.70.183.193 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fF3h3odk" Received: by mail.gandi.net (Postfix) with ESMTPSA id BBA9524000C; Thu, 19 Dec 2024 14:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1734618375; 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; bh=YEA6kgJCDNwbwvuq5IIM0OIbAjCWhKgd4WmCiH53RHw=; b=fF3h3odkn/k3KKbV8YZ+GE1A59U/n/F8aakIMb35iqh/75czo2oHvBH+kKcHUCYv2i6q0M Lea1DLHvxwFvU1pB2Bgm8nlglt3iqycMtOqmeiBQXy+38eSI9aeF49tw6NRQBXHfe1zTud GnVueMX1JGY1Xejqoz8/biPb58c7jzJcmWn5MitXG6HrLQ5qNIhUwhO7C8jYA/dhuBEsdA JvD2qEgrpoMwuX4ksP63mv5QBjAX/S1EQ/eA7q85UAim1/yU8GmBE1bvTj2wSmxrLWALRZ PsGJalv4i67EZYo6ZQkXVTDwxiyh79gcf19LniKcQl8XBxxOBpcMU84bmyQZKA== From: Bastien Curutchet Date: Thu, 19 Dec 2024 15:25:15 +0100 Subject: [PATCH] mtd: rawnand: davinci: Reduce polling interval in NAND_OP_WAITRDY_INSTR 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 Message-Id: <20241219-patch-nand-poll-v1-1-605e5f15f24a@bootlin.com> X-B4-Tracking: v=1; b=H4sIAMosZGcC/x3MMQqAMAxA0atIZgNt0IpeRRyiRg1ILa2IIN7d4 viG/x9IElUSdMUDUS5NevgMWxYwbexXQZ2zgQxVlmyLgc9pQ89+xnDsO45k68Y5YcMEuQpRFr3 /Yz+87wcr9zw/YQAAAA== X-Change-ID: 20241219-patch-nand-poll-b215766ea0a2 To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina , Bastien Curutchet , Christopher Cordahi X-Mailer: b4 0.14.2 X-GND-Sasl: bastien.curutchet@bootlin.com For each NAND_OP_WAITRDY_INSTR operation, the NANDFSR register is polled only once every 100 us to check for the EMA_WAIT pin. This isn't frequent enough and causes delays in NAND accesses. Set the polling interval to 0s. It increases the page read speed reported by flash_speed by ~40% (~30% on page writes). --- Signed-off-by: Bastien Curutchet --- drivers/mtd/nand/raw/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/dav= inci_nand.c index 1f8354acfb50b2f4d155cdfc03afcf2863539f66..b3fe6f62bb3bd6a51da891c604d= 38142055ab1d3 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -724,7 +724,7 @@ static int davinci_nand_exec_instr(struct davinci_nand_= info *info, case NAND_OP_WAITRDY_INSTR: timeout_us =3D instr->ctx.waitrdy.timeout_ms * 1000; ret =3D readl_relaxed_poll_timeout(info->base + NANDFSR_OFFSET, - status, status & BIT(0), 100, + status, status & BIT(0), 0, timeout_us); if (ret) return ret; --- base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37 change-id: 20241219-patch-nand-poll-b215766ea0a2 Best regards, --=20 Bastien Curutchet