mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] spi: axi-spi-engine: fix stale SYNC IRQ pending
@ 2026-10-07  8:52 Jonathan Santos
  2026-10-07  8:52 ` [PATCH v3 1/2] " Jonathan Santos
  2026-10-07  8:52 ` [PATCH v3 2/2] spi: axi-spi-engine: fix stale SYNC IRQ pending in trigger_enable Jonathan Santos
  0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Santos @ 2026-10-07  8:52 UTC (permalink / raw)
  To: linux-kernel, linux-spi
  Cc: Jonathan Santos, dlechner, broonie, nuno.sa, michael.hennerich,
	jonath4nns, andriy.shevchenko

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.

v3 summary:
* Added a dummy read after the clear command to flush the posted writes
  before dropping the lock.
* Link to v2: https://lore.kernel.org/linux-spi/cover.1790731588.git.Jonathan.Santos@analog.com/T/#t

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@analog.com/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 | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)


base-commit: 04434a1d0f311d76b1f15fa987918b471a0b8c6a
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-07 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07  8:52 [PATCH v3 0/2] spi: axi-spi-engine: fix stale SYNC IRQ pending Jonathan Santos
2026-10-07  8:52 ` [PATCH v3 1/2] " Jonathan Santos
2026-10-07  8:52 ` [PATCH v3 2/2] spi: axi-spi-engine: fix stale SYNC IRQ pending in trigger_enable Jonathan Santos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®