diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-15 11:29:47 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-15 11:31:03 -0400 |
commit | 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 (patch) | |
tree | 75fb37f8bbe142ab07e28eafeee7d356dd31077b /drivers/iommu | |
parent | cebd5fa4d3046d5b43ce1836a0120612822a7fb0 (diff) |
iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
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.
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 526652a7385d..182b80ba79c5 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -1123,8 +1123,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) | |||
1123 | { | 1123 | { |
1124 | int r; | 1124 | int r; |
1125 | 1125 | ||
1126 | if (pci_enable_msi(iommu->dev)) | 1126 | r = pci_enable_msi(iommu->dev); |
1127 | return 1; | 1127 | if (r) |
1128 | return r; | ||
1128 | 1129 | ||
1129 | r = request_threaded_irq(iommu->dev->irq, | 1130 | r = request_threaded_irq(iommu->dev->irq, |
1130 | amd_iommu_int_handler, | 1131 | amd_iommu_int_handler, |
@@ -1134,27 +1135,36 @@ static int iommu_setup_msi(struct amd_iommu *iommu) | |||
1134 | 1135 | ||
1135 | if (r) { | 1136 | if (r) { |
1136 | pci_disable_msi(iommu->dev); | 1137 | pci_disable_msi(iommu->dev); |
1137 | return 1; | 1138 | return r; |
1138 | } | 1139 | } |
1139 | 1140 | ||
1140 | iommu->int_enabled = true; | 1141 | iommu->int_enabled = true; |
1141 | iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); | ||
1142 | |||
1143 | if (iommu->ppr_log != NULL) | ||
1144 | iommu_feature_enable(iommu, CONTROL_PPFINT_EN); | ||
1145 | 1142 | ||
1146 | return 0; | 1143 | return 0; |
1147 | } | 1144 | } |
1148 | 1145 | ||
1149 | static int iommu_init_msi(struct amd_iommu *iommu) | 1146 | static int iommu_init_msi(struct amd_iommu *iommu) |
1150 | { | 1147 | { |
1148 | int ret; | ||
1149 | |||
1151 | if (iommu->int_enabled) | 1150 | if (iommu->int_enabled) |
1152 | return 0; | 1151 | goto enable_faults; |
1153 | 1152 | ||
1154 | if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI)) | 1153 | if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI)) |
1155 | return iommu_setup_msi(iommu); | 1154 | ret = iommu_setup_msi(iommu); |
1155 | else | ||
1156 | ret = -ENODEV; | ||
1156 | 1157 | ||
1157 | return 1; | 1158 | if (ret) |
1159 | return ret; | ||
1160 | |||
1161 | enable_faults: | ||
1162 | iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); | ||
1163 | |||
1164 | if (iommu->ppr_log != NULL) | ||
1165 | iommu_feature_enable(iommu, CONTROL_PPFINT_EN); | ||
1166 | |||
1167 | return 0; | ||
1158 | } | 1168 | } |
1159 | 1169 | ||
1160 | /**************************************************************************** | 1170 | /**************************************************************************** |