Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294822
b: refs/heads/master
c: 3d9761e
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Mar 15, 2012
1 parent 41d8a01 commit bcbc84e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 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: 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5
refs/heads/master: 3d9761e7a55b429ccee305a53669577b9cc20dac
24 changes: 23 additions & 1 deletion trunk/drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ static u32 rlookup_table_size; /* size if the rlookup table */
*/
extern void iommu_flush_all_caches(struct amd_iommu *iommu);

static int __init amd_iommu_enable_interrupts(void);

static inline void update_last_devid(u16 devid)
{
if (devid > amd_iommu_last_bdf)
Expand Down Expand Up @@ -1383,7 +1385,6 @@ static void enable_iommus(void)
iommu_enable_ppr_log(iommu);
iommu_enable_gt(iommu);
iommu_set_exclusion_range(iommu);
iommu_init_msi(iommu);
iommu_enable(iommu);
iommu_flush_all_caches(iommu);
}
Expand Down Expand Up @@ -1411,6 +1412,8 @@ static void amd_iommu_resume(void)

/* re-load the hardware */
enable_iommus();

amd_iommu_enable_interrupts();
}

static int amd_iommu_suspend(void)
Expand Down Expand Up @@ -1595,6 +1598,21 @@ int __init amd_iommu_init_hardware(void)
return ret;
}

static int __init amd_iommu_enable_interrupts(void)
{
struct amd_iommu *iommu;
int ret = 0;

for_each_iommu(iommu) {
ret = iommu_init_msi(iommu);
if (ret)
goto out;
}

out:
return ret;
}

/*
* This is the core init function for AMD IOMMU hardware in the system.
* This function is called from the generic x86 DMA layer initialization
Expand All @@ -1612,6 +1630,10 @@ static int __init amd_iommu_init(void)
if (ret)
goto out;

ret = amd_iommu_enable_interrupts();
if (ret)
goto free;

if (iommu_pass_through)
ret = amd_iommu_init_passthrough();
else
Expand Down

0 comments on commit bcbc84e

Please sign in to comment.