From nobody Fri Dec 19 04:58:53 2025 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 B1E321917ED for ; Fri, 3 Jan 2025 08:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735892041; cv=none; b=MTzxmU/MUlpvHOvl4zsEBvRFmpiZTSwvvexMeMCJE5XGHhF2aOcopi+V3h9+P4DowMEXp3zJU63my9F/1hK+ubVYbOFtJqBenDPf8Cj55HtjwnAxamJjc/QXGh88PigMCjybb/eMO1mdCCE3JgMCNiCfBQ5jcMYbNMN/V9afQw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735892041; c=relaxed/simple; bh=d0FfElscvPTxdy1NbxirCrMJ5rj70H2MzKMmhQbOo+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Sm3jVpmXDNcNX0TWKYpk7mlG5FH/NjQ5JFU2qUU+LBml2CNVLCR5ILkrqUtoPHrPl+0n8tr3BUZUEOP6yZwenJVoEGWiMzBbW0NF7KMw9AV/IrehUdPTGRCArMnVVerjkYc5ODvlv/948AbRHh2ISwv+TUiSOwKlPKDJUfyl8gQ= 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=NDvXwsYO; arc=none smtp.client-ip=217.70.183.200 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="NDvXwsYO" Received: by mail.gandi.net (Postfix) with ESMTPSA id 0F2B720003; Fri, 3 Jan 2025 08:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1735892036; 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=fOxLl3JdFX4IELuFKgWw+PeYYO1bQeEIihumJcyavt0=; b=NDvXwsYOUZR0PtMI0sk34jgoNty37h9+smr1Z9DwjljyuGSQ4G4f9ULQFWhrHkJF6lzWDz K09HxJvKVayFO4filMMzjrBVpdI9PqbE3L5/gvCo5xLeTYBLvM06xG2E4XS2VczuNJdPXh tYUJ7pEz6q6SmoiTLZ01EXNxNyfUeM3UJrK0By/z0ZWtJ6BmwHCMhd0JUpazXIXNGY9IKN n6VLXCnIay5Wx7jx9LxfyBwRphWesjYGbfdHPKv00HHF05bI4JeH9ccuLwGj4VT5wY8ET/ CAWScUSPrrYyOWJk65E39kziBdncwmcklX02V7MP+hgTTgk8Cc1cHK4UPLK3jQ== From: Bastien Curutchet Date: Fri, 03 Jan 2025 09:13:49 +0100 Subject: [PATCH v3] 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: <20250103-patch-nand-poll-v3-1-c85ca7bc54bd@bootlin.com> X-B4-Tracking: v=1; b=H4sIADycd2cC/4XNTQ6CMBCG4auQWVvTGSn+rLyHcVHKVJpgS1rSa Ah3t7BzYVy+XzLPzJA4Ok5wqWaInF1ywZc47CowvfYPFq4rDSSpRsKzGPVkeuG178QYhkG0hOr YNKylJihXY2TrXpt4u5fuXZpCfG8PMq7rbyujQNFIxcqislTraxvCNDi/N+EJq5bpj0BFMOYkN TLXLO23sCzLB9DHCuXyAAAA 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 5 us. It increases the page read speed reported by flash_speed by ~30% (~10% on page writes). Signed-off-by: Bastien Curutchet --- Changes in v3: - Set poll interval to 5 us (instead of 0). - Link to v2: https://lore.kernel.org/r/20241219-patch-nand-poll-v2-1-cc80a= 1ee4e0f@bootlin.com Changes in v2: - Fix SOB. - Link to v1: https://lore.kernel.org/r/20241219-patch-nand-poll-v1-1-605e5= f15f24a@bootlin.com --- 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..1a6c3b02a2c503f89ed54d557c6= d181b68ce0fc8 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), 5, timeout_us); if (ret) return ret; --- base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37 change-id: 20241219-patch-nand-poll-b215766ea0a2 Best regards, --=20 Bastien Curutchet