Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294821
b: refs/heads/master
c: 9ddd592
h: refs/heads/master
i:
  294819: 3dd9cc4
v: v3
  • Loading branch information
Joerg Roedel committed Mar 15, 2012
1 parent 9f3a1d1 commit 41d8a01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cebd5fa4d3046d5b43ce1836a0120612822a7fb0
refs/heads/master: 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5
30 changes: 20 additions & 10 deletions trunk/drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
{
int r;

if (pci_enable_msi(iommu->dev))
return 1;
r = pci_enable_msi(iommu->dev);
if (r)
return r;

r = request_threaded_irq(iommu->dev->irq,
amd_iommu_int_handler,
Expand All @@ -1134,27 +1135,36 @@ static int iommu_setup_msi(struct amd_iommu *iommu)

if (r) {
pci_disable_msi(iommu->dev);
return 1;
return r;
}

iommu->int_enabled = true;
iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);

if (iommu->ppr_log != NULL)
iommu_feature_enable(iommu, CONTROL_PPFINT_EN);

return 0;
}

static int iommu_init_msi(struct amd_iommu *iommu)
{
int ret;

if (iommu->int_enabled)
return 0;
goto enable_faults;

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);

if (iommu->ppr_log != NULL)
iommu_feature_enable(iommu, CONTROL_PPFINT_EN);

return 0;
}

/****************************************************************************
Expand Down

0 comments on commit 41d8a01

Please sign in to comment.