diff options
-rw-r--r-- | arch/s390/pci/pci_dma.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 2125310aa891..7e5573acb063 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/export.h> | 10 | #include <linux/export.h> |
11 | #include <linux/iommu-helper.h> | 11 | #include <linux/iommu-helper.h> |
12 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
13 | #include <linux/vmalloc.h> | ||
13 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
14 | #include <asm/pci_dma.h> | 15 | #include <asm/pci_dma.h> |
15 | 16 | ||
@@ -407,7 +408,6 @@ static void s390_dma_unmap_sg(struct device *dev, struct scatterlist *sg, | |||
407 | 408 | ||
408 | int zpci_dma_init_device(struct zpci_dev *zdev) | 409 | int zpci_dma_init_device(struct zpci_dev *zdev) |
409 | { | 410 | { |
410 | unsigned int bitmap_order; | ||
411 | int rc; | 411 | int rc; |
412 | 412 | ||
413 | spin_lock_init(&zdev->iommu_bitmap_lock); | 413 | spin_lock_init(&zdev->iommu_bitmap_lock); |
@@ -421,12 +421,7 @@ int zpci_dma_init_device(struct zpci_dev *zdev) | |||
421 | 421 | ||
422 | zdev->iommu_size = (unsigned long) high_memory - PAGE_OFFSET; | 422 | zdev->iommu_size = (unsigned long) high_memory - PAGE_OFFSET; |
423 | zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT; | 423 | zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT; |
424 | bitmap_order = get_order(zdev->iommu_pages / 8); | 424 | zdev->iommu_bitmap = vzalloc(zdev->iommu_pages / 8); |
425 | pr_info("iommu_size: 0x%lx iommu_pages: 0x%lx bitmap_order: %i\n", | ||
426 | zdev->iommu_size, zdev->iommu_pages, bitmap_order); | ||
427 | |||
428 | zdev->iommu_bitmap = (void *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, | ||
429 | bitmap_order); | ||
430 | if (!zdev->iommu_bitmap) { | 425 | if (!zdev->iommu_bitmap) { |
431 | rc = -ENOMEM; | 426 | rc = -ENOMEM; |
432 | goto out_reg; | 427 | goto out_reg; |
@@ -451,8 +446,7 @@ void zpci_dma_exit_device(struct zpci_dev *zdev) | |||
451 | { | 446 | { |
452 | zpci_unregister_ioat(zdev, 0); | 447 | zpci_unregister_ioat(zdev, 0); |
453 | dma_cleanup_tables(zdev); | 448 | dma_cleanup_tables(zdev); |
454 | free_pages((unsigned long) zdev->iommu_bitmap, | 449 | vfree(zdev->iommu_bitmap); |
455 | get_order(zdev->iommu_pages / 8)); | ||
456 | zdev->iommu_bitmap = NULL; | 450 | zdev->iommu_bitmap = NULL; |
457 | zdev->next_bit = 0; | 451 | zdev->next_bit = 0; |
458 | } | 452 | } |