Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324230
b: refs/heads/master
c: ac5ad93
h: refs/heads/master
v: v3
  • Loading branch information
Gavin Shan authored and Bjorn Helgaas committed Sep 11, 2012
1 parent 15977ed commit a7e84c6
Show file tree
Hide file tree
Showing 21 changed files with 583 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a690a4cbf09f70723f9721ca96ab8b2b472b3391
refs/heads/master: ac5ad93e92c3ffca4c7ba386aaa34244e27b7759
32 changes: 32 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,38 @@ Who: Dave Jones <davej@redhat.com>, Matthew Garrett <mjg@redhat.com>

-----------------------------

What: fakephp and associated sysfs files in /sys/bus/pci/slots/
When: 2011
Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
represent a machine's physical PCI slots. The change in semantics
had userspace implications, as the hotplug core no longer allowed
drivers to create multiple sysfs files per physical slot (required
for multi-function devices, e.g.). fakephp was seen as a developer's
tool only, and its interface changed. Too late, we learned that
there were some users of the fakephp interface.

In 2.6.30, the original fakephp interface was restored. At the same
time, the PCI core gained the ability that fakephp provided, namely
function-level hot-remove and hot-add.

Since the PCI core now provides the same functionality, exposed in:

/sys/bus/pci/rescan
/sys/bus/pci/devices/.../remove
/sys/bus/pci/devices/.../rescan

there is no functional reason to maintain fakephp as well.

We will keep the existing module so that 'modprobe fakephp' will
present the old /sys/bus/pci/slots/... interface for compatibility,
but users are urged to migrate their applications to the API above.

After a reasonable transition period, we will remove the legacy
fakephp interface.
Who: Alex Chiang <achiang@hp.com>

---------------------------

What: CONFIG_RFKILL_INPUT
When: 2.6.33
Why: Should be implemented in userspace, policy daemon.
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,10 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
pci_read_bridge_bases(bus);

