Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125567
b: refs/heads/master
c: 2e824f7
h: refs/heads/master
i:
  125565: 1e737eb
  125563: 8986482
  125559: fe5a723
  125551: ba947aa
  125535: 5e37b6a
  125503: 94d7f84
  125439: 5d201d7
v: v3
  • Loading branch information
Yu Zhao authored and Joerg Roedel committed Jan 3, 2009
1 parent add246a commit 01a407c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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: 19c239ce3d089fee339d1ab7e97b43d6f0557ce5
refs/heads/master: 2e824f79240476d57a8589f46232cabf151efe90
36 changes: 18 additions & 18 deletions trunk/drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,26 +191,17 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header)
static int __init dmar_parse_dev(struct dmar_drhd_unit *dmaru)
{
struct acpi_dmar_hardware_unit *drhd;
static int include_all;
int ret = 0;

drhd = (struct acpi_dmar_hardware_unit *) dmaru->hdr;

if (!dmaru->include_all)
ret = dmar_parse_dev_scope((void *)(drhd + 1),
if (dmaru->include_all)
return 0;

ret = dmar_parse_dev_scope((void *)(drhd + 1),
((void *)drhd) + drhd->header.length,
&dmaru->devices_cnt, &dmaru->devices,
drhd->segment);
else {
/* Only allow one INCLUDE_ALL */
if (include_all) {
printk(KERN_WARNING PREFIX "Only one INCLUDE_ALL "
"device scope is allowed\n");
ret = -EINVAL;
}
include_all = 1;
}

if (ret) {
list_del(&dmaru->list);
kfree(dmaru);
Expand Down Expand Up @@ -384,12 +375,21 @@ int dmar_pci_device_match(struct pci_dev *devices[], int cnt,
struct dmar_drhd_unit *
dmar_find_matched_drhd_unit(struct pci_dev *dev)
{
struct dmar_drhd_unit *drhd = NULL;
struct dmar_drhd_unit *dmaru = NULL;
struct acpi_dmar_hardware_unit *drhd;

list_for_each_entry(dmaru, &dmar_drhd_units, list) {
drhd = container_of(dmaru->hdr,
struct acpi_dmar_hardware_unit,
header);

if (dmaru->include_all &&
drhd->segment == pci_domain_nr(dev->bus))
return dmaru;

list_for_each_entry(drhd, &dmar_drhd_units, list) {
if (drhd->include_all || dmar_pci_device_match(drhd->devices,
drhd->devices_cnt, dev))
return drhd;
if (dmar_pci_device_match(dmaru->devices,
dmaru->devices_cnt, dev))
return dmaru;
}

return NULL;
Expand Down

0 comments on commit 01a407c

Please sign in to comment.