Skip to content

Commit 68c6b85

Browse files
committed
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (48 commits) x86/PCI: Prevent mmconfig memory corruption ACPI: Use GPE reference counting to support shared GPEs x86/PCI: use host bridge _CRS info by default on 2008 and newer machines PCI: augment bus resource table with a list PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs PCI: read bridge windows before filling in subtractive decode resources PCI: split up pci_read_bridge_bases() PCIe PME: use pci_pcie_cap() PCI PM: Run-time callbacks for PCI bus type PCIe PME: use pci_is_pcie() PCI / ACPI / PM: Platform support for PCI PME wake-up ACPI / ACPICA: Multiple system notify handlers per device ACPI / PM: Add more run-time wake-up fields ACPI: Use GPE reference counting to support shared GPEs PCI PM: Make it possible to force using INTx for PCIe PME signaling PCI PM: PCIe PME root port service driver PCI PM: Add function for checking PME status of devices PCI: mark is_pcie obsolete PCI: set PCI_PREF_RANGE_TYPE_64 in pci_bridge_check_ranges PCI: pciehp: second try to get big range for pcie devices ...
2 parents a4a47bc + bb8d413 commit 68c6b85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3007
-1360
lines changed

Documentation/kernel-parameters.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,8 +1948,12 @@ and is between 256 and 4096 characters. It is defined in the file
19481948
IRQ routing is enabled.
19491949
noacpi [X86] Do not use ACPI for IRQ routing
19501950
or for PCI scanning.
1951-
use_crs [X86] Use _CRS for PCI resource
1952-
allocation.
1951+
use_crs [X86] Use PCI host bridge window information
1952+
from ACPI. On BIOSes from 2008 or later, this
1953+
is enabled by default. If you need to use this,
1954+
please report a bug.
1955+
nocrs [X86] Ignore PCI host bridge windows from ACPI.
1956+
If you need to use this, please report a bug.
19531957
routeirq Do IRQ routing for all PCI devices.
19541958
This is normally done in pci_enable_device(),
19551959
so this option is a temporary workaround
@@ -1998,6 +2002,14 @@ and is between 256 and 4096 characters. It is defined in the file
19982002
force Enable ASPM even on devices that claim not to support it.
19992003
WARNING: Forcing ASPM on may cause system lockups.
20002004

2005+
pcie_pme= [PCIE,PM] Native PCIe PME signaling options:
2006+
off Do not use native PCIe PME signaling.
2007+
force Use native PCIe PME signaling even if the BIOS refuses
2008+
to allow the kernel to control the relevant PCIe config
2009+
registers.
2010+
nomsi Do not use MSI for native PCIe PME signaling (this makes
2011+
all PCIe root ports use INTx for everything).
2012+
20012013
pcmv= [HW,PCMCIA] BadgePAD 4
20022014

20032015
pd. [PARIDE]

arch/alpha/kernel/pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
126126
#define MB (1024*KB)
127127
#define GB (1024*MB)
128128

129-
void
130-
pcibios_align_resource(void *data, struct resource *res,
129+
resource_size_t
130+
pcibios_align_resource(void *data, const struct resource *res,
131131
resource_size_t size, resource_size_t align)
132132
{
133133
struct pci_dev *dev = data;
@@ -184,7 +184,7 @@ pcibios_align_resource(void *data, struct resource *res,
184184
}
185185
}
186186

187-
res->start = start;
187+
return start;
188188
}
189189
#undef KB
190190
#undef MB

arch/arm/kernel/bios32.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,15 +616,17 @@ char * __init pcibios_setup(char *str)
616616
* but we want to try to avoid allocating at 0x2900-0x2bff
617617
* which might be mirrored at 0x0100-0x03ff..
618618
*/
619-
void pcibios_align_resource(void *data, struct resource *res,
620-
resource_size_t size, resource_size_t align)
619+
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
620+
resource_size_t size, resource_size_t align)
621621
{
622622
resource_size_t start = res->start;
623623

624624
if (res->flags & IORESOURCE_IO && start & 0x300)
625625
start = (start + 0x3ff) & ~0x3ff;
626626

627-
res->start = (start + align - 1) & ~(align - 1);
627+
start = (start + align - 1) & ~(align - 1);
628+
629+
return start;
628630
}
629631

