Re: [PATCH v2 0/2] spi: axi-spi-engine: fix stale SYNC IRQ pending
From: Nuno Sá
Date: Wed Sep 30 2026 - 08:17:41 EST
On Tue, Sep 29, 2026 at 11:17:06PM -0300, Jonathan Santos wrote:
> Both spi_engine_setup() and spi_engine_trigger_enable() send a SYNC(1)
> command and poll SYNC_ID, but never clear INT_PENDING[SYNC] afterward.
> This leaves a stale pending bit that fires spuriously when INT_SYNC is
> enabled later by some driver, causing premature transfer completion at
> low SPI clock frequencies (more likely). Fix both functions by clearing
> the pending bit after polling.
>
> v2 summary:
> * Replaced "Link" tag for "Closes" tag.
> * Included "Fixes" tag.
> * Added new patch applying similar fix for the spi_engine_trigger_enable(),
> as pointed out by David.
> * While at it, replaced plain "1000" by "1 * USEC_PER_MSEC" for better
> clarity.
> * Link to v1: https://lore.kernel.org/linux-spi/04d51e99b8cddce51113db933d806e83848f04f5.1788313558.git.Jonathan.Santos@xxxxxxxxxx/T/#t
>
> Jonathan Santos (2):
> spi: axi-spi-engine: fix stale SYNC IRQ pending
> spi: axi-spi-engine: fix stale SYNC IRQ pending in trigger_enable
>
> drivers/spi/spi-axi-spi-engine.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
>
> base-commit: a3b3580713f3ac5a32dc2874ee546828977a1d68
> --
> 2.34.1
>
Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>