DMA Engine development
 help / color / mirror / Atom feed
* [PATCH v4 0/9] dmaengine: sun6i: fix interrupt routing and channel lifetime
@ 2026-11-15  9:32 James Hilliard
  2026-11-15  9:32 ` [PATCH v4 1/9] dmaengine: sun6i: fix physical channel index in interrupt handler James Hilliard
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: James Hilliard @ 2026-11-15  9:32 UTC (permalink / raw)
  To: Vinod Koul, Frank Li, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Arnd Bergmann, Maxime Ripard, Jens Kuske,
	Jean-Francois Moine
  Cc: Hongling Zeng, Chengfeng Ye, Nguyen Minh Tien, dmaengine,
	linux-arm-kernel, linux-sunxi, linux-kernel, James Hilliard,
	stable, Frank Li, Sashiko

Correct interrupt routing and serialize physical-channel ownership across
allocation, completion, pause and termination. Keep paused virtual channels
off the allocator, drain completion callbacks before releasing resources,
and associate cyclic state with the descriptor that owns it.

The first patch carries Hongling Zeng's physical-channel indexing fix [0],
adapted to the configurable interrupt-bank size introduced for A733. The
second handles partially populated banks, including H3's twelve channels.
The ownership work is split into lock ordering, physical-channel locking,
completed-descriptor retirement and interrupt cleanup. Pause bookkeeping,
callback synchronization and per-descriptor cyclic state follow separately.

Based on DMAengine next at 6628e7d4c6b, with the posted IRQ-safe locking
fix [1], channel pause-bit fix [2], and shared virt-dma synchronization
helper [3] applied first. The synchronization patch uses that helper for
the sun6i device_synchronize callback.

[0] https://lore.kernel.org/r/20260706064123.66035-1-zenghongling@kylinos.cn
[1] https://lore.kernel.org/r/20260926171049.841335-1-tien.nguyenminh@embeddedlinux.blog
[2] https://lore.kernel.org/r/20261021-submit-sun6i-dma-pause-bit-v1-v1-1-38d286b69dab@gmail.com
[3] https://lore.kernel.org/r/20261027-submit-mtk-uart-dma-synchronize-v1-v3-1-aad7a6b3c62e@gmail.com

Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes in v4:
- Explain that reading the pause register flushes the MMIO request
  before returning to the client, following Frank's review.
- Collect Frank's Reviewed-by tags on the interrupt-bank, lock-ordering,
  ownership, completion, interrupt-retirement, synchronization and
  cyclic-mode patches.
- Rebase onto current DMAengine next, retaining the upstream residue
  snapshot and NULL-descriptor fixes.
- Use the standalone shared virt-dma helper from MediaTek synchronization
  v3 as a prerequisite.
- Link to v3: https://patch.msgid.link/20261023-submit-sun6i-dma-lifetime-next-v1-v3-0-ef1acb0be768@gmail.com

Changes in v3:
- Split the ownership patch into four commits covering lock ordering,
  physical-channel locking, completed-descriptor retirement and interrupt
  cleanup, following Frank Li's review.
- Document why virt-dma still takes vc.lock independently of sdev->lock.
- Check pending interrupt status first in the per-bank loop condition.
- Link to v2: https://lore.kernel.org/r/20261023-submit-sun6i-dma-lifetime-next-v1-v2-0-c9e07cc44bf8@gmail.com

Changes in v2:
- Clear the active descriptor pointer before handing finite completion to
  virt-dma, replacing the completed-descriptor pointer.
- Release completed physical channels while their virtual channels remain
  paused, and clear the hardware pause request before reassignment.
- Keep the ownership changes in patch 3 and the pause policy in patch 4.
- Link to v1: https://lore.kernel.org/r/20261022-submit-sun6i-dma-lifetime-next-v1-v1-0-01085f684c9f@gmail.com

To: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.Li@kernel.org>
To: Chen-Yu Tsai <wens@kernel.org>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Samuel Holland <samuel@sholland.org>
To: Arnd Bergmann <arnd@arndb.de>
To: Maxime Ripard <mripard@kernel.org>
To: Jens Kuske <jenskuske@gmail.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: dmaengine@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-sunxi@lists.linux.dev
Cc: linux-kernel@vger.kernel.org

---
Hongling Zeng (1):
      dmaengine: sun6i: fix physical channel index in interrupt handler

James Hilliard (8):
      dmaengine: sun6i: handle the last partial interrupt bank
      dmaengine: sun6i: take the device lock before the virtual channel lock
      dmaengine: sun6i: serialize physical channel ownership
      dmaengine: sun6i: detach completed descriptors before invoking callbacks
      dmaengine: sun6i: retire interrupt state before reusing physical channels
      dmaengine: sun6i: track paused virtual channels
      dmaengine: sun6i: synchronize callbacks before releasing channel resources
      dmaengine: sun6i: keep cyclic state with the prepared descriptor

 drivers/dma/sun6i-dma.c | 184 ++++++++++++++++++++++++++++--------------------
 1 file changed, 107 insertions(+), 77 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261022-submit-sun6i-dma-lifetime-next-v1-53c3158f4841
prerequisite-patch-id: d6398447647aa0dbb005b5e6dc6ba96e642efa86
prerequisite-patch-id: f67c1f8d8d9e014cc650f2f37648662430c3b77b
prerequisite-patch-id: 43704b0efab7679ada5f06b959a501040573409a

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>


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

end of thread, other threads:[~2026-11-18 20:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15  9:32 [PATCH v4 0/9] dmaengine: sun6i: fix interrupt routing and channel lifetime James Hilliard
2026-11-15  9:32 ` [PATCH v4 1/9] dmaengine: sun6i: fix physical channel index in interrupt handler James Hilliard
2026-11-15  9:32 ` [PATCH v4 2/9] dmaengine: sun6i: handle the last partial interrupt bank James Hilliard
2026-11-18 20:06   ` Frank Li
2026-11-15  9:32 ` [PATCH v4 3/9] dmaengine: sun6i: take the device lock before the virtual channel lock James Hilliard
2026-11-15  9:32 ` [PATCH v4 4/9] dmaengine: sun6i: serialize physical channel ownership James Hilliard
2026-11-15  9:32 ` [PATCH v4 5/9] dmaengine: sun6i: detach completed descriptors before invoking callbacks James Hilliard
2026-11-15  9:32 ` [PATCH v4 6/9] dmaengine: sun6i: retire interrupt state before reusing physical channels James Hilliard
2026-11-15  9:32 ` [PATCH v4 7/9] dmaengine: sun6i: track paused virtual channels James Hilliard
2026-11-18 20:08   ` Frank Li
2026-11-15  9:32 ` [PATCH v4 8/9] dmaengine: sun6i: synchronize callbacks before releasing channel resources James Hilliard
2026-11-15  9:32 ` [PATCH v4 9/9] dmaengine: sun6i: keep cyclic state with the prepared descriptor James Hilliard

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