diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/pci/acpi.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 54db5a04b5e1..8ddf4f4c7253 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -59,6 +59,30 @@ bus_has_transparent_bridge(struct pci_bus *bus) | |||
59 | return false; | 59 | return false; |
60 | } | 60 | } |
61 | 61 | ||
62 | static void | ||
63 | align_resource(struct acpi_device *bridge, struct resource *res) | ||
64 | { | ||
65 | int align = (res->flags & IORESOURCE_MEM) ? 16 : 4; | ||
66 | |||
67 | /* | ||
68 | * Host bridge windows are not BARs, but the decoders on the PCI side | ||
69 | * that claim this address space have starting alignment and length | ||
70 | * constraints, so fix any obvious BIOS goofs. | ||
71 | */ | ||
72 | if (res->start & (align - 1)) { | ||
73 | dev_printk(KERN_DEBUG, &bridge->dev, | ||
74 | "host bridge window %pR invalid; " | ||
75 | "aligning start to %d-byte boundary\n", res, align); | ||
76 | res->start &= ~(align - 1); | ||
77 | } | ||
78 | if ((res->end + 1) & (align - 1)) { | ||
79 | dev_printk(KERN_DEBUG, &bridge->dev, | ||
80 | "host bridge window %pR invalid; " | ||
81 | "aligning end to %d-byte boundary\n", res, align); | ||
82 | res->end = roundup(res->end, align) - 1; | ||
83 | } | ||
84 | } | ||
85 | |||
62 | static acpi_status | 86 | static acpi_status |
63 | setup_resource(struct acpi_resource *acpi_res, void *data) | 87 | setup_resource(struct acpi_resource *acpi_res, void *data) |
64 | { | 88 | { |
@@ -107,6 +131,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
107 | res->start = start; | 131 | res->start = start; |
108 | res->end = end; | 132 | res->end = end; |
109 | res->child = NULL; | 133 | res->child = NULL; |
134 | align_resource(info->bridge, res); | ||
110 | 135 | ||
111 | if (!(pci_probe & PCI_USE__CRS)) { | 136 | if (!(pci_probe & PCI_USE__CRS)) { |
112 | dev_printk(KERN_DEBUG, &info->bridge->dev, | 137 | dev_printk(KERN_DEBUG, &info->bridge->dev, |