diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2009-03-16 20:05:05 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-03-17 19:49:30 -0400 |
commit | fa4b57cc045d6134b9862b2873f9c8ba9ed53ffe (patch) | |
tree | 7c31d15426e29d86314545be3cf9553ab91ef574 | |
parent | 68a8ca593fac82e336a792226272455901fa83df (diff) |
x86, dmar: use atomic allocations for QI and Intr-remapping init
Impact: invalid use of GFP_KERNEL in interrupt context
Queued invalidation and interrupt-remapping will get initialized with
interrupts disabled (while enabling interrupt-remapping). So use
GFP_ATOMIC instead of GFP_KERNEL for memory alloacations.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | drivers/pci/dmar.c | 6 | ||||
-rw-r--r-- | drivers/pci/intr_remapping.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index f1805002e436..d313039e2fdf 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c | |||
@@ -809,20 +809,20 @@ int dmar_enable_qi(struct intel_iommu *iommu) | |||
809 | if (iommu->qi) | 809 | if (iommu->qi) |
810 | return 0; | 810 | return 0; |
811 | 811 | ||
812 | iommu->qi = kmalloc(sizeof(*qi), GFP_KERNEL); | 812 | iommu->qi = kmalloc(sizeof(*qi), GFP_ATOMIC); |
813 | if (!iommu->qi) | 813 | if (!iommu->qi) |
814 | return -ENOMEM; | 814 | return -ENOMEM; |
815 | 815 | ||
816 | qi = iommu->qi; | 816 | qi = iommu->qi; |
817 | 817 | ||
818 | qi->desc = (void *)(get_zeroed_page(GFP_KERNEL)); | 818 | qi->desc = (void *)(get_zeroed_page(GFP_ATOMIC)); |
819 | if (!qi->desc) { | 819 | if (!qi->desc) { |
820 | kfree(qi); | 820 | kfree(qi); |
821 | iommu->qi = 0; | 821 | iommu->qi = 0; |
822 | return -ENOMEM; | 822 | return -ENOMEM; |
823 | } | 823 | } |
824 | 824 | ||
825 | qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_KERNEL); | 825 | qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC); |
826 | if (!qi->desc_status) { | 826 | if (!qi->desc_status) { |
827 | free_page((unsigned long) qi->desc); | 827 | free_page((unsigned long) qi->desc); |
828 | kfree(qi); | 828 | kfree(qi); |
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index f7ecd85e2104..bc5b6976f918 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c | |||
@@ -447,12 +447,12 @@ static int setup_intr_remapping(struct intel_iommu *iommu, int mode) | |||
447 | struct page *pages; | 447 | struct page *pages; |
448 | 448 | ||
449 | ir_table = iommu->ir_table = kzalloc(sizeof(struct ir_table), | 449 | ir_table = iommu->ir_table = kzalloc(sizeof(struct ir_table), |
450 | GFP_KERNEL); | 450 | GFP_ATOMIC); |
451 | 451 | ||
452 | if (!iommu->ir_table) | 452 | if (!iommu->ir_table) |
453 | return -ENOMEM; | 453 | return -ENOMEM; |
454 | 454 | ||
455 | pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, INTR_REMAP_PAGE_ORDER); | 455 | pages = alloc_pages(GFP_ATOMIC | __GFP_ZERO, INTR_REMAP_PAGE_ORDER); |
456 | 456 | ||
457 | if (!pages) { | 457 | if (!pages) { |
458 | printk(KERN_ERR "failed to allocate pages of order %d\n", | 458 | printk(KERN_ERR "failed to allocate pages of order %d\n", |