All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] spi: qcom-geni: Add shutdown and panic notifier support
@ 2026-08-18 13:28 Praveen Talari
  2026-08-18 13:28 ` [PATCH v3 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot Praveen Talari
  2026-08-18 13:28 ` [PATCH v3 2/2] spi: qcom-geni: Add panic notifier to cancel and reset DMA during panic Praveen Talari
  0 siblings, 2 replies; 10+ messages in thread
From: Praveen Talari @ 2026-08-18 13:28 UTC (permalink / raw)
  To: konrad.dybcio, Mark Brown
  Cc: mukesh.savaliya, linux-arm-msm, linux-spi, linux-kernel,
	chandana.chiluveru, Praveen Talari

On VM-based platforms, if an SPI DMA transfer is in progress when the
guest is torn down (via reboot/shutdown or a panic/crash), the DMA
engine can keep issuing transactions to IOVAs that have already been
invalidated as part of teardown. The SMMU then raises context faults,
which can affect other VMs sharing the same SMMU instance and obscure
the real root cause of the crash.

This series adds two independent quiesce paths for the GENI SPI
controller so that any in-progress transfer is stopped and the DMA
engine is left idle before the IOVA mappings are torn down:

- Patch 1 adds a platform shutdown() callback that suspends the SPI
  controller (via spi_controller_suspend()) on a normal
  reboot/shutdown path, where sleeping is safe.

- Patch 2 registers a panic notifier that cancels/aborts the
  in-flight command and resets the TX/RX DMA FSMs (or terminates the
  GPI DMA channels) when the kernel panics, covering the crash path
  as well. The notifier bails out early if the device is not
  runtime-active or has no active command, and otherwise uses
  readl_poll_timeout_atomic() to poll status registers directly
  instead of waiting on completions/IRQs like the regular
  error-handling path does, since panic notifiers run with IRQs and
  preemption disabled. The notifier is registered before
  devm_spi_register_controller() so a panic during child device
  probing is still handled.

Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
---
Changes in v3:
- Rebased on linux-next tip (next-20260817).
- Link to v2: https://patch.msgid.link/20260818-add-shutdown-and-panic-notifier-for-spi-v2-0-eb25d56634a0@oss.qualcomm.com

Changes in v2:
- Patch 2: instead of just disabling the SPI IRQ (or suspending the
  controller, which is unsafe in panic context), actively cancel/abort
  the in-flight command and reset the TX/RX DMA FSMs (or terminate the
  GPI DMA channels) using atomic-safe register polling
  (readl_poll_timeout_atomic()), so the DMA engine is actually left
  idle rather than just having its completion interrupt masked.
- Patch 2: skip the quiesce sequence entirely if the device is not
  runtime-active (pm_runtime_active()) or if there's no active GENI
  command, to avoid touching registers on a clock-gated SE.
- Patch 2: register the panic notifier before
  devm_spi_register_controller() so a panic during child SPI device
  probing is still caught.
- Link to v1: https://patch.msgid.link/20260805-add-shutdown-and-panic-notifier-for-spi-v1-0-b5db170d491e@oss.qualcomm.com

---
Praveen Talari (2):
      spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot
      spi: qcom-geni: Add panic notifier to cancel and reset DMA during panic

 drivers/spi/spi-geni-qcom.c | 78 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)
---
base-commit: e6664f2b33db9b6811eb4cec109f06cb2b4f458d
change-id: 20260804-add-shutdown-and-panic-notifier-for-spi-fa732be7c7dd

Best regards,
--  
Praveen Talari <praveen.talari@oss.qualcomm.com>


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

end of thread, other threads:[~2026-08-21 15:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 13:28 [PATCH v3 0/2] spi: qcom-geni: Add shutdown and panic notifier support Praveen Talari
2026-08-18 13:28 ` [PATCH v3 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot Praveen Talari
2026-08-19 18:46   ` Mukesh Savaliya
2026-08-21 10:29   ` Jyothi Kumar Seerapu
2026-08-21 15:56     ` Praveen Talari
2026-08-18 13:28 ` [PATCH v3 2/2] spi: qcom-geni: Add panic notifier to cancel and reset DMA during panic Praveen Talari
2026-08-19 19:32   ` Mukesh Savaliya
2026-08-21  9:55     ` Praveen Talari
2026-08-21 10:49   ` Jyothi Kumar Seerapu
2026-08-21 15:51     ` Praveen Talari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.