Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112637
b: refs/heads/master
c: aaa9d1d
h: refs/heads/master
i:
  112635: 85a501f
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Jul 12, 2008
1 parent 0b12e7e commit aff88c6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 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: 1886e8a90a580f3ad343f2065c84c1b9e1dac9ef
refs/heads/master: aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c
35 changes: 24 additions & 11 deletions trunk/drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
* these units are not supported by the architecture.
*/
LIST_HEAD(dmar_drhd_units);
LIST_HEAD(dmar_rmrr_units);

static struct acpi_table_header * __initdata dmar_tbl;

Expand All @@ -55,11 +54,6 @@ static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd)
list_add(&drhd->list, &dmar_drhd_units);
}

static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr)
{
list_add(&rmrr->list, &dmar_rmrr_units);
}

static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope,
struct pci_dev **dev, u16 segment)
{
Expand Down Expand Up @@ -224,6 +218,15 @@ dmar_parse_dev(struct dmar_drhd_unit *dmaru)
return ret;
}

#ifdef CONFIG_DMAR
LIST_HEAD(dmar_rmrr_units);

static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr)
{
list_add(&rmrr->list, &dmar_rmrr_units);
}


static int __init
dmar_parse_one_rmrr(struct acpi_dmar_header *header)
{
Expand Down Expand Up @@ -260,6 +263,7 @@ rmrr_parse_dev(struct dmar_rmrr_unit *rmrru)
}
return ret;
}
#endif

static void __init
dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
Expand All @@ -284,6 +288,7 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
}
}


/**
* parse_dmar_table - parses the DMA reporting table
*/
Expand Down Expand Up @@ -316,7 +321,9 @@ parse_dmar_table(void)
ret = dmar_parse_one_drhd(entry_header);
break;
case ACPI_DMAR_TYPE_RESERVED_MEMORY:
#ifdef CONFIG_DMAR
ret = dmar_parse_one_rmrr(entry_header);
#endif
break;
default:
printk(KERN_WARNING PREFIX
Expand Down Expand Up @@ -366,7 +373,6 @@ dmar_find_matched_drhd_unit(struct pci_dev *dev)
int __init dmar_dev_scope_init(void)
{
struct dmar_drhd_unit *drhd;
struct dmar_rmrr_unit *rmrr;
int ret = -ENODEV;

for_each_drhd_unit(drhd) {
Expand All @@ -375,11 +381,16 @@ int __init dmar_dev_scope_init(void)
return ret;
}

for_each_rmrr_units(rmrr) {
ret = rmrr_parse_dev(rmrr);
if (ret)
return ret;
#ifdef CONFIG_DMAR
{
struct dmar_rmrr_unit *rmrr;
for_each_rmrr_units(rmrr) {
ret = rmrr_parse_dev(rmrr);
if (ret)
return ret;
}
}
#endif

return ret;
}
Expand Down Expand Up @@ -407,10 +418,12 @@ int __init dmar_table_init(void)
return -ENODEV;
}

#ifdef CONFIG_DMAR
if (list_empty(&dmar_rmrr_units)) {
printk(KERN_INFO PREFIX "No RMRR found\n");
return -ENODEV;
}
#endif

return 0;
}
Expand Down

0 comments on commit aff88c6

Please sign in to comment.