aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2012-04-11 12:45:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-13 11:14:08 -0400
commit1a92416a1d37fd96427bd8d8a5fb52b54429c26f (patch)
tree55fd192b97c509ff95a1c261255cf37069f6b7ac /arch/x86/kernel
parenta27f3e06be07cd3719f8c42092de3ebfc9202923 (diff)
iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream. Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> [bwh: Backport to 3.0: - Drop change to PPR log which was added in 3.3 - Source is under arch/x86/kernel] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index bfc8453bd98..33df6e82f65 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
1031{ 1031{
1032 int r; 1032 int r;
1033 1033
1034 if (pci_enable_msi(iommu->dev)) 1034 r = pci_enable_msi(iommu->dev);
1035 return 1; 1035 if (r)
1036 return r;
1036 1037
1037 r = request_threaded_irq(iommu->dev->irq, 1038 r = request_threaded_irq(iommu->dev->irq,
1038 amd_iommu_int_handler, 1039 amd_iommu_int_handler,
@@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
1042 1043
1043 if (r) { 1044 if (r) {
1044 pci_disable_msi(iommu->dev); 1045 pci_disable_msi(iommu->dev);
1045 return 1; 1046 return r;
1046 } 1047 }
1047 1048
1048 iommu->int_enabled = true; 1049 iommu->int_enabled = true;
1049 iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
1050 1050
1051 return 0; 1051 return 0;
1052} 1052}
1053 1053
1054static int iommu_init_msi(struct amd_iommu *iommu) 1054static int iommu_init_msi(struct amd_iommu *iommu)
1055{ 1055{
1056 int ret;
1057
1056 if (iommu->int_enabled) 1058 if (iommu->int_enabled)
1057 return 0; 1059 goto enable_faults;
1058 1060
1059 if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI)) 1061 if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI))
1060 return iommu_setup_msi(iommu); 1062 ret = iommu_setup_msi(iommu);
1063 else
1064 ret = -ENODEV;
1061 1065
1062 return 1; 1066 if (ret)
1067 return ret;
1068
1069enable_faults:
1070 iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
1071
1072 return 0;
1063} 1073}
1064 1074
1065/**************************************************************************** 1075/****************************************************************************