Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174777
b: refs/heads/master
c: 03db42a
h: refs/heads/master
i:
  174775: 1163b96
v: v3
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Nov 4, 2009
1 parent 3324591 commit 3d0472b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1db6fde09e201218f488d7205a7cd7bc448d496
refs/heads/master: 03db42adfeeabe856dbb6894dd3aaff55838330a
25 changes: 25 additions & 0 deletions trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,30 @@ bus_has_transparent_bridge(struct pci_bus *bus)
return false;
}

static void
align_resource(struct acpi_device *bridge, struct resource *res)
{
int align = (res->flags & IORESOURCE_MEM) ? 16 : 4;

/*
* Host bridge windows are not BARs, but the decoders on the PCI side
* that claim this address space have starting alignment and length
* constraints, so fix any obvious BIOS goofs.
*/
if (res->start & (align - 1)) {
dev_printk(KERN_DEBUG, &bridge->dev,
"host bridge window %pR invalid; "
"aligning start to %d-byte boundary\n", res, align);
res->start &= ~(align - 1);
}
if ((res->end + 1) & (align - 1)) {
dev_printk(KERN_DEBUG, &bridge->dev,
"host bridge window %pR invalid; "
"aligning end to %d-byte boundary\n", res, align);
res->end = roundup(res->end, align) - 1;
}
}

static acpi_status
setup_resource(struct acpi_resource *acpi_res, void *data)
{
Expand Down Expand Up @@ -107,6 +131,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
res->start = start;
res->end = end;
res->child = NULL;
align_resource(info->bridge, res);

if (!(pci_probe & PCI_USE__CRS)) {
dev_printk(KERN_DEBUG, &info->bridge->dev,
Expand Down

0 comments on commit 3d0472b

Please sign in to comment.