2012-02-25 21:54:52

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 0/4] PCI: Rename pci_remove_* to pci_stop_and_remove_*

So make them to reflect original action: stop and remove, less confusing.

stop means stop, remove means remove.

Thanks

Yinghai


2012-02-25 21:55:49

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 2/4] PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge

old pci_remove_behind_bridge actually do stop and remove.

Make the name reflect that, and less confusing.

Suggested-by: Jesse Barnes <[email protected]>
Signed-off-by: Yinghai Lu <[email protected]>

---
drivers/pci/remove.c | 7 ++++---
drivers/pcmcia/cardbus.c | 2 +-
include/linux/pci.h | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/pci/remove.c
===================================================================
--- linux-2.6.orig/drivers/pci/remove.c
+++ linux-2.6/drivers/pci/remove.c
@@ -127,14 +127,15 @@ static void pci_stop_behind_bridge(struc
}

/**
- * pci_remove_behind_bridge - remove all devices behind a PCI bridge
+ * pci_stop_and_remove_behind_bridge - stop and remove all devices behind
+ * a PCI bridge
* @dev: PCI bridge device
*
* Remove all devices on the bus, except for the parent bridge.
* This also removes any child buses, and any devices they may
* contain in a depth-first manner.
*/
-void pci_remove_behind_bridge(struct pci_dev *dev)
+void pci_stop_and_remove_behind_bridge(struct pci_dev *dev)
{
pci_stop_behind_bridge(dev);
__pci_remove_behind_bridge(dev);
@@ -175,5 +176,5 @@ void pci_stop_bus_device(struct pci_dev
}

EXPORT_SYMBOL(pci_stop_and_remove_bus_device);
-EXPORT_SYMBOL(pci_remove_behind_bridge);
+EXPORT_SYMBOL(pci_stop_and_remove_behind_bridge);
EXPORT_SYMBOL_GPL(pci_stop_bus_device);
Index: linux-2.6/drivers/pcmcia/cardbus.c
===================================================================
--- linux-2.6.orig/drivers/pcmcia/cardbus.c
+++ linux-2.6/drivers/pcmcia/cardbus.c
@@ -108,5 +108,5 @@ void cb_free(struct pcmcia_socket *s)
struct pci_dev *bridge = s->cb_dev;

if (bridge)
- pci_remove_behind_bridge(bridge);
+ pci_stop_and_remove_behind_bridge(bridge);
}
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -959,7 +959,7 @@ void pci_unregister_driver(struct pci_dr
module_driver(__pci_driver, pci_register_driver, \
pci_unregister_driver)

-void pci_remove_behind_bridge(struct pci_dev *dev);
+void pci_stop_and_remove_behind_bridge(struct pci_dev *dev);
struct pci_driver *pci_dev_driver(const struct pci_dev *dev);
int pci_add_dynid(struct pci_driver *drv,
unsigned int vendor, unsigned int device,

2012-02-25 21:55:51

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 1/4] PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device

old pci_remove_bus_device actually do stop and remove.

Make the name reflect that, and less confusing.

This patch is done by sed scripts and change back __pci_remove_bus_device for
some wrong change.

Suggested-by: Jesse Barnes <[email protected]>
Signed-off-by: Yinghai Lu <[email protected]>

---
arch/arm/mach-ixp2000/ixdp2400.c | 4 ++--
arch/arm/mach-ixp2000/ixdp2800.c | 4 ++--
arch/arm/mach-ixp2000/ixdp2x00.c | 4 ++--
arch/powerpc/platforms/pseries/pci_dlpar.c | 2 +-
drivers/message/fusion/mptbase.c | 2 +-
drivers/pci/hotplug/acpiphp_glue.c | 4 ++--
drivers/pci/hotplug/cpci_hotplug_pci.c | 2 +-
drivers/pci/hotplug/cpqphp_pci.c | 2 +-
drivers/pci/hotplug/fakephp.c | 2 +-
drivers/pci/hotplug/ibmphp_core.c | 2 +-
drivers/pci/hotplug/pciehp_pci.c | 2 +-
drivers/pci/hotplug/rpadlpar_core.c | 2 +-
drivers/pci/hotplug/sgi_hotplug.c | 2 +-
drivers/pci/hotplug/shpchp_pci.c | 2 +-
drivers/pci/iov.c | 4 ++--
drivers/pci/pci-sysfs.c | 2 +-
drivers/pci/remove.c | 8 ++++----
drivers/pci/xen-pcifront.c | 4 ++--
drivers/platform/x86/asus-wmi.c | 2 +-
drivers/platform/x86/eeepc-laptop.c | 2 +-
drivers/scsi/mpt2sas/mpt2sas_base.c | 2 +-
include/linux/pci.h | 2 +-
22 files changed, 31 insertions(+), 31 deletions(-)

Index: linux-2.6/arch/arm/mach-ixp2000/ixdp2400.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-ixp2000/ixdp2400.c
+++ linux-2.6/arch/arm/mach-ixp2000/ixdp2400.c
@@ -134,11 +134,11 @@ static void ixdp2400_pci_postinit(void)

if (ixdp2x00_master_npu()) {
dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
} else {
dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);

ixdp2x00_slave_pci_postinit();
Index: linux-2.6/arch/arm/mach-ixp2000/ixdp2800.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-ixp2000/ixdp2800.c
+++ linux-2.6/arch/arm/mach-ixp2000/ixdp2800.c
@@ -262,14 +262,14 @@ int __init ixdp2800_pci_init(void)
pci_common_init(&ixdp2800_pci);
if (ixdp2x00_master_npu()) {
dev = pci_get_bus_and_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);

ixdp2800_master_enable_slave();
ixdp2800_master_wait_for_slave_bus_scan();
} else {
dev = pci_get_bus_and_slot(1, IXDP2800_MASTER_ENET_DEVFN);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
}
Index: linux-2.6/arch/arm/mach-ixp2000/ixdp2x00.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-ixp2000/ixdp2x00.c
+++ linux-2.6/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -239,12 +239,12 @@ void ixdp2x00_slave_pci_postinit(void)
* Remove PMC device is there is one
*/
if((dev = pci_get_bus_and_slot(1, IXDP2X00_PMC_DEVFN))) {
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}

