Skip to content

Commit 1cfd2bd

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: (30 commits) PCI: update for owner removal from struct device_attribute PCI: Fix warnings when CONFIG_DMI unset PCI: Do not run NVidia quirks related to MSI with MSI disabled x86/PCI: use for_each_pci_dev() PCI: use for_each_pci_dev() PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() PCI: export SMBIOS provided firmware instance and label to sysfs PCI: Allow read/write access to sysfs I/O port resources x86/PCI: use host bridge _CRS info on ASRock ALiveSATA2-GLAN PCI: remove unused HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_{SIZE|BOUNDARY} PCI: disable mmio during bar sizing PCI: MSI: Remove unsafe and unnecessary hardware access PCI: Default PCIe ASPM control to on and require !EMBEDDED to disable PCI: kernel oops on access to pci proc file while hot-removal PCI: pci-sysfs: remove casts from void* ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe PCI hotplug: make sure child bridges are enabled at hotplug time PCI hotplug: shpchp: Removed check for hotplug of display devices PCI hotplug: pciehp: Fixed return value sign for pciehp_unconfigure_device PCI: Don't enable aspm before drivers have had a chance to veto it ...
2 parents b57bdda + 763e9db commit 1cfd2bd

39 files changed

Lines changed: 517 additions & 94 deletions

‎Documentation/ABI/testing/sysfs-bus-pci‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,30 @@ Contact: linux-pci@vger.kernel.org
139139
Description:
140140
This symbolic link points to the PCI hotplug controller driver
141141
module that manages the hotplug slot.
142+
143+
What: /sys/bus/pci/devices/.../label
144+
Date: July 2010
145+
Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
146+
Description:
147+
Reading this attribute will provide the firmware
148+
given name(SMBIOS type 41 string) of the PCI device.
149+
The attribute will be created only if the firmware
150+
has given a name to the PCI device.
151+
Users:
152+
Userspace applications interested in knowing the
153+
firmware assigned name of the PCI device.
154+
155+
What: /sys/bus/pci/devices/.../index
156+
Date: July 2010
157+
Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
158+
Description:
159+
Reading this attribute will provide the firmware
160+
given instance(SMBIOS type 41 device type instance)
161+
of the PCI device. The attribute will be created
162+
only if the firmware has given a device type instance
163+
to the PCI device.
164+
Users:
165+
Userspace applications interested in knowing the
166+
firmware assigned device type instance of the PCI
167+
device that can help in understanding the firmware
168+
intended order of the PCI device.

‎Documentation/filesystems/sysfs-pci.txt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ files, each with their own function.
3939
local_cpus nearby CPU mask (cpumask, ro)
4040
remove remove device from kernel's list (ascii, wo)
4141
resource PCI resource host addresses (ascii, ro)
42-
resource0..N PCI resource N, if present (binary, mmap)
42+
resource0..N PCI resource N, if present (binary, mmap, rw[1])
4343
resource0_wc..N_wc PCI WC map resource N, if prefetchable (binary, mmap)
4444
rom PCI ROM resource, if present (binary, ro)
4545
subsystem_device PCI subsystem device (ascii, ro)
@@ -54,13 +54,16 @@ files, each with their own function.
5454
binary - file contains binary data
5555
cpumask - file contains a cpumask type
5656

57+
[1] rw for RESOURCE_IO (I/O port) regions only
58+
5759
The read only files are informational, writes to them will be ignored, with
5860
the exception of the 'rom' file. Writable files can be used to perform
5961
actions on the device (e.g. changing config space, detaching a device).
6062
mmapable files are available via an mmap of the file at offset 0 and can be
6163
used to do actual device programming from userspace. Note that some platforms
6264
don't support mmapping of certain resources, so be sure to check the return
63-
value from any attempted mmap.
65+
value from any attempted mmap. The most notable of these are I/O port
66+
resources, which also provide read/write access.
6467

6568
The 'enable' file provides a counter that indicates how many times the device
6669
has been enabled. If the 'enable' file currently returns '4', and a '1' is

‎Documentation/kernel-parameters.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,8 @@ and is between 256 and 4096 characters. It is defined in the file
19761976
norom [X86] Do not assign address space to
19771977
expansion ROMs that do not already have
19781978
BIOS assigned address ranges.
1979+
nobar [X86] Do not assign address space to the
1980+
BARs that weren't assigned by the BIOS.
19791981
irqmask=0xMMMM [X86] Set a bit mask of IRQs allowed to be
19801982
assigned automatically to PCI devices. You can
19811983
make the kernel exclude IRQs of your ISA cards

