* [PATCH] iommu/amd: Fix sleeping in atomic context
@ 2024-03-07 5:27 Vasant Hegde
2024-03-08 7:58 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Vasant Hegde @ 2024-03-07 5:27 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde, Dan Carpenter
Commit cf70873e3d01 ("iommu/amd: Refactor GCR3 table helper functions")
changed GFP flag we use for GCR3 table. Original plan was to move GCR3
table allocation outside spinlock. But this requires complete rework of
attach device path. Hence we didn't do it as part of SVA series. For now
revert the GFP flag to ATOMIC (same as original code).
Fixes: cf70873e3d01 ("iommu/amd: Refactor GCR3 table helper functions")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
---
drivers/iommu/amd/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index f688443c2764..d35c1b8c8e65 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -1793,7 +1793,7 @@ static int setup_gcr3_table(struct gcr3_tbl_info *gcr3_info,
/* Allocate per device domain ID */
gcr3_info->domid = domain_id_alloc();
- gcr3_info->gcr3_tbl = alloc_pgtable_page(nid, GFP_KERNEL);
+ gcr3_info->gcr3_tbl = alloc_pgtable_page(nid, GFP_ATOMIC);
if (gcr3_info->gcr3_tbl == NULL) {
domain_id_free(gcr3_info->domid);
return -ENOMEM;
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iommu/amd: Fix sleeping in atomic context
2024-03-07 5:27 [PATCH] iommu/amd: Fix sleeping in atomic context Vasant Hegde
@ 2024-03-08 7:58 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2024-03-08 7:58 UTC (permalink / raw)
To: Vasant Hegde; +Cc: iommu, suravee.suthikulpanit, Dan Carpenter
On Thu, Mar 07, 2024 at 05:27:38AM +0000, Vasant Hegde wrote:
> Commit cf70873e3d01 ("iommu/amd: Refactor GCR3 table helper functions")
> changed GFP flag we use for GCR3 table. Original plan was to move GCR3
> table allocation outside spinlock. But this requires complete rework of
> attach device path. Hence we didn't do it as part of SVA series. For now
> revert the GFP flag to ATOMIC (same as original code).
>
> Fixes: cf70873e3d01 ("iommu/amd: Refactor GCR3 table helper functions")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
> ---
> drivers/iommu/amd/iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-08 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07 5:27 [PATCH] iommu/amd: Fix sleeping in atomic context Vasant Hegde
2024-03-08 7:58 ` Joerg Roedel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.