dev = pci_get_bus_and_slot(0, IXDP2X00_21555_DEVFN);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}

Index: linux-2.6/arch/powerpc/platforms/pseries/pci_dlpar.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ linux-2.6/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -84,7 +84,7 @@ void pcibios_remove_pci_devices(struct p
list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
pr_debug(" * Removing %s...\n", pci_name(dev));
eeh_remove_bus_device(dev);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
}
}
EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices);
Index: linux-2.6/drivers/message/fusion/mptbase.c
===================================================================
--- linux-2.6.orig/drivers/message/fusion/mptbase.c
+++ linux-2.6/drivers/message/fusion/mptbase.c
@@ -346,7 +346,7 @@ static int mpt_remove_dead_ioc_func(void
if ((pdev == NULL))
return -1;

- pci_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device(pdev);
return 0;
}

Index: linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
@@ -910,7 +910,7 @@ static int disable_device(struct acpiphp
disable_bridges(pdev->subordinate);
pci_disable_device(pdev);
}
- pci_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device(pdev);
pci_dev_put(pdev);
}
}
@@ -1067,7 +1067,7 @@ static void acpiphp_sanitize_bus(struct
res->end) {
/* Could not assign a required resources
* for this device, remove it */
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
break;
}
}
Index: linux-2.6/drivers/pci/hotplug/cpci_hotplug_pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ linux-2.6/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -341,7 +341,7 @@ int cpci_unconfigure_slot(struct slot* s
dev = pci_get_slot(slot->bus,
PCI_DEVFN(PCI_SLOT(slot->devfn), i));
if (dev) {
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
}
Index: linux-2.6/drivers/pci/hotplug/cpqphp_pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/cpqphp_pci.c
+++ linux-2.6/drivers/pci/hotplug/cpqphp_pci.c
@@ -127,7 +127,7 @@ int cpqhp_unconfigure_device(struct pci_
struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
if (temp) {
pci_dev_put(temp);
- pci_remove_bus_device(temp);
+ pci_stop_and_remove_bus_device(temp);
}
}
return 0;
Index: linux-2.6/drivers/pci/hotplug/fakephp.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/fakephp.c
+++ linux-2.6/drivers/pci/hotplug/fakephp.c
@@ -40,7 +40,7 @@ static ssize_t legacy_show(struct kobjec

static void remove_callback(void *data)
{
- pci_remove_bus_device((struct pci_dev *)data);
+ pci_stop_and_remove_bus_device((struct pci_dev *)data);
}

static ssize_t legacy_store(struct kobject *kobj, struct attribute *attr,
Index: linux-2.6/drivers/pci/hotplug/ibmphp_core.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/ibmphp_core.c
+++ linux-2.6/drivers/pci/hotplug/ibmphp_core.c
@@ -721,7 +721,7 @@ static void ibm_unconfigure_device(struc
for (j = 0; j < 0x08; j++) {
temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
if (temp) {
- pci_remove_bus_device(temp);
+ pci_stop_and_remove_bus_device(temp);
pci_dev_put(temp);
}
}
Index: linux-2.6/drivers/pci/hotplug/pciehp_pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/pciehp_pci.c
+++ linux-2.6/drivers/pci/hotplug/pciehp_pci.c
@@ -141,7 +141,7 @@ int pciehp_unconfigure_device(struct slo
break;
}
}
- pci_remove_bus_device(temp);
+ pci_stop_and_remove_bus_device(temp);
/*
* Ensure that no new Requests will be generated from
* the device.
Index: linux-2.6/drivers/pci/hotplug/rpadlpar_core.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/rpadlpar_core.c
+++ linux-2.6/drivers/pci/hotplug/rpadlpar_core.c
@@ -389,7 +389,7 @@ int dlpar_remove_pci_slot(char *drc_name
BUG_ON(!bus->self);
pr_debug("PCI: Now removing bridge device %s\n", pci_name(bus->self));
eeh_remove_bus_device(bus->self);
- pci_remove_bus_device(bus->self);
+ pci_stop_and_remove_bus_device(bus->self);

return 0;
}
Index: linux-2.6/drivers/pci/hotplug/sgi_hotplug.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/sgi_hotplug.c
+++ linux-2.6/drivers/pci/hotplug/sgi_hotplug.c
@@ -554,7 +554,7 @@ static int disable_slot(struct hotplug_s
PCI_FUNC(func)));
if (dev) {
sn_bus_free_data(dev);
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
}
Index: linux-2.6/drivers/pci/hotplug/shpchp_pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/shpchp_pci.c
+++ linux-2.6/drivers/pci/hotplug/shpchp_pci.c
@@ -124,7 +124,7 @@ int shpchp_unconfigure_device(struct slo
break;
}
}
- pci_remove_bus_device(temp);
+ pci_stop_and_remove_bus_device(temp);
pci_dev_put(temp);
}
return rc;
Index: linux-2.6/drivers/pci/iov.c
===================================================================
--- linux-2.6.orig/drivers/pci/iov.c
+++ linux-2.6/drivers/pci/iov.c
@@ -142,7 +142,7 @@ failed2:
failed1:
pci_dev_put(dev);
mutex_lock(&iov->dev->sriov->lock);
- pci_remove_bus_device(virtfn);
+ pci_stop_and_remove_bus_device(virtfn);
virtfn_remove_bus(dev->bus, virtfn_bus(dev, id));
mutex_unlock(&iov->dev->sriov->lock);

@@ -182,7 +182,7 @@ static void virtfn_remove(struct pci_dev
sysfs_remove_link(&virtfn->dev.kobj, "physfn");

mutex_lock(&iov->dev->sriov->lock);
- pci_remove_bus_device(virtfn);
+ pci_stop_and_remove_bus_device(virtfn);
virtfn_remove_bus(dev->bus, virtfn_bus(dev, id));
mutex_unlock(&iov->dev->sriov->lock);

Index: linux-2.6/drivers/pci/pci-sysfs.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-sysfs.c
+++ linux-2.6/drivers/pci/pci-sysfs.c
@@ -330,7 +330,7 @@ static void remove_callback(struct devic
struct pci_dev *pdev = to_pci_dev(dev);

mutex_lock(&pci_remove_rescan_mutex);
- pci_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device(pdev);
mutex_unlock(&pci_remove_rescan_mutex);
}

Index: linux-2.6/drivers/pci/remove.c
===================================================================
--- linux-2.6.orig/drivers/pci/remove.c
+++ linux-2.6/drivers/pci/remove.c
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(pci_remove_bus);

static void __pci_remove_behind_bridge(struct pci_dev *dev);
/**
- * pci_remove_bus_device - remove a PCI device and any children
+ * pci_stop_and_remove_bus_device - remove a PCI device and any children
* @dev: the device to remove
*
* Remove a PCI device from the device lists, informing the drivers
@@ -102,7 +102,7 @@ static void __pci_remove_bus_device(stru

pci_destroy_dev(dev);
}
-void pci_remove_bus_device(struct pci_dev *dev)
+void pci_stop_and_remove_bus_device(struct pci_dev *dev)
{
pci_stop_bus_device(dev);
__pci_remove_bus_device(dev);
@@ -145,7 +145,7 @@ static void pci_stop_bus_devices(struct
struct list_head *l, *n;

/*
- * VFs could be removed by pci_remove_bus_device() in the
+ * VFs could be removed by pci_stop_and_remove_bus_device() in the
* pci_stop_bus_devices() code path for PF.
* aka, bus->devices get updated in the process.
* but VFs are inserted after PFs when SRIOV is enabled for PF,
@@ -174,6 +174,6 @@ void pci_stop_bus_device(struct pci_dev
pci_stop_dev(dev);
}

-EXPORT_SYMBOL(pci_remove_bus_device);
+EXPORT_SYMBOL(pci_stop_and_remove_bus_device);
EXPORT_SYMBOL(pci_remove_behind_bridge);
EXPORT_SYMBOL_GPL(pci_stop_bus_device);
Index: linux-2.6/drivers/pci/xen-pcifront.c
===================================================================
--- linux-2.6.orig/drivers/pci/xen-pcifront.c
+++ linux-2.6/drivers/pci/xen-pcifront.c
@@ -544,7 +544,7 @@ static void free_root_bus_devs(struct pc
dev = container_of(bus->devices.next, struct pci_dev,
bus_list);
dev_dbg(&dev->dev, "removing device\n");
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
}
}

@@ -1044,7 +1044,7 @@ static int pcifront_detach_devices(struc
domain, bus, slot, func);
continue;
}
- pci_remove_bus_device(pci_dev);
+ pci_stop_and_remove_bus_device(pci_dev);
pci_dev_put(pci_dev);

dev_dbg(&pdev->xdev->dev,
Index: linux-2.6/drivers/platform/x86/asus-wmi.c
===================================================================
--- linux-2.6.orig/drivers/platform/x86/asus-wmi.c
+++ linux-2.6/drivers/platform/x86/asus-wmi.c
@@ -571,7 +571,7 @@ static void asus_rfkill_hotplug(struct a
} else {
dev = pci_get_slot(bus, 0);
if (dev) {
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
}
Index: linux-2.6/drivers/platform/x86/eeepc-laptop.c
===================================================================
--- linux-2.6.orig/drivers/platform/x86/eeepc-laptop.c
+++ linux-2.6/drivers/platform/x86/eeepc-laptop.c
@@ -646,7 +646,7 @@ static void eeepc_rfkill_hotplug(struct
} else {
dev = pci_get_slot(bus, 0);
if (dev) {
- pci_remove_bus_device(dev);
+ pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
}
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -132,7 +132,7 @@ static int mpt2sas_remove_dead_ioc_func(
pdev = ioc->pdev;
if ((pdev == NULL))
return -1;
- pci_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device(pdev);
return 0;
}

Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -686,7 +686,7 @@ u8 pci_common_swizzle(struct pci_dev *de
extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_dev_put(struct pci_dev *dev);
extern void pci_remove_bus(struct pci_bus *b);
-extern void pci_remove_bus_device(struct pci_dev *dev);
+extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
extern void pci_stop_bus_device(struct pci_dev *dev);
void pci_setup_cardbus(struct pci_bus *bus);
extern void pci_sort_breadthfirst(void);

2012-02-25 21:55:47

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 4/4] PCI: acpihp user __pci_remove_bus_device instead

pci_stop_bus_device get called before in the same loop.

Signed-off-by: Yinghai Lu <[email protected]>

---
drivers/pci/hotplug/acpiphp_glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
@@ -910,7 +910,7 @@ static int disable_device(struct acpiphp
disable_bridges(pdev->subordinate);
pci_disable_device(pdev);
}
- pci_stop_and_remove_bus_device(pdev);
+ __pci_remove_bus_device(pdev);
pci_dev_put(pdev);
}
}

2012-02-25 21:55:45

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 3/4] PCI: export __pci_remove_bus_device

Don't use pci_remove_bus_device yet, still keep __ prefix.
That means it only remove without stop at first.

So other non in kernel users or pending patches get notified from
compiler warning.

Signed-off-by: Yinghai Lu <[email protected]>

---
drivers/pci/remove.c | 4 +++-
include/linux/pci.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/remove.c
===================================================================
--- linux-2.6.orig/drivers/pci/remove.c
+++ linux-2.6/drivers/pci/remove.c
@@ -90,7 +90,7 @@ static void __pci_remove_behind_bridge(s
* device lists, remove the /proc entry, and notify userspace
* (/sbin/hotplug).
*/
-static void __pci_remove_bus_device(struct pci_dev *dev)
+void __pci_remove_bus_device(struct pci_dev *dev)
{
if (dev->subordinate) {
struct pci_bus *b = dev->subordinate;
@@ -102,6 +102,8 @@ static void __pci_remove_bus_device(stru

pci_destroy_dev(dev);
}
+EXPORT_SYMBOL(__pci_remove_bus_device);
+
void pci_stop_and_remove_bus_device(struct pci_dev *dev)
{
pci_stop_bus_device(dev);
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -686,6 +686,7 @@ u8 pci_common_swizzle(struct pci_dev *de
extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_dev_put(struct pci_dev *dev);
extern void pci_remove_bus(struct pci_bus *b);
+extern void __pci_remove_bus_device(struct pci_dev *dev);
extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
extern void pci_stop_bus_device(struct pci_dev *dev);
void pci_setup_cardbus(struct pci_bus *bus);

2012-02-27 20:19:41

by Jesse Barnes

[permalink] [raw]
Subject: Re: [PATCH 4/4] PCI: acpihp user __pci_remove_bus_device instead

On Sat, 25 Feb 2012 13:54:23 -0800
Yinghai Lu <[email protected]> wrote:

> pci_stop_bus_device get called before in the same loop.
>
> Signed-off-by: Yinghai Lu <[email protected]>
>
> ---
> drivers/pci/hotplug/acpiphp_glue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/hotplug/acpiphp_glue.c
> +++ linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
> @@ -910,7 +910,7 @@ static int disable_device(struct acpiphp
> disable_bridges(pdev->subordinate);
> pci_disable_device(pdev);
> }
> - pci_stop_and_remove_bus_device(pdev);
> + __pci_remove_bus_device(pdev);
> pci_dev_put(pdev);
> }
> }
>

Ok applied these. How about another that converts in-tree users to
pci_remove_bus_device and marks the __ version deprecated though?

--
Jesse Barnes, Intel Open Source Technology Center


Attachments:
signature.asc (836.00 B)

2012-02-27 20:43:43

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 4/4] PCI: acpihp user __pci_remove_bus_device instead

On Mon, Feb 27, 2012 at 12:19 PM, Jesse Barnes <[email protected]> wrote:
> On Sat, 25 Feb 2012 13:54:23 -0800
> Yinghai Lu <[email protected]> wrote:
>
>> pci_stop_bus_device get called before in the same loop.
>>
>> Signed-off-by: Yinghai Lu <[email protected]>
>>
>> ---
>> ?drivers/pci/hotplug/acpiphp_glue.c | ? ?2 +-
>> ?1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Index: linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/pci/hotplug/acpiphp_glue.c
>> +++ linux-2.6/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -910,7 +910,7 @@ static int disable_device(struct acpiphp
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? disable_bridges(pdev->subordinate);
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pci_disable_device(pdev);
>> ? ? ? ? ? ? ? ? ? ? ? }
>> - ? ? ? ? ? ? ? ? ? ? pci_stop_and_remove_bus_device(pdev);
>> + ? ? ? ? ? ? ? ? ? ? __pci_remove_bus_device(pdev);
>> ? ? ? ? ? ? ? ? ? ? ? pci_dev_put(pdev);
>> ? ? ? ? ? ? ? }
>> ? ? ? }
>>
>
> Ok applied these. ?How about another that converts in-tree users to
> pci_remove_bus_device and marks the __ version deprecated though?

thanks.

now the only user for __pci_remove_bus_device is acpiphp

it will call stop bus devices at first, and then disable all bridges
and then call __pci_remove_bus_device.

not sure why it need to disable all bridges.

Yinghai