if (bus->number == 0) {
struct list_head *ln;
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
dev = pci_dev_b(ln);
if (dev->devfn == 0) {
dev->resource[0].start = 0;
dev->resource[0].end = 0;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/char/agp/sgi-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ static int __devinit agp_sgi_init(void)

j = 0;
list_for_each_entry(info, &tioca_list, ca_list) {
struct list_head *tmp;
if (list_empty(info->ca_devices))
continue;
list_for_each_entry(pdev, info->ca_devices, bus_list) {
list_for_each(tmp, info->ca_devices) {
u8 cap_ptr;

pdev = pci_dev_b(tmp);
if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8))
continue;
cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/parisc/dino.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,14 @@ dino_card_setup(struct pci_bus *bus, void __iomem *base_addr)
if (ccio_allocate_resource(dino_dev->hba.dev, res, _8MB,
F_EXTEND(0xf0000000UL) | _8MB,
F_EXTEND(0xffffffffUL) &~ _8MB, _8MB) < 0) {
struct pci_dev *dev, *tmp;
struct list_head *ln, *tmp_ln;

printk(KERN_ERR "Dino: cannot attach bus %s\n",
dev_name(bus->bridge));
/* kill the bus, we can't do anything with it */
list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
list_for_each_safe(ln, tmp_ln, &bus->devices) {
struct pci_dev *dev = pci_dev_b(ln);

list_del(&dev->bus_list);
}

Expand Down Expand Up @@ -547,6 +549,7 @@ dino_card_fixup(struct pci_dev *dev)
static void __init
dino_fixup_bus(struct pci_bus *bus)
{
struct list_head *ln;
struct pci_dev *dev;
struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge));

Expand Down Expand Up @@ -593,7 +596,8 @@ dino_fixup_bus(struct pci_bus *bus)
}


list_for_each_entry(dev, &bus->devices, bus_list) {
list_for_each(ln, &bus->devices) {
dev = pci_dev_b(ln);
if (is_card_dino(&dino_dev->hba.dev->id))
dino_card_fixup(dev);

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ truncate_pat_collision(struct resource *root, struct resource *new)
static void
lba_fixup_bus(struct pci_bus *bus)
{
struct pci_dev *dev;
struct list_head *ln;
#ifdef FBB_SUPPORT
u16 status;
#endif
Expand Down Expand Up @@ -710,8 +710,9 @@ lba_fixup_bus(struct pci_bus *bus)

}

list_for_each_entry(dev, &bus->devices, bus_list) {
list_for_each(ln, &bus->devices) {
int i;
struct pci_dev *dev = pci_dev_b(ln);

DBG("lba_fixup_bus() %s\n", pci_name(dev));

Expand Down Expand Up @@ -769,7 +770,7 @@ lba_fixup_bus(struct pci_bus *bus)
}

/* Lastly enable FBB/PERR/SERR on all devices too */
list_for_each_entry(dev, &bus->devices, bus_list) {
list_for_each(ln, &bus->devices) {
(void) pci_read_config_word(dev, PCI_COMMAND, &status);
status |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR | fbb_enable;
(void) pci_write_config_word(dev, PCI_COMMAND, status);
Expand Down
24 changes: 23 additions & 1 deletion trunk/drivers/pci/hotplug/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ menuconfig HOTPLUG_PCI

if HOTPLUG_PCI

config HOTPLUG_PCI_FAKE
tristate "Fake PCI Hotplug driver"
help
Say Y here if you want to use the fake PCI hotplug driver. It can
be used to simulate PCI hotplug events if even if your system is
not PCI hotplug capable.

This driver will "emulate" removing PCI devices from the system.
If the "power" file is written to with "0" then the specified PCI
device will be completely removed from the kernel.

WARNING, this does NOT turn off the power to the PCI device.
This is a "logical" removal, not a physical or electrical
removal.

Use this module at your own risk. You have been warned!

To compile this driver as a module, choose M here: the
module will be called fakephp.

When in doubt, say N.

config HOTPLUG_PCI_COMPAQ
tristate "Compaq PCI Hotplug driver"
depends on X86 && PCI_BIOS
Expand Down Expand Up @@ -121,7 +143,7 @@ config HOTPLUG_PCI_SHPC

config HOTPLUG_PCI_RPA
tristate "RPA PCI Hotplug driver"
depends on PPC_PSERIES && EEH
depends on PPC_PSERIES && EEH && !HOTPLUG_PCI_FAKE
help
Say Y here if you have a RPA system that supports PCI Hotplug.

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/pci/hotplug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ obj-$(CONFIG_HOTPLUG_PCI_ACPI) += acpiphp.o

obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM) += acpiphp_ibm.o

# Link this last so it doesn't claim devices that have a real hotplug driver
obj-$(CONFIG_HOTPLUG_PCI_FAKE) += fakephp.o

pci_hotplug-objs := pci_hotplug_core.o pcihp_slot.o

ifdef CONFIG_HOTPLUG_PCI_CPCI
Expand Down
46 changes: 45 additions & 1 deletion trunk/drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,17 @@ static int __ref enable_device(struct acpiphp_slot *slot)
return retval;
}

static void disable_bridges(struct pci_bus *bus)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->subordinate) {
disable_bridges(dev->subordinate);
pci_disable_device(dev);
}
}
}

/* return first device in slot, acquiring a reference on it */
static struct pci_dev *dev_in_slot(struct acpiphp_slot *slot)
{
Expand Down Expand Up @@ -920,7 +931,12 @@ static int disable_device(struct acpiphp_slot *slot)
* here.
*/
while ((pdev = dev_in_slot(slot))) {
pci_stop_and_remove_bus_device(pdev);
pci_stop_bus_device(pdev);
if (pdev->subordinate) {
disable_bridges(pdev->subordinate);
pci_disable_device(pdev);
}
__pci_remove_bus_device(pdev);
pci_dev_put(pdev);
}

Expand Down Expand Up @@ -1461,6 +1477,34 @@ int __init acpiphp_get_num_slots(void)
}


#if 0
/**
* acpiphp_for_each_slot - call function for each slot
* @fn: callback function
* @data: context to be passed to callback function
*/
static int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
{
struct list_head *node;
struct acpiphp_bridge *bridge;
struct acpiphp_slot *slot;
int retval = 0;

list_for_each (node, &bridge_list) {
bridge = (struct acpiphp_bridge *)node;
for (slot = bridge->slots; slot; slot = slot->next) {
retval = fn(slot, data);
if (!retval)
goto err_exit;
}
}

err_exit:
return retval;
}
#endif


/**
* acpiphp_enable_slot - power on slot
* @slot: ACPI PHP slot
Expand Down
Loading

0 comments on commit a7e84c6

Please sign in to comment.