630632
/**

arch/cris/arch-v32/drivers/pci/bios.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,16 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
4141
return 0;
4242
}
4343

44-
void
45-
pcibios_align_resource(void *data, struct resource *res,
44+
resource_size_t
45+
pcibios_align_resource(void *data, const struct resource *res,
4646
resource_size_t size, resource_size_t align)
4747
{
48-
if (res->flags & IORESOURCE_IO) {
49-
resource_size_t start = res->start;
48+
resource_size_t start = res->start;
5049

51-
if (start & 0x300) {
52-
start = (start + 0x3ff) & ~0x3ff;
53-
res->start = start;
54-
}
55-
}
50+
if ((res->flags & IORESOURCE_IO) && (start & 0x300))
51+
start = (start + 0x3ff) & ~0x3ff;
52+
53+
return start
5654
}
5755

5856
int pcibios_enable_resources(struct pci_dev *dev, int mask)

arch/frv/mb93090-mb00/pci-frv.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@
3232
* but we want to try to avoid allocating at 0x2900-0x2bff
3333
* which might have be mirrored at 0x0100-0x03ff..
3434
*/
35-
void
36-
pcibios_align_resource(void *data, struct resource *res,
35+
resource_size_t
36+
pcibios_align_resource(void *data, const struct resource *res,
3737
resource_size_t size, resource_size_t align)
3838
{
39-
if (res->flags & IORESOURCE_IO) {
40-
resource_size_t start = res->start;
39+
resource_size_t start = res->start;
4140

42-
if (start & 0x300) {
43-
start = (start + 0x3ff) & ~0x3ff;
44-
res->start = start;
45-
}
46-
}
41+
if ((res->flags & IORESOURCE_IO) && (start & 0x300))
42+
start = (start + 0x3ff) & ~0x3ff;
43+
44+
return start
4745
}
4846

4947

arch/ia64/include/asm/acpi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
9898
#endif
9999
#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
100100
static inline void disable_acpi(void) { }
101+
static inline void pci_acpi_crs_quirks(void) { }
101102

102103
const char *acpi_get_sysname (void);
103104
int acpi_request_vector (u32 int_type);

arch/ia64/pci/pci.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,17 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)
320320
static void __devinit
321321
pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl)
322322
{
323-
int i, j;
323+
int i;
324324

325-
j = 0;
325+
pci_bus_remove_resources(bus);
326326
for (i = 0; i < ctrl->windows; i++) {
327327
struct resource *res = &ctrl->window[i].resource;
328328
/* HP's firmware has a hack to work around a Windows bug.
329329
* Ignore these tiny memory ranges */
330330
if ((res->flags & IORESOURCE_MEM) &&
331331
(res->end - res->start < 16))
332332
continue;
333-
if (j >= PCI_BUS_NUM_RESOURCES) {
334-
dev_warn(&bus->dev,
335-
"ignoring host bridge window %pR (no space)\n",
336-
res);
337-
continue;
338-
}
339-
bus->resource[j++] = res;
333+
pci_bus_add_resource(bus, res, 0);
340334
}
341335
}
342336

@@ -452,13 +446,12 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
452446
static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
453447
{
454448
unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
455-
struct resource *devr = &dev->resource[idx];
449+
struct resource *devr = &dev->resource[idx], *busr;
456450

457451
if (!dev->bus)
458452
return 0;
459-
for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) {
460-
struct resource *busr = dev->bus->resource[i];
461453

454+
pci_bus_for_each_resource(dev->bus, busr, i) {
462455
if (!busr || ((busr->flags ^ devr->flags) & type_mask))
463456
continue;
464457
if ((devr->start) && (devr->start >= busr->start) &&
@@ -547,10 +540,11 @@ pcibios_disable_device (struct pci_dev *dev)
547540
acpi_pci_irq_disable(dev);
548541
}
549542

550-
void
551-
pcibios_align_resource (void *data, struct resource *res,
543+
resource_size_t
544+
pcibios_align_resource (void *data, const struct resource *res,
552545
resource_size_t size, resource_size_t align)
553546
{
547+
return res->start;
554548
}
555549

556550
/*

arch/mips/pci/pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ static int pci_initialized;
4949
* but we want to try to avoid allocating at 0x2900-0x2bff
5050
* which might have be mirrored at 0x0100-0x03ff..
5151
*/
52-
void
53-
pcibios_align_resource(void *data, struct resource *res,
52+
resource_size_t
53+
pcibios_align_resource(void *data, const struct resource *res,
5454
resource_size_t size, resource_size_t align)
5555
{
5656
struct pci_dev *dev = data;
@@ -73,7 +73,7 @@ pcibios_align_resource(void *data, struct resource *res,
7373
start = PCIBIOS_MIN_MEM + hose->mem_resource->start;
7474
}
7575

76-
res->start = start;
76+
return start;
7777
}
7878

7979
static void __devinit pcibios_scanbus(struct pci_controller *hose)

arch/mips/pmc-sierra/yosemite/ht.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
345345
return pcibios_enable_resources(dev);
346346
}
347347

348-
void pcibios_align_resource(void *data, struct resource *res,
349-
resource_size_t size, resource_size_t align)
348+
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
349+
resource_size_t size, resource_size_t align)
350350
{
351351
struct pci_dev *dev = data;
352+
resource_size_t start = res->start;
352353

353354
if (res->flags & IORESOURCE_IO) {
354-
resource_size_t start = res->start;
355-
356355
/* We need to avoid collisions with `mirrored' VGA ports
357356
and other strange ISA hardware, so we always want the
358357
addresses kilobyte aligned. */
@@ -363,8 +362,9 @@ void pcibios_align_resource(void *data, struct resource *res,
363362
}
364363

365364
start = (start + 1024 - 1) & ~(1024 - 1);
366-
res->start = start;
367365
}
366+
367+
return start;
368368
}
369369

370370
struct pci_ops titan_pci_ops = {

arch/mn10300/unit-asb2305/pci-asb2305.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
* but we want to try to avoid allocating at 0x2900-0x2bff
3232
* which might have be mirrored at 0x0100-0x03ff..
3333
*/
34-
void pcibios_align_resource(void *data, struct resource *res,
35-
resource_size_t size, resource_size_t align)
34+
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
35+
resource_size_t size, resource_size_t align)
3636
{
37+
resource_size_t start = res->start;
38+
3739
#if 0
3840
struct pci_dev *dev = data;
3941

@@ -47,14 +49,10 @@ void pcibios_align_resource(void *data, struct resource *res,
4749
);
4850
#endif
4951

50-
if (res->flags & IORESOURCE_IO) {
51-
unsigned long start = res->start;
52+
if ((res->flags & IORESOURCE_IO) && (start & 0x300))
53+
start = (start + 0x3ff) & ~0x3ff;
5254

53-
if (start & 0x300) {
54-
start = (start + 0x3ff) & ~0x3ff;
55-
res->start = start;
56-
}
57-
}
55+
return start;
5856
}
5957

6058

arch/mn10300/unit-asb2305/pci.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,10 @@ static int __init pci_check_direct(void)
331331
static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
332332
{
333333
unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
334-
struct resource *devr = &dev->resource[idx];
334+
struct resource *devr = &dev->resource[idx], *busr;
335335

336336
if (dev->bus) {
337-
for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
338-
struct resource *busr = dev->bus->resource[i];
339-
337+
pci_bus_for_each_resource(dev->bus, busr, i) {
340338
if (!busr || (busr->flags ^ devr->flags) & type_mask)
341339
continue;
342340

arch/parisc/kernel/pci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
257257
* Since we are just checking candidates, don't use any fields other
258258
* than res->start.
259259
*/
260-
void pcibios_align_resource(void *data, struct resource *res,
260+
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
261261
resource_size_t size, resource_size_t alignment)
262262
{
263-
resource_size_t mask, align;
263+
resource_size_t mask, align, start = res->start;
264264

265265
DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n",
266266
pci_name(((struct pci_dev *) data)),
@@ -272,10 +272,10 @@ void pcibios_align_resource(void *data, struct resource *res,
272272

273273
/* Align to largest of MIN or input size */
274274
mask = max(alignment, align) - 1;
275-
res->start += mask;
276-
res->start &= ~mask;
275+
start += mask;
276+
start &= ~mask;
277277

278-
/* The caller updates the end field, we don't. */
278+
return start;
279279
}
280280

281281

arch/powerpc/kernel/pci-common.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,8 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
10471047

10481048
struct pci_dev *dev = bus->self;
10491049

1050-
for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
1051-
if ((res = bus->resource[i]) == NULL)
1052-
continue;
1053-
if (!res->flags)
1050+
pci_bus_for_each_resource(bus, res, i) {
1051+
if (!res || !res->flags)
10541052
continue;
10551053
if (i >= 3 && bus->self->transparent)
10561054
continue;
@@ -1181,21 +1179,20 @@ static int skip_isa_ioresource_align(struct pci_dev *dev)
11811179
* but we want to try to avoid allocating at 0x2900-0x2bff
11821180
* which might have be mirrored at 0x0100-0x03ff..
11831181
*/
1184-
void pcibios_align_resource(void *data, struct resource *res,
1182+
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
11851183
resource_size_t size, resource_size_t align)
11861184
{
11871185
struct pci_dev *dev = data;
1186+
resource_size_t start = res->start;
11881187

11891188
if (res->flags & IORESOURCE_IO) {
1190-
resource_size_t start = res->start;
1191-
11921189
if (skip_isa_ioresource_align(dev))
1193-
return;
1194-
if (start & 0x300) {
1190+
return start;
1191+
if (start & 0x300)
11951192
start = (start + 0x3ff) & ~0x3ff;
1196-
res->start = start;
1197-
}
11981193
}
1194+
1195+
return start;
11991196
}
12001197
EXPORT_SYMBOL(pcibios_align_resource);
12011198

@@ -1278,9 +1275,8 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
12781275
pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
12791276
pci_domain_nr(bus), bus->number);
12801277

1281-
for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
1282-
if ((res = bus->resource[i]) == NULL || !res->flags
1283-
|| res->start > res->end || res->parent)
1278+
pci_bus_for_each_resource(bus, res, i) {
1279+
if (!res || !res->flags || res->start > res->end || res->parent)
12841280
continue;
12851281
if (bus->parent == NULL)
12861282
pr = (res->flags & IORESOURCE_IO) ?

arch/powerpc/platforms/fsl_uli1575.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev)
222222
int i;
223223
u8 *dummy;
224224
struct pci_bus *bus = dev->bus;
225+
struct resource *res;
225226
resource_size_t end = 0;
226227

227228
for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) {
@@ -230,13 +231,12 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev)
230231
end = pci_resource_end(dev, i);
231232
}
232233

233-
for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
234-
if ((bus->resource[i]) &&
235-
(bus->resource[i]->flags & IORESOURCE_MEM)) {
236-
if (bus->resource[i]->end == end)
237-
dummy = ioremap(bus->resource[i]->start, 0x4);
234+
pci_bus_for_each_resource(bus, res, i) {
235+
if (res && res->flags & IORESOURCE_MEM) {
236+
if (res->end == end)
237+
dummy = ioremap(res->start, 0x4);
238238
else
239-
dummy = ioremap(bus->resource[i]->end - 3, 0x4);
239+
dummy = ioremap(res->end - 3, 0x4);
240240
if (dummy) {
241241
in_8(dummy);
242242
iounmap(dummy);

0 commit comments

Comments
 (0)