Skip to content

Commit 79dba2e

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: x86/PCI: compute Address Space length rather than using _LEN x86/PCI: never allocate PCI MMIO resources below BIOS_END
2 parents d9e80b7 + 48728e0 commit 79dba2e

2 files changed

Lines changed: 5 additions & 38 deletions

File tree

‎arch/x86/pci/acpi.c‎

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -121,30 +121,6 @@ count_resource(struct acpi_resource *acpi_res, void *data)
121121
return AE_OK;
122122
}
123123

124-
static void
125-
align_resource(struct acpi_device *bridge, struct resource *res)
126-
{
127-
int align = (res->flags & IORESOURCE_MEM) ? 16 : 4;
128-
129-
/*
130-
* Host bridge windows are not BARs, but the decoders on the PCI side
131-
* that claim this address space have starting alignment and length
132-
* constraints, so fix any obvious BIOS goofs.
133-
*/
134-
if (!IS_ALIGNED(res->start, align)) {
135-
dev_printk(KERN_DEBUG, &bridge->dev,
136-
"host bridge window %pR invalid; "
137-
"aligning start to %d-byte boundary\n", res, align);
138-
res->start &= ~(align - 1);
139-
}
140-
if (!IS_ALIGNED(res->end + 1, align)) {
141-
dev_printk(KERN_DEBUG, &bridge->dev,
142-
"host bridge window %pR invalid; "
143-
"aligning end to %d-byte boundary\n", res, align);
144-
res->end = ALIGN(res->end, align) - 1;
145-
}
146-
}
147-
148124
static acpi_status
149125
setup_resource(struct acpi_resource *acpi_res, void *data)
150126
{
@@ -154,7 +130,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
154130
acpi_status status;
155131
unsigned long flags;
156132
struct resource *root, *conflict;
157-
u64 start, end, max_len;
133+
u64 start, end;
158134

159135
status = resource_to_addr(acpi_res, &addr);
160136
if (!ACPI_SUCCESS(status))
@@ -171,27 +147,15 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
171147
} else
172148
return AE_OK;
173149

174-
max_len = addr.maximum - addr.minimum + 1;
175-
if (addr.address_length > max_len) {
176-
dev_printk(KERN_DEBUG, &info->bridge->dev,
177-
"host bridge window length %#llx doesn't fit in "
178-
"%#llx-%#llx, trimming\n",
179-
(unsigned long long) addr.address_length,
180-
(unsigned long long) addr.minimum,
181-
(unsigned long long) addr.maximum);
182-
addr.address_length = max_len;
183-
}
184-
185150
start = addr.minimum + addr.translation_offset;
186-
end = start + addr.address_length - 1;
151+
end = addr.maximum + addr.translation_offset;
187152

188153
res = &info->res[info->res_num];
189154
res->name = info->name;
190155
res->flags = flags;
191156
res->start = start;
192157
res->end = end;
193158
res->child = NULL;
194-
align_resource(info->bridge, res);
195159

196160
if (!pci_use_crs) {
197161
dev_printk(KERN_DEBUG, &info->bridge->dev,

‎arch/x86/pci/i386.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ pcibios_align_resource(void *data, const struct resource *res,
7272
return start;
7373
if (start & 0x300)
7474
start = (start + 0x3ff) & ~0x3ff;
75+
} else if (res->flags & IORESOURCE_MEM) {
76+
if (start < BIOS_END)
77+
start = BIOS_END;
7578
}
7679
return start;
7780
}

0 commit comments

Comments
 (0)