aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/dmar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r--drivers/pci/dmar.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 577956566a0b..63aa52973d4d 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -1040,6 +1040,7 @@ static void __dmar_enable_qi(struct intel_iommu *iommu)
1040int dmar_enable_qi(struct intel_iommu *iommu) 1040int dmar_enable_qi(struct intel_iommu *iommu)
1041{ 1041{
1042 struct q_inval *qi; 1042 struct q_inval *qi;
1043 struct page *desc_page;
1043 1044
1044 if (!ecap_qis(iommu->ecap)) 1045 if (!ecap_qis(iommu->ecap))
1045 return -ENOENT; 1046 return -ENOENT;
@@ -1056,13 +1057,16 @@ int dmar_enable_qi(struct intel_iommu *iommu)
1056 1057
1057 qi = iommu->qi; 1058 qi = iommu->qi;
1058 1059
1059 qi->desc = (void *)(get_zeroed_page(GFP_ATOMIC)); 1060
1060 if (!qi->desc) { 1061 desc_page = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO, 0);
1062 if (!desc_page) {
1061 kfree(qi); 1063 kfree(qi);
1062 iommu->qi = 0; 1064 iommu->qi = 0;
1063 return -ENOMEM; 1065 return -ENOMEM;
1064 } 1066 }
1065 1067
1068 qi->desc = page_address(desc_page);
1069
1066 qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC); 1070 qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC);
1067 if (!qi->desc_status) { 1071 if (!qi->desc_status) {
1068 free_page((unsigned long) qi->desc); 1072 free_page((unsigned long) qi->desc);