From 5ac7f0e3f8e62802a58bca777a2fea835a0bd032 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 12 Jun 2012 16:51:12 +0200 Subject: [PATCH] --- yaml --- r: 316575 b: refs/heads/master c: b9b1ce707d81ec63c04e4fd8c34699ada950e6dc h: refs/heads/master i: 316573: e8b0af3d8361134a087c3307751da09d32151cd2 316571: 10b6753c575c76662c4f86a43c8cf2b1891b1b6d 316567: f5ac89326e9e011a6dc7d8f848a4297b11f51d16 316559: b02d8162d4f2888f07e0704f96093ce9e4ac348b 316543: 097bd3135ef34ada14cae9a48a1fe953534e4957 v: v3 --- [refs] | 2 +- trunk/drivers/iommu/amd_iommu_init.c | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index dac23c20baaf..87cf8149e847 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62410eeb40ef355fa47f63886542f4dacef13ba9 +refs/heads/master: b9b1ce707d81ec63c04e4fd8c34699ada950e6dc diff --git a/trunk/drivers/iommu/amd_iommu_init.c b/trunk/drivers/iommu/amd_iommu_init.c index 966d8ac9e147..53828b61e9ac 100644 --- a/trunk/drivers/iommu/amd_iommu_init.c +++ b/trunk/drivers/iommu/amd_iommu_init.c @@ -1627,8 +1627,6 @@ int __init amd_iommu_init_hardware(void) enable_iommus(); - amd_iommu_init_notifier(); - register_syscore_ops(&amd_iommu_syscore_ops); return ret; @@ -1669,6 +1667,25 @@ static bool detect_ivrs(void) return true; } +static int amd_iommu_init_dma(void) +{ + int ret; + + if (iommu_pass_through) + ret = amd_iommu_init_passthrough(); + else + ret = amd_iommu_init_dma_ops(); + + if (ret) + return ret; + + amd_iommu_init_api(); + + amd_iommu_init_notifier(); + + return 0; +} + /* * This is the core init function for AMD IOMMU hardware in the system. * This function is called from the generic x86 DMA layer initialization @@ -1690,11 +1707,7 @@ static int __init amd_iommu_init(void) if (ret) goto free; - if (iommu_pass_through) - ret = amd_iommu_init_passthrough(); - else - ret = amd_iommu_init_dma_ops(); - + ret = amd_iommu_init_dma(); if (ret) goto free;