Skip to content

Commit a0c8bf0

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Fix sleeping in atomic context
Commit cf70873 ("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: cf70873 ("iommu/amd: Refactor GCR3 table helper functions") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 0feda94 commit a0c8bf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ static int setup_gcr3_table(struct gcr3_tbl_info *gcr3_info,
17931793
/* Allocate per device domain ID */
17941794
gcr3_info->domid = domain_id_alloc();
17951795

1796-
gcr3_info->gcr3_tbl = alloc_pgtable_page(nid, GFP_KERNEL);
1796+
gcr3_info->gcr3_tbl = alloc_pgtable_page(nid, GFP_ATOMIC);
17971797
if (gcr3_info->gcr3_tbl == NULL) {
17981798
domain_id_free(gcr3_info->domid);
17991799
return -ENOMEM;

0 commit comments

Comments
 (0)