]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/amd: move wait_on_sem() out of spinlock
authorAnkit Soni <Ankit.Soni@amd.com>
Mon, 1 Dec 2025 14:39:40 +0000 (14:39 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Sat, 10 Jan 2026 09:54:38 +0000 (10:54 +0100)
commitd2a0cac10597068567d336e85fa3cbdbe8ca62bf
treeddbce9e725f59690aa523a1d3290104553ab6e59
parent9ace4753a5202b02191d54e9fdf7f9e3d02b85eb
iommu/amd: move wait_on_sem() out of spinlock

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@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/iommu.c