Commit 1a92416a authored by Joerg Roedel's avatar Joerg Roedel Committed by Greg Kroah-Hartman

iommu/amd: Make sure IOMMU interrupts are re-enabled on resume

commit 9ddd592a 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: default avatarJoerg 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: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a27f3e06
...@@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) ...@@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
{ {
int r; int r;
if (pci_enable_msi(iommu->dev)) r = pci_enable_msi(iommu->dev);
return 1; if (r)
return r;
r = request_threaded_irq(iommu->dev->irq, r = request_threaded_irq(iommu->dev->irq,
amd_iommu_int_handler, amd_iommu_int_handler,
...@@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu) ...@@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
if (r) { if (r) {
pci_disable_msi(iommu->dev); pci_disable_msi(iommu->dev);
return 1; return r;
} }
iommu->int_enabled = true; iommu->int_enabled = true;
iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
return 0; return 0;
} }
static int iommu_init_msi(struct amd_iommu *iommu) static int iommu_init_msi(struct amd_iommu *iommu)
{ {
int ret;
if (iommu->int_enabled) if (iommu->int_enabled)
return 0; goto enable_faults;
if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI)) if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI))
return iommu_setup_msi(iommu); ret = iommu_setup_msi(iommu);
else
ret = -ENODEV;
return 1; if (ret)
return ret;
enable_faults:
iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
return 0;
} }
/**************************************************************************** /****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment