Re: [PATCH] iommu/amd: Do not call sleep while holding spinlock

From: Joerg Roedel
Date: Thu Apr 28 2022 - 03:56:17 EST


On Sun, Mar 13, 2022 at 09:43:21PM -0500, Suravee Suthikulpanit wrote:
> Smatch static checker warns:
> drivers/iommu/amd/iommu_v2.c:133 free_device_state()
> warn: sleeping in atomic context
>
> Fixes by storing the list of struct device_state in a temporary
> list, and then free the memory after releasing the spinlock.
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Fixes: dc6a709e5123 ("iommu/amd: Improve amd_iommu_v2_exit()")
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> ---
> drivers/iommu/amd/iommu_v2.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)

Applied, thanks Suravee.