diff options
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r-- | drivers/pci/dmar.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index fa3a11365ec3..d3d86b749eee 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c | |||
@@ -515,6 +515,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd) | |||
515 | u32 ver; | 515 | u32 ver; |
516 | static int iommu_allocated = 0; | 516 | static int iommu_allocated = 0; |
517 | int agaw = 0; | 517 | int agaw = 0; |
518 | int msagaw = 0; | ||
518 | 519 | ||
519 | iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); | 520 | iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); |
520 | if (!iommu) | 521 | if (!iommu) |
@@ -535,12 +536,20 @@ int alloc_iommu(struct dmar_drhd_unit *drhd) | |||
535 | agaw = iommu_calculate_agaw(iommu); | 536 | agaw = iommu_calculate_agaw(iommu); |
536 | if (agaw < 0) { | 537 | if (agaw < 0) { |
537 | printk(KERN_ERR | 538 | printk(KERN_ERR |
538 | "Cannot get a valid agaw for iommu (seq_id = %d)\n", | 539 | "Cannot get a valid agaw for iommu (seq_id = %d)\n", |
540 | iommu->seq_id); | ||
541 | goto error; | ||
542 | } | ||
543 | msagaw = iommu_calculate_max_sagaw(iommu); | ||
544 | if (msagaw < 0) { | ||
545 | printk(KERN_ERR | ||
546 | "Cannot get a valid max agaw for iommu (seq_id = %d)\n", | ||
539 | iommu->seq_id); | 547 | iommu->seq_id); |
540 | goto error; | 548 | goto error; |
541 | } | 549 | } |
542 | #endif | 550 | #endif |
543 | iommu->agaw = agaw; | 551 | iommu->agaw = agaw; |
552 | iommu->msagaw = msagaw; | ||
544 | 553 | ||
545 | /* the registers might be more than one page */ | 554 | /* the registers might be more than one page */ |
546 | map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), | 555 | map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), |