Re: [PATCH v3] dmaengine: pl330: Fix unbalanced runtime PM
From: Mizuno Miotsuki
Date: Fri Oct 16 2026 - 19:39:38 EST
Hi Frank,
Thanks for taking another look.
I think the interleaving you described is already prevented by
pch->lock.
Both pl330_tasklet() and pl330_terminate_all() check pch->active
and clear it while holding the same lock. Whichever gets the lock
first can claim the PM put, and the other should then see
pch->active == false.
The actual pm_runtime_put_autosuspend() calls happen after
releasing the lock, but the decision to make each call is still
protected by it.
The issue this patch addresses is that the tasklet currently sets
power_down unconditionally when work_list is empty. If
terminate_all() has already cleared pch->active and released the
PM reference, the tasklet can still issue another put.
I agree there may be other synchronization issues around
issue_pending() and tasklet callbacks, and I don't mean to claim
this patch fixes all of them.
But I don't see how both paths in your example could observe
pch->active == true for the same activation. Am I missing another
interleaving?
Thanks,
Mizuno