* [PATCH] spi: zynq-qspi: Remove redundant clock enables in setup
@ 2026-05-25 17:46 Gaetan Florio
2026-05-26 16:30 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Gaetan Florio @ 2026-05-25 17:46 UTC (permalink / raw)
To: broonie
Cc: michal.simek, linux-spi, linux-arm-kernel, linux-kernel,
Gaetan Florio
The QSPI clocks are already enabled in probe() with clk_prepare_enable().
zynq_qspi_setup_op() enables them again with clk_enable(), but the extra
enable is never balanced. This leaves the clock enable count elevated and
can trigger warnings when unbinding the driver.
Remove the redundant clock enables from the setup callback.
Signed-off-by: Gaetan Florio <gaetansjo@gmail.com>
---
drivers/spi/spi-zynq-qspi.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index 5f23e902b..2aa2c9621 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -437,21 +437,10 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
{
struct spi_controller *ctlr = spi->controller;
struct zynq_qspi *qspi = spi_controller_get_devdata(ctlr);
- int ret;
if (ctlr->busy)
return -EBUSY;
- ret = clk_enable(qspi->refclk);
- if (ret)
- return ret;
-
- ret = clk_enable(qspi->pclk);
- if (ret) {
- clk_disable(qspi->refclk);
- return ret;
- }
-
zynq_qspi_write(qspi, ZYNQ_QSPI_ENABLE_OFFSET,
ZYNQ_QSPI_ENABLE_ENABLE_MASK);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] spi: zynq-qspi: Remove redundant clock enables in setup
2026-05-25 17:46 [PATCH] spi: zynq-qspi: Remove redundant clock enables in setup Gaetan Florio
@ 2026-05-26 16:30 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-05-26 16:30 UTC (permalink / raw)
To: Gaetan Florio; +Cc: michal.simek, linux-spi, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
On Mon, May 25, 2026 at 01:46:14PM -0400, Gaetan Florio wrote:
> The QSPI clocks are already enabled in probe() with clk_prepare_enable().
> zynq_qspi_setup_op() enables them again with clk_enable(), but the extra
> enable is never balanced. This leaves the clock enable count elevated and
> can trigger warnings when unbinding the driver.
This doesn't apply against current code, please check and resend - there
was a recent fix here so I think the issue is already fixed.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-26 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25 17:46 [PATCH] spi: zynq-qspi: Remove redundant clock enables in setup Gaetan Florio
2026-05-26 16:30 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox