From 3dd9cc4ce131a60e4d8bc4c3961c0c25c54eaacc Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Thu, 15 Mar 2012 12:46:40 +0100 Subject: [PATCH] --- yaml --- r: 294819 b: refs/heads/master c: 474d567db3d459d08ed0e683f4ace9b00ac2aa4b h: refs/heads/master i: 294817: ff554db2d4ae159218c5394b458546638544daf4 294815: 22668e682b52c6ee2221642b4562cf924c8a3d48 v: v3 --- [refs] | 2 +- trunk/drivers/iommu/amd_iommu_v2.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 3da68f0ebe0a..b61771efc643 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 525b233c7188069a360a898493d9b51ee8adec35 +refs/heads/master: 474d567db3d459d08ed0e683f4ace9b00ac2aa4b diff --git a/trunk/drivers/iommu/amd_iommu_v2.c b/trunk/drivers/iommu/amd_iommu_v2.c index 8add9f125d3e..036fe9bf157e 100644 --- a/trunk/drivers/iommu/amd_iommu_v2.c +++ b/trunk/drivers/iommu/amd_iommu_v2.c @@ -921,7 +921,16 @@ static int __init amd_iommu_v2_init(void) size_t state_table_size; int ret; - pr_info("AMD IOMMUv2 driver by Joerg Roedel "); + pr_info("AMD IOMMUv2 driver by Joerg Roedel \n"); + + if (!amd_iommu_v2_supported()) { + pr_info("AMD IOMMUv2 functionality not available on this sytem\n"); + /* + * Load anyway to provide the symbols to other modules + * which may use AMD IOMMUv2 optionally. + */ + return 0; + } spin_lock_init(&state_lock); @@ -961,6 +970,9 @@ static void __exit amd_iommu_v2_exit(void) size_t state_table_size; int i; + if (!amd_iommu_v2_supported()) + return; + profile_event_unregister(PROFILE_TASK_EXIT, &profile_nb); amd_iommu_unregister_ppr_notifier(&ppr_nb);