Re: [PATCH] iommu/amd: move wait_on_sem() out of spinlock

From: Jörg Rödel

Date: Sat Jan 10 2026 - 04:54:59 EST


On Mon, Dec 01, 2025 at 02:39:40PM +0000, Ankit Soni wrote:
> With iommu.strict=1, the existing completion wait path can cause soft
> lockups under stressed environment, as wait_on_sem() busy-waits under the
> spinlock with interrupts disabled.
>
> Move the completion wait in iommu_completion_wait() out of the spinlock.
> wait_on_sem() only polls the hardware-updated cmd_sem and does not require
> iommu->lock, so holding the lock during the busy wait unnecessarily
> increases contention and extends the time with interrupts disabled.
>
> Signed-off-by: Ankit Soni <Ankit.Soni@xxxxxxx>
> ---
> drivers/iommu/amd/iommu.c | 25 +++++++++++++++++--------
> 1 file changed, 17 insertions(+), 8 deletions(-)

Applied, thanks.