‎arch/ia64/kernel/msi_ia64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static int ia64_set_msi_irq_affinity(unsigned int irq,
2525
if (irq_prepare_move(irq, cpu))
2626
return -1;
2727

28-
read_msi_msg(irq, &msg);
28+
get_cached_msi_msg(irq, &msg);
2929

3030
addr = msg.address_lo;
3131
addr &= MSI_ADDR_DEST_ID_MASK;

‎arch/ia64/sn/kernel/msi_sn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int sn_set_msi_irq_affinity(unsigned int irq,
175175
* Release XIO resources for the old MSI PCI address
176176
*/
177177

178-
read_msi_msg(irq, &msg);
178+
get_cached_msi_msg(irq, &msg);
179179
sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
180180
pdev = sn_pdev->pdi_linux_pcidev;
181181
provider = SN_PCIDEV_BUSPROVIDER(pdev);

‎arch/x86/include/asm/pci_x86.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define PCI_HAS_IO_ECS 0x40000
3131
#define PCI_NOASSIGN_ROMS 0x80000
3232
#define PCI_ROOT_NO_CRS 0x100000
33+
#define PCI_NOASSIGN_BARS 0x200000
3334

3435
extern unsigned int pci_probe;
3536
extern unsigned long pirq_table_addr;

‎arch/x86/kernel/apic/io_apic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3397,7 +3397,7 @@ static int set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
33973397

33983398
cfg = desc->chip_data;
33993399

3400-
read_msi_msg_desc(desc, &msg);
3400+
get_cached_msi_msg_desc(desc, &msg);
34013401

34023402
msg.data &= ~MSI_DATA_VECTOR_MASK;
34033403
msg.data |= MSI_DATA_VECTOR(cfg->vector);

‎arch/x86/pci/acpi.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
3434
DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
3535
},
3636
},
37+
/* https://bugzilla.kernel.org/show_bug.cgi?id=16007 */
38+
/* 2006 AMD HT/VIA system with two host bridges */
39+
{
40+
.callback = set_use_crs,
41+
.ident = "ASRock ALiveSATA2-GLAN",
42+
.matches = {
43+
DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"),
44+
},
45+
},
3746
{}
3847
};
3948

‎arch/x86/pci/common.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ void __init dmi_check_skip_isa_align(void)
125125
static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
126126
{
127127
struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE];
128+
struct resource *bar_r;
129+
int bar;
130+
131+
if (pci_probe & PCI_NOASSIGN_BARS) {
132+
/*
133+
* If the BIOS did not assign the BAR, zero out the
134+
* resource so the kernel doesn't attmept to assign
135+
* it later on in pci_assign_unassigned_resources
136+
*/
137+
for (bar = 0; bar <= PCI_STD_RESOURCE_END; bar++) {
138+
bar_r = &dev->resource[bar];
139+
if (bar_r->start == 0 && bar_r->end != 0) {
140+
bar_r->flags = 0;
141+
bar_r->end = 0;
142+
}
143+
}
144+
}
128145

129146
if (pci_probe & PCI_NOASSIGN_ROMS) {
130147
if (rom_r->parent)
@@ -509,6 +526,9 @@ char * __devinit pcibios_setup(char *str)
509526
} else if (!strcmp(str, "norom")) {
510527
pci_probe |= PCI_NOASSIGN_ROMS;
511528
return NULL;
529+
} else if (!strcmp(str, "nobar")) {
530+
pci_probe |= PCI_NOASSIGN_BARS;
531+
return NULL;
512532
} else if (!strcmp(str, "assign-busses")) {
513533
pci_probe |= PCI_ASSIGN_ALL_BUSSES;
514534
return NULL;

‎arch/x86/pci/irq.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
989989
dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin - 1, irq);
990990

991991
/* Update IRQ for all devices with the same pirq value */
992-
while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) {
992+
for_each_pci_dev(dev2) {
993993
pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin);
994994
if (!pin)
995995
continue;
@@ -1028,7 +1028,7 @@ void __init pcibios_fixup_irqs(void)
10281028
u8 pin;
10291029

10301030
DBG(KERN_DEBUG "PCI: IRQ fixup\n");
1031-
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
1031+
for_each_pci_dev(dev) {
10321032
/*
10331033
* If the BIOS has set an out of range IRQ number, just
10341034
* ignore it. Also keep track of which IRQ's are
@@ -1052,7 +1052,7 @@ void __init pcibios_fixup_irqs(void)
10521052
return;
10531053

10541054
dev = NULL;
1055-
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
1055+
for_each_pci_dev(dev) {
10561056
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
10571057
if (!pin)
10581058
continue;

0 commit comments

Comments
 (0)