aboutsummaryrefslogtreecommitdiff
path: root/drivers/iommu/amd
diff options
context:
space:
mode:
authorGravatar Vasant Hegde <vasant.hegde@amd.com> 2024-03-07 05:27:38 +0000
committerGravatar Joerg Roedel <jroedel@suse.de> 2024-03-08 08:58:24 +0100
commita0c8bf0a474eea8ee2590332a1ebdec6048ce40c (patch)
tree5445b2416c08784f31b149aef32abd0eb89d53e7 /drivers/iommu/amd
parentiommu/amd: Mark interrupt as managed (diff)
downloadlinux-a0c8bf0a474eea8ee2590332a1ebdec6048ce40c.tar.gz
linux-a0c8bf0a474eea8ee2590332a1ebdec6048ce40c.tar.bz2
linux-a0c8bf0a474eea8ee2590332a1ebdec6048ce40c.zip
iommu/amd: Fix sleeping in atomic context
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> Link: https://lore.kernel.org/r/20240307052738.116035-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd')
-rw-r--r--drivers/iommu/amd/iommu.c2
1 files changed, 1 insertions, 1 deletions
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;