Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268901
b: refs/heads/master
c: c2c7286
h: refs/heads/master
i:
  268899: dc0045e
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Sep 21, 2011
1 parent 8e8e43f commit f81e477
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 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: 41750d31fc9599fd81763e685a6b7b42d298c4f8
refs/heads/master: c2c7286ac6d996a8ffc8d391d782ba35570b1236
15 changes: 12 additions & 3 deletions trunk/drivers/iommu/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,17 @@ dmar_find_matched_drhd_unit(struct pci_dev *dev)

int __init dmar_dev_scope_init(void)
{
static int dmar_dev_scope_initialized;
struct dmar_drhd_unit *drhd, *drhd_n;
int ret = -ENODEV;

if (dmar_dev_scope_initialized)
return dmar_dev_scope_initialized;

list_for_each_entry_safe(drhd, drhd_n, &dmar_drhd_units, list) {
ret = dmar_parse_dev(drhd);
if (ret)
return ret;
goto fail;
}

#ifdef CONFIG_DMAR
Expand All @@ -574,17 +578,22 @@ int __init dmar_dev_scope_init(void)
list_for_each_entry_safe(rmrr, rmrr_n, &dmar_rmrr_units, list) {
ret = rmrr_parse_dev(rmrr);
if (ret)
return ret;
goto fail;
}

list_for_each_entry_safe(atsr, atsr_n, &dmar_atsr_units, list) {
ret = atsr_parse_dev(atsr);
if (ret)
return ret;
goto fail;
}
}
#endif

dmar_dev_scope_initialized = 1;
return 0;

fail:
dmar_dev_scope_initialized = ret;
return ret;
}

Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3439,16 +3439,12 @@ int __init intel_iommu_init(void)
return -ENODEV;
}

if (dmar_dev_scope_init()) {
if (dmar_dev_scope_init() < 0) {
if (force_on)
panic("tboot: Failed to initialize DMAR device scope\n");
return -ENODEV;
}

/*
* Check the need for DMA-remapping initialization now.
* Above initialization will also be used by Interrupt-remapping.
*/
if (no_iommu || dmar_disabled)
return -ENODEV;

Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/iommu/intr_remapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,15 @@ int __init parse_ioapics_under_ir(void)
return ir_supported;
}

int ir_dev_scope_init(void)
{
if (!intr_remapping_enabled)
return 0;

return dmar_dev_scope_init();
}
rootfs_initcall(ir_dev_scope_init);

void disable_intr_remapping(void)
{
struct dmar_drhd_unit *drhd;
Expand Down

0 comments on commit f81e477

Please sign in to comment.