From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795629150; b=jV1zkJuGWKZR4K7J3EIbpHVYnJkgqhYHGnkyeuKErd7QP6qtFhEdnuCHbFMDuMJsDIGF HaKl3cJEbFkkvym9S5NhZ4IxTPOLB9BgKKhLHOfMjNP5pzgsrNiUFyYSa4RluUA4LMopw 8ffg6DFNsacemcLTC5+El//HIVMzjua5qlid+4nLj5Gc/lrgcrbUZgnrwXJgedMmVZzkl RJSMJOhcUCuU+jMrhr4sHVdtV5A4LrYaiDVHKySI0/g8ehdPeypYfOqcFvYdju9p3ykrY hs/BmwNu90KFzHswoFRQqi0282RdsVRpvMGcFwFoojZsLpNqE8VvF2RsErddJugIf/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795629150; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Last-TLS-Session-Version; bh=/akqnAhi4N7PD9g+GVLxR2YwtuVfsoR7dj296LmnLrw=; b=36xHK+ui0Zr1jKbrzqpmXFZ/AYaYWIJhOqnny3u7PT6N5if2+4wxy7YMxyT9gmGdmi1+ CdkPyYShBLTWrVVd2qvqd6xmWFCsRp0yS/KZCyX4F2ZTbW3dx4whgdowgDi72iQo13qVt BYDGh3BoNFVTT2w0ffQOInAw/3lqxkBq/uZhF2DkKeYCyHDWZBNCcEd8ibV92Gn73l+5n JnTdAwglthPMlGYGm+3Lke+wDkOSdq5nymXeouxy+6UJWs0VC9CAOEU6CYIv+s52cJ6uY Jm9mid677o+v7rOs6kATR2w2HYPekfMsT5ric71ISRBtp8JVCpjbt7vpvxI/AGI35Ow== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=pf4YnvL8; arc=none smtp.remote-ip=185.246.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09BDF606A338 for ; Wed, 25 Nov 2026 17:52:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 09BDF606A338 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.a=rsa-sha256 header.s=dkim header.b=pf4YnvL8 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id C64451A17FB; Wed, 25 Nov 2026 17:52:28 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 90D9560480; Wed, 25 Nov 2026 17:52:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0C27511E6B0C5; Wed, 25 Nov 2026 18:52:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795629144; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=/akqnAhi4N7PD9g+GVLxR2YwtuVfsoR7dj296LmnLrw=; b=pf4YnvL81dMdsb97g/DQYIk8S9HhrDd4MopcjKOnJrLk++4gDNxi8ouoGlm+etBpI+eNsm 84kN9Gobi+rboeZZbVRrV9II7pZ3wim23o3nrwLX4Ipr8yV2ZnITsCfsulHi00yvnAdSvT 4zCDhBrhcLMAb6o7mNIEktEPOxK+Zg2SUvMbAAR1Gr0IjsLPJH6k2GJgzfbwyXJk+3uQ3n cc4MJvqLbwDQeN8MWqKkZ01Yl8RwYhiNWZM7HsrHys7d42/5fEo1G+qaHmtgzHXEJ7Es/Z TMKEl1nZxy+PDtSa4hopGIy2EW4pfDUzWPMoDQdClp4exUj3CgNW1VFdoBSTyg== From: Miquel Raynal Date: Wed, 25 Nov 2026 18:51:22 +0100 Subject: [PATCH RFC 08/16] spi: fsl-qspi: Consume dummy cycles directly X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261125-macronix-upstreaming-spi-mem-cycles-v1-8-fd036402fd37@bootlin.com> References: <20261125-macronix-upstreaming-spi-mem-cycles-v1-0-fd036402fd37@bootlin.com> In-Reply-To: <20261125-macronix-upstreaming-spi-mem-cycles-v1-0-fd036402fd37@bootlin.com> To: Mark Brown , Liang Yang , Feng Chen , Xianwei Zhao , Han Xu , Conor Dooley , Valentina Fernandez , Daire McNamara , Haibo Chen , Jyan Chou , Yu-Chun Lin , Maxime Coquelin , Alexandre Torgue , Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Alvin Zhou , Cheng Ming Lin , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, imx@lists.linux.dev, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The spi-mem layer is now capable of providing the dummy phase in cycle units rather than bytes, provided that drivers advertize the dummy_cycle capability. Since this controller is consuming cycles and currently converts bytes into cycles, flag it capable to consume cycles directly and drop the extra conversions. Signed-off-by: Miquel Raynal --- drivers/spi/spi-fsl-qspi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index d2c2090442f8..a1d6357e3203 100644 --- a/drivers/spi/spi-fsl-qspi.c +++ b/drivers/spi/spi-fsl-qspi.c @@ -399,7 +399,7 @@ static bool fsl_qspi_supports_op(struct spi_mem *mem, if (op->addr.nbytes) ret |= fsl_qspi_check_buswidth(q, op->addr.buswidth); - if (op->dummy.nbytes) + if (op->dummy.ncycles) ret |= fsl_qspi_check_buswidth(q, op->dummy.buswidth); if (op->data.nbytes) @@ -413,13 +413,12 @@ static bool fsl_qspi_supports_op(struct spi_mem *mem, * to fit into a single LUT entry. */ if (op->addr.nbytes + - (op->dummy.nbytes ? 1:0) + + (op->dummy.ncycles ? 1:0) + (op->data.nbytes ? 1:0) > 6) return false; /* Max 64 dummy clock cycles supported */ - if (op->dummy.nbytes && - (op->dummy.nbytes * 8 / op->dummy.buswidth > 64)) + if (op->dummy.ncycles > 64) return false; /* Max data length, check controller limits and alignment */ @@ -460,11 +459,10 @@ static void fsl_qspi_prepare_lut(struct fsl_qspi *q, lutidx++; } - if (op->dummy.nbytes) { + if (op->dummy.ncycles) { lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_DUMMY, LUT_PAD(op->dummy.buswidth), - op->dummy.nbytes * 8 / - op->dummy.buswidth); + op->dummy.ncycles); lutidx++; } -- 2.56.0