linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
@ 2003-06-05  1:31 Greg KH
  2003-06-05  2:05 ` [PATCH] " Greg KH
  2003-06-05  2:14 ` [BK PATCH] " Greg KH
  0 siblings, 2 replies; 24+ messages in thread
From: Greg KH @ 2003-06-05  1:31 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, pcihpd-discuss

Hi,

Here's some PCI and PCI Hotplug changes that are against the latest
2.5.70 bk tree.  They contain the following:
	- dynamic id bug fixes from Matt Domsch
	- move drivers/hotplug/ to drivers/pci/hotplug/  I should have
	  done this originally, and I'm sorry for ignoring everyone who
	  told me about this, you were right :)
	- Because of the PCI Hotplug drivers moving, I was able to remove
	  about 70 lines from include/linux/pci.h, which should speed up
	  everyone's compile time some unmeasurable amount :)
	- Removed some exported PCI core variables and functions that
	  didn't need to be exported (no one was using them.)
	- Next step in the pci device list locking changes, now the pci
	  device's reference count is incremented when the pci driver is
	  probed, and decremented when the driver is done with the
	  device.
	- removed all users of pci_for_each_dev() which was a macro that
	  directly accessed the pci device lists.  This was replaced
	  with a call to pci_find_device() which will be later changed
	  to properly lock access to the pci device lists.
	- Some "hand made" pci functions were removed from the PCI
	  hotplug drivers and now they call the proper PCI core
	  functions.

Because of the pci_for_each_dev() changes, these patches touch a lot of
different files all over the tree, sorry, but it's necessary for us to
get proper pci device locking.

On the plus side, I ended up removing 58 lines of code from the tree :)

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/pci-2.5

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.


 drivers/hotplug/Kconfig                   |  120 -
 drivers/hotplug/Makefile                  |   44 
 drivers/hotplug/acpiphp.h                 |  262 --
 drivers/hotplug/acpiphp_core.c            |  505 ----
 drivers/hotplug/acpiphp_glue.c            | 1335 ------------
 drivers/hotplug/acpiphp_pci.c             |  510 ----
 drivers/hotplug/acpiphp_res.c             |  699 ------
 drivers/hotplug/cpci_hotplug.h            |  100 
 drivers/hotplug/cpci_hotplug_core.c       |  919 --------
 drivers/hotplug/cpci_hotplug_pci.c        |  647 ------
 drivers/hotplug/cpcihp_generic.c          |  290 --
 drivers/hotplug/cpcihp_zt5550.c           |  306 --
 drivers/hotplug/cpcihp_zt5550.h           |   79 
 drivers/hotplug/cpqphp.h                  |  912 --------
 drivers/hotplug/cpqphp_core.c             | 1541 --------------
 drivers/hotplug/cpqphp_ctrl.c             | 3084 ------------------------------
 drivers/hotplug/cpqphp_nvram.c            |  667 ------
 drivers/hotplug/cpqphp_nvram.h            |   57 
 drivers/hotplug/cpqphp_pci.c              | 1548 ---------------
 drivers/hotplug/cpqphp_sysfs.c            |  143 -
 drivers/hotplug/ibmphp.h                  |  772 -------
 drivers/hotplug/ibmphp_core.c             | 1417 -------------
 drivers/hotplug/ibmphp_ebda.c             | 1228 -----------
 drivers/hotplug/ibmphp_hpc.c              | 1228 -----------
 drivers/hotplug/ibmphp_pci.c              | 1758 -----------------
 drivers/hotplug/ibmphp_res.c              | 2157 --------------------
 drivers/hotplug/pci_hotplug.h             |  146 -
 drivers/hotplug/pci_hotplug_core.c        |  666 ------
 drivers/hotplug/pcihp_skeleton.c          |  432 ----
 arch/alpha/kernel/sys_sio.c               |    4 
 arch/arm/kernel/bios32.c                  |    4 
 arch/i386/Kconfig                         |    2 
 arch/i386/kernel/cpu/cpufreq/gx-suspmod.c |    4 
 arch/i386/pci/i386.c                      |    8 
 arch/i386/pci/irq.c                       |   11 
 arch/ia64/Kconfig                         |    2 
 arch/ia64/hp/common/sba_iommu.c           |    4 
 arch/ia64/sn/io/pci_bus_cvlink.c          |    2 
 arch/ia64/sn/io/pciba.c                   |    8 
 arch/ia64/sn/io/sn2/pci_bus_cvlink.c      |    2 
 arch/m68knommu/Kconfig                    |    2 
 arch/mips/ddb5074/pci.c                   |    8 
 arch/mips/ddb5476/pci.c                   |    8 
 arch/mips/ddb5xxx/ddb5477/pci.c           |    4 
 arch/mips/mips-boards/generic/pci.c       |    4 
 arch/mips/sni/pci.c                       |    4 
 arch/mips64/mips-boards/generic/pci.c     |    4 
 arch/mips64/sgi-ip32/ip32-pci.c           |   10 
 arch/ppc/kernel/pci.c                     |   12 
 arch/ppc/platforms/chrp_pci.c             |    4 
 arch/ppc/platforms/gemini_pci.c           |    4 
 arch/ppc/platforms/pmac_pci.c             |    8 
 arch/ppc/platforms/prep_pci.c             |    7 
 arch/ppc64/Kconfig                        |    9 
 arch/ppc64/kernel/iSeries_pci.c           |    4 
 arch/ppc64/kernel/pSeries_pci.c           |    4 
 arch/ppc64/kernel/pci.c                   |    4 
 arch/ppc64/kernel/pci_dma.c               |    4 
 arch/sh/kernel/pci-sh7751.c               |    8 
 arch/v850/Kconfig                         |    2 
 arch/v850/kernel/rte_mb_a_pci.c           |    4 
 arch/x86_64/Kconfig                       |    2 
 arch/x86_64/kernel/bluesmoke.c            |    4 
 arch/x86_64/kernel/pci-gart.c             |    3 
 arch/x86_64/pci/irq.c                     |   11 
 arch/x86_64/pci/x86-64.c                  |    8 
 drivers/Makefile                          |    1 
 drivers/acpi/pci_irq.c                    |    2 
 drivers/char/agp/amd-k8-agp.c             |    4 
 drivers/char/agp/generic.c                |    8 
 drivers/char/agp/isoch.c                  |    4 
 drivers/char/hw_random.c                  |    4 
 drivers/char/watchdog/amd7xx_tco.c        |    3 
 drivers/char/watchdog/i810-tco.c          |    4 
 drivers/hotplug/acpiphp_glue.c            |   26 
 drivers/hotplug/ibmphp_core.c             |   38 
 drivers/ide/pci/cs5530.c                  |   19 
 drivers/ide/pci/hpt366.c                  |    4 
 drivers/ide/pci/pdc202xx_new.c            |    4 
 drivers/ide/setup-pci.c                   |    4 
 drivers/macintosh/via-pmu.c               |   12 
 drivers/message/fusion/mptbase.c          |    7 
 drivers/message/i2o/i2o_core.c            |   12 
 drivers/net/e100/e100_main.c              |   47 
 drivers/net/e1000/e1000_main.c            |    2 
 drivers/net/ixgb/ixgb_main.c              |    2 
 drivers/parport/parport_pc.c              |    4 
 drivers/pci/Makefile                      |    3 
 drivers/pci/access.c                      |    3 
 drivers/pci/bus.c                         |    3 
 drivers/pci/hotplug.c                     |    8 
 drivers/pci/hotplug/Kconfig               |  120 +
 drivers/pci/hotplug/Makefile              |   44 
 drivers/pci/hotplug/acpiphp.h             |  262 ++
 drivers/pci/hotplug/acpiphp_core.c        |  505 ++++
 drivers/pci/hotplug/acpiphp_glue.c        | 1336 ++++++++++++
 drivers/pci/hotplug/acpiphp_pci.c         |  511 ++++
 drivers/pci/hotplug/acpiphp_res.c         |  699 ++++++
 drivers/pci/hotplug/cpci_hotplug.h        |  100 
 drivers/pci/hotplug/cpci_hotplug_core.c   |  919 ++++++++
 drivers/pci/hotplug/cpci_hotplug_pci.c    |  651 ++++++
 drivers/pci/hotplug/cpcihp_generic.c      |  290 ++
 drivers/pci/hotplug/cpcihp_zt5550.c       |  306 ++
 drivers/pci/hotplug/cpcihp_zt5550.h       |   79 
 drivers/pci/hotplug/cpqphp.h              |  912 ++++++++
 drivers/pci/hotplug/cpqphp_core.c         | 1541 ++++++++++++++
 drivers/pci/hotplug/cpqphp_ctrl.c         | 3084 ++++++++++++++++++++++++++++++
 drivers/pci/hotplug/cpqphp_nvram.c        |  667 ++++++
 drivers/pci/hotplug/cpqphp_nvram.h        |   57 
 drivers/pci/hotplug/cpqphp_pci.c          | 1549 +++++++++++++++
 drivers/pci/hotplug/cpqphp_sysfs.c        |  143 +
 drivers/pci/hotplug/ibmphp.h              |  772 +++++++
 drivers/pci/hotplug/ibmphp_core.c         | 1428 +++++++++++++
 drivers/pci/hotplug/ibmphp_ebda.c         | 1228 +++++++++++
 drivers/pci/hotplug/ibmphp_hpc.c          | 1228 +++++++++++
 drivers/pci/hotplug/ibmphp_pci.c          | 1758 +++++++++++++++++
 drivers/pci/hotplug/ibmphp_res.c          | 2157 ++++++++++++++++++++
 drivers/pci/hotplug/pci_hotplug.h         |  146 +
 drivers/pci/hotplug/pci_hotplug_core.c    |  666 ++++++
 drivers/pci/hotplug/pcihp_skeleton.c      |  432 ++++
 drivers/pci/pci-driver.c                  |   29 
 drivers/pci/pci.c                         |   16 
 drivers/pci/pci.h                         |   56 
 drivers/pci/pool.c                        |    2 
 drivers/pci/probe.c                       |    6 
 drivers/pci/proc.c                        |    5 
 drivers/pci/search.c                      |    4 
 drivers/pci/setup-irq.c                   |    4 
 drivers/pci/setup-res.c                   |    2 
 drivers/pnp/resource.c                    |    4 
 drivers/video/pm2fb.c                     |    4 
 drivers/video/sis/sis_main.c              |  105 -
 include/linux/pci.h                       |   75 
 sound/core/memalloc.c                     |   16 
 sound/oss/esssolo1.c                      |   16 
 sound/oss/maestro.c                       |    8 
 sound/oss/via82cxxx_audio.c               |   11 
 sound/pci/rme9652/hammerfall_mem.c        |   28 
 138 files changed, 23960 insertions(+), 24018 deletions(-)
-----

Greg Kroah-Hartman:
  o PCI: remove usage of pci_for_each_dev() in arch/ppc64/kernel/pci.c
  o PCI: finally remove pci_for_each_dev() now that all users of it are gone
  o PCI: remove usage of pci_for_each_dev() in arch/x86_64/pci/x86-64.c
  o PCI: remove usage of pci_for_each_dev() in arch/x86_64/pci/irq.c
  o PCI: remove usage of pci_for_each_dev() in arch/x86_64/kernel/pci-gart.c
  o PCI: remove usage of pci_for_each_dev() in arch/x86_64/kernel/bluesmoke.c
  o PCI: remove usage of pci_for_each_dev() in arch/v850/kernel/rte_mb_a_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/sh/kernel/pci-sh7751.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc64/kernel/pci_dma.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc64/kernel/pSeries_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc64/kernel/iSeries_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc/platforms/prep_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc/platforms/pmac_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc/platforms/gemini_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc/platforms/chrp_pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ppc/kernel/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips64/sgi-ip32/ip32-pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips64/mips-boards/generic/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips/sni/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips/mips-boards/generic/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips/ddb5xxx/ddb5477/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips/ddb5476/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/mips/ddb5074/pci.c
  o PCI: remove usage of pci_for_each_dev() in arch/ia64/sn/io/sn2/pci_bus_cvlink.c
  o PCI: remove usage of pci_for_each_dev() in arch/ia64/sn/io/pciba.c
  o PCI: remove usage of pci_for_each_dev() in arch/ia64/sn/io/pci_bus_cvlink.c
  o PCI: remove usage of pci_for_each_dev() in arch/ia64/hp/common/sba_iommu.c
  o PCI: remove usage of pci_for_each_dev() in arch/arm/kernel/bios32.c
  o PCI: remove usage of pci_for_each_dev() in arch/alpha/kernel/sys_sio.c
  o PCI: remove usage of pci_for_each_dev() in arch/i386/pci/i386.c
  o PCI: remove usage of pci_for_each_dev() in arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
  o PCI: remove usage of pci_for_each_dev() in arch/i386/pci/irq.c
  o PCI: remove usage of pci_for_each_dev() in drivers/video/sis/sis_main.c
  o PCI: remove usage of pci_for_each_dev() in drivers/video/pm2fb.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pnp/resource.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pci/setup-irq.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pci/search.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pci/proc.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pci/pci.c
  o PCI: remove usage of pci_for_each_dev() in drivers/pci/hotplug/ibmphp_core.c
  o PCI: remove usage of pci_for_each_dev() in drivers/parport/parport_pc.c
  o PCI: remove usage of pci_for_each_dev() in drivers/net/ixgb/ixgb_main.c
  o PCI: remove usage of pci_for_each_dev() in drivers/net/e1000/e1000_main.c
  o PCI: remove usage of pci_for_each_dev() in drivers/net/e100/e100_main.c
  o PCI: remove usage of pci_for_each_dev() in drivers/message/i2o/i2o_core.c
  o PCI: remove usage of pci_for_each_dev() in drivers/message/fusion/mptbase.c
  o PCI: remove usage of pci_for_each_dev() in drivers/macintosh/via-pmu.c
  o PCI: remove usage of pci_for_each_dev() in drivers/ide/setup-pci.c
  o PCI: remove usage of pci_for_each_dev() in drivers/ide/pci/pdc202xx_new.c
  o PCI: remove usage of pci_for_each_dev() in drivers/ide/pci/hp2366.c
  o PCI: remove usage of pci_for_each_dev() in drivers/ide/pci/cs5530.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/watchdog/i810-tco.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/watchdog/amd7xx_tco.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/hw_random.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/agp/isoch.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/agp/generic.c
  o PCI: remove usage of pci_for_each_dev() in drivers/char/agp/amd-k8-agp.c
  o PCI: remove usage of pci_for_each_dev() in drivers/acpi/pci_irq.c
  o PCI: remove usage of pci_for_each_dev() in sound/pci/rme9652/hammerfall_mem.c
  o PCI: remove usage of pci_for_each_dev() in sound/oss/via82cxxx_audio.c
  o PCI: remove usage of pci_for_each_dev() in sound/oss/maestro.c
  o PCI: remove usage of pci_for_each_dev() in sound/oss/esssolo1.c
  o PCI: remove usage of pci_for_each_dev() in sound/core/memalloc.c
  o PCI: Grab reference count on pci_dev if the pci driver binds to the device
  o PCI: Move more functions out of include/linux/pci.h that don't need to be there
  o PCI: remove CONFIG_PROC_FS checks in .c files
  o PCI: Remove a lot of PCI core only functions from include/linux/pci.h
  o PCI Hotplug: move drivers/hotplug/* to drivers/pci/hotplug/*
  o IBM PCI hotplug: remove direct access of pci_devices variable
  o IBM PCI hotplug: remove hand made pci_find_bus function
  o ACPI PCI Hotplug: remove hand made pci_find_bus function
  o PCI: make pools_lock and pci_lock static
  o PCI: make pci_setup_device(), pci_alloc_primary_bus() and pci_alloc_primary_bus_parented() static

Matt Domsch:
  o dynids: free dynids on driver unload
  o dynids: use list_add_tail


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  1:31 [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70 Greg KH
@ 2003-06-05  2:05 ` Greg KH
  2003-06-05  2:05   ` Greg KH
  2003-06-05  2:14 ` [BK PATCH] " Greg KH
  1 sibling, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1229.25.1, 2003/05/28 15:54:26-05:00, Matt_Domsch@dell.com

dynids: use list_add_tail

instead of list_add, such that later entries come later in the scanned list.


 drivers/pci/pci-driver.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	Wed Jun  4 18:12:29 2003
+++ b/drivers/pci/pci-driver.c	Wed Jun  4 18:12:29 2003
@@ -235,7 +235,7 @@
 		driver_data : 0UL;
 
 	spin_lock(&pdrv->dynids.lock);
-	list_add(&pdrv->dynids.list, &dynid->node);
+	list_add_tail(&pdrv->dynids.list, &dynid->node);
 	spin_unlock(&pdrv->dynids.lock);
 
 	bus = get_bus(pdrv->driver.bus);


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05   ` Greg KH
@ 2003-06-05  2:05     ` Greg KH
  2003-06-05  2:05       ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.2, 2003/06/03 16:41:07-07:00, greg@kroah.com

[PATCH] PCI: make pci_setup_device(), pci_alloc_primary_bus() and pci_alloc_primary_bus_parented() static

No one is calling these functions.


 drivers/pci/probe.c |    5 ++---
 include/linux/pci.h |    6 ------
 2 files changed, 2 insertions(+), 9 deletions(-)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	Wed Jun  4 18:12:20 2003
+++ b/drivers/pci/probe.c	Wed Jun  4 18:12:20 2003
@@ -396,7 +396,7 @@
  * Returns 0 on success and -1 if unknown type of device (not normal, bridge
  * or CardBus).
  */
-int pci_setup_device(struct pci_dev * dev)
+static int pci_setup_device(struct pci_dev * dev)
 {
 	u32 class;
 
@@ -641,7 +641,7 @@
 	return 0;
 }
 
-struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent, int bus)
+static struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent, int bus)
 {
 	struct pci_bus *b;
 
@@ -692,7 +692,6 @@
 EXPORT_SYMBOL(pci_root_buses);
 
 #ifdef CONFIG_HOTPLUG
-EXPORT_SYMBOL(pci_setup_device);
 EXPORT_SYMBOL(pci_add_new_bus);
 EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Wed Jun  4 18:12:20 2003
+++ b/include/linux/pci.h	Wed Jun  4 18:12:20 2003
@@ -546,11 +546,6 @@
 {
 	return pci_scan_bus_parented(NULL, bus, ops, sysdata);
 }
-struct pci_bus *pci_alloc_primary_bus_parented(struct device * parent, int bus);
-static inline struct pci_bus *pci_alloc_primary_bus(int bus)
-{
-	return pci_alloc_primary_bus_parented(NULL, bus);
-}
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 void pci_bus_add_devices(struct pci_bus *bus);
 int pci_proc_attach_device(struct pci_dev *dev);
@@ -561,7 +556,6 @@
 char *pci_class_name(u32 class);
 void pci_read_bridge_bases(struct pci_bus *child);
 struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res);
-int pci_setup_device(struct pci_dev *dev);
 int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
 extern struct pci_dev *pci_get_dev(struct pci_dev *dev);
 extern void pci_put_dev(struct pci_dev *dev);


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05 ` [PATCH] " Greg KH
@ 2003-06-05  2:05   ` Greg KH
  2003-06-05  2:05     ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1229.25.2, 2003/05/28 16:37:35-05:00, Matt_Domsch@dell.com

dynids: free dynids on driver unload


 drivers/pci/pci-driver.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)


diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	Wed Jun  4 18:12:25 2003
+++ b/drivers/pci/pci-driver.c	Wed Jun  4 18:12:25 2003
@@ -315,6 +315,22 @@
 	INIT_LIST_HEAD(&dynids->list);
 }
 
+static void
+pci_free_dynids(struct pci_driver *drv)
+{
+	struct list_head *pos, *n;
+	struct dynid *dynid;
+
+	spin_lock(&drv->dynids.lock);
+	list_for_each_safe(pos, n, &drv->dynids.list) {
+		dynid = list_entry(pos, struct dynid, node);
+		list_del(&dynid->node);
+		kfree(dynid);
+	}
+	spin_unlock(&drv->dynids.lock);
+}
+
+
 /**
  * pci_register_driver - register a new pci driver
  * @drv: the driver structure to register
@@ -363,6 +379,7 @@
 pci_unregister_driver(struct pci_driver *drv)
 {
 	driver_unregister(&drv->driver);
+	pci_free_dynids(drv);
 }
 
 static struct pci_driver pci_compat_driver = {


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05     ` Greg KH
@ 2003-06-05  2:05       ` Greg KH
  2003-06-05  2:05         ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.3, 2003/06/03 16:41:35-07:00, greg@kroah.com

[PATCH] PCI: make pools_lock and pci_lock static.

No one is using them outside the pci core.


 drivers/pci/access.c |    3 +--
 drivers/pci/pool.c   |    2 +-
 include/linux/pci.h  |    2 --
 3 files changed, 2 insertions(+), 5 deletions(-)


diff -Nru a/drivers/pci/access.c b/drivers/pci/access.c
--- a/drivers/pci/access.c	Wed Jun  4 18:12:15 2003
+++ b/drivers/pci/access.c	Wed Jun  4 18:12:15 2003
@@ -7,7 +7,7 @@
  * configuration space.
  */
 
-spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
 
 /*
  *  Wrappers for all PCI configuration access functions.  They just check
@@ -60,4 +60,3 @@
 EXPORT_SYMBOL(pci_bus_write_config_byte);
 EXPORT_SYMBOL(pci_bus_write_config_word);
 EXPORT_SYMBOL(pci_bus_write_config_dword);
-EXPORT_SYMBOL(pci_lock);
diff -Nru a/drivers/pci/pool.c b/drivers/pci/pool.c
--- a/drivers/pci/pool.c	Wed Jun  4 18:12:15 2003
+++ b/drivers/pci/pool.c	Wed Jun  4 18:12:15 2003
@@ -31,7 +31,7 @@
 #define	POOL_TIMEOUT_JIFFIES	((100 /* msec */ * HZ) / 1000)
 #define	POOL_POISON_BYTE	0xa7
 
-DECLARE_MUTEX (pools_lock);
+static DECLARE_MUTEX (pools_lock);
 
 static ssize_t
 show_pools (struct device *dev, char *buf)
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Wed Jun  4 18:12:15 2003
+++ b/include/linux/pci.h	Wed Jun  4 18:12:15 2003
@@ -606,8 +606,6 @@
 	return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val);
 }
 
-extern spinlock_t pci_lock;
-
 int pci_enable_device(struct pci_dev *dev);
 int pci_enable_device_bars(struct pci_dev *dev, int mask);
 void pci_disable_device(struct pci_dev *dev);


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05             ` Greg KH
@ 2003-06-05  2:05               ` Greg KH
  2003-06-05  2:05                 ` Greg KH
  2003-06-05  9:19                 ` Russell King
  0 siblings, 2 replies; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.8, 2003/06/03 22:48:45-07:00, greg@kroah.com

[PATCH] PCI: Remove a lot of PCI core only functions from include/linux/pci.h


 drivers/pci/bus.c                      |    1 
 drivers/pci/hotplug/acpiphp_glue.c     |    1 
 drivers/pci/hotplug/acpiphp_pci.c      |    1 
 drivers/pci/hotplug/cpci_hotplug_pci.c |    1 
 drivers/pci/hotplug/cpqphp_pci.c       |    1 
 drivers/pci/hotplug/ibmphp_core.c      |    1 
 drivers/pci/pci.h                      |   44 ++++++++++++++++++++++++++++
 drivers/pci/setup-res.c                |    2 -
 include/linux/pci.h                    |   51 ---------------------------------
 9 files changed, 50 insertions(+), 53 deletions(-)


diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
--- a/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
@@ -129,6 +129,5 @@
 	}
 }
 
-EXPORT_SYMBOL(pci_bus_alloc_resource);
 EXPORT_SYMBOL(pci_bus_add_devices);
 EXPORT_SYMBOL(pci_enable_bridges);
diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/hotplug/acpiphp_glue.c	Wed Jun  4 18:11:51 2003
@@ -34,6 +34,7 @@
 #include <linux/init.h>
 #include <asm/semaphore.h>
 
+#include "../pci.h"
 #include "pci_hotplug.h"
 #include "acpiphp.h"
 
diff -Nru a/drivers/pci/hotplug/acpiphp_pci.c b/drivers/pci/hotplug/acpiphp_pci.c
--- a/drivers/pci/hotplug/acpiphp_pci.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/hotplug/acpiphp_pci.c	Wed Jun  4 18:11:51 2003
@@ -35,6 +35,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
+#include "../pci.h"
 #include "pci_hotplug.h"
 #include "acpiphp.h"
 
diff -Nru a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c	Wed Jun  4 18:11:51 2003
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
+#include "../pci.h"
 #include "pci_hotplug.h"
 #include "cpci_hotplug.h"
 
diff -Nru a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
--- a/drivers/pci/hotplug/cpqphp_pci.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/hotplug/cpqphp_pci.c	Wed Jun  4 18:11:51 2003
@@ -34,6 +34,7 @@
 #include <linux/workqueue.h>
 #include <linux/proc_fs.h>
 #include <linux/pci.h>
+#include "../pci.h"
 #include "cpqphp.h"
 #include "cpqphp_nvram.h"
 #include "../../../arch/i386/pci/pci.h"	/* horrible hack showing how processor dependent we are... */
diff -Nru a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
--- a/drivers/pci/hotplug/ibmphp_core.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/hotplug/ibmphp_core.c	Wed Jun  4 18:11:51 2003
@@ -35,6 +35,7 @@
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/smp_lock.h>
+#include "../pci.h"
 #include "../../../arch/i386/pci/pci.h"	/* for struct irq_routing_table */
 #include "ibmphp.h"
 
diff -Nru a/drivers/pci/pci.h b/drivers/pci/pci.h
--- a/drivers/pci/pci.h	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/pci.h	Wed Jun  4 18:11:51 2003
@@ -3,3 +3,47 @@
 extern int pci_hotplug (struct device *dev, char **envp, int num_envp,
 			 char *buffer, int buffer_size);
 extern void pci_create_sysfs_dev_files(struct pci_dev *pdev);
+extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
+				  unsigned long size, unsigned long align,
+				  unsigned long min, unsigned int type_mask,
+				  void (*alignf)(void *, struct resource *,
+					  	 unsigned long, unsigned long),
+				  void *alignf_data);
+extern int pci_proc_attach_device(struct pci_dev *dev);
+extern int pci_proc_detach_device(struct pci_dev *dev);
+extern int pci_proc_attach_bus(struct pci_bus *bus);
+extern int pci_proc_detach_bus(struct pci_bus *bus);
+
+/* Functions for PCI Hotplug drivers to use */
+extern struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr);
+extern unsigned int pci_do_scan_bus(struct pci_bus *bus);
+extern void pci_remove_bus_device(struct pci_dev *dev);
+extern int pci_remove_device_safe(struct pci_dev *dev);
+
+struct pci_dev_wrapped {
+	struct pci_dev	*dev;
+	void		*data;
+};
+
+struct pci_bus_wrapped {
+	struct pci_bus	*bus;
+	void		*data;
+};
+
+struct pci_visit {
+	int (* pre_visit_pci_bus)	(struct pci_bus_wrapped *,
+					 struct pci_dev_wrapped *);
+	int (* post_visit_pci_bus)	(struct pci_bus_wrapped *,
+					 struct pci_dev_wrapped *);
+
+	int (* pre_visit_pci_dev)	(struct pci_dev_wrapped *,
+					 struct pci_bus_wrapped *);
+	int (* visit_pci_dev)		(struct pci_dev_wrapped *,
+					 struct pci_bus_wrapped *);
+	int (* post_visit_pci_dev)	(struct pci_dev_wrapped *,
+					 struct pci_bus_wrapped *);
+};
+
+extern int pci_visit_dev(struct pci_visit *fn,
+			 struct pci_dev_wrapped *wrapped_dev,
+			 struct pci_bus_wrapped *wrapped_parent);
diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c	Wed Jun  4 18:11:51 2003
+++ b/drivers/pci/setup-res.c	Wed Jun  4 18:11:51 2003
@@ -23,7 +23,7 @@
 #include <linux/ioport.h>
 #include <linux/cache.h>
 #include <linux/slab.h>
-
+#include "pci.h"
 
 #define DEBUG_CONFIG 0
 #if DEBUG_CONFIG
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Wed Jun  4 18:11:51 2003
+++ b/include/linux/pci.h	Wed Jun  4 18:11:51 2003
@@ -548,10 +548,6 @@
 }
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 void pci_bus_add_devices(struct pci_bus *bus);
-int pci_proc_attach_device(struct pci_dev *dev);
-int pci_proc_detach_device(struct pci_dev *dev);
-int pci_proc_attach_bus(struct pci_bus *bus);
-int pci_proc_detach_bus(struct pci_bus *bus);
 void pci_name_device(struct pci_dev *dev);
 char *pci_class_name(u32 class);
 void pci_read_bridge_bases(struct pci_bus *child);
@@ -640,24 +636,14 @@
 void pci_release_region(struct pci_dev *, int);
 
 /* drivers/pci/bus.c */
-
-int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-			   unsigned long size, unsigned long align,
-			   unsigned long min, unsigned int type_mask,
-			   void (*alignf)(void *, struct resource *,
-					  unsigned long, unsigned long),
-			   void *alignf_data);
 void pci_enable_bridges(struct pci_bus *bus);
 
 /* New-style probing supporting hot-pluggable devices */
 int pci_register_driver(struct pci_driver *);
 void pci_unregister_driver(struct pci_driver *);
-void pci_remove_bus_device(struct pci_dev *);
 void pci_remove_behind_bridge(struct pci_dev *);
 struct pci_driver *pci_dev_driver(const struct pci_dev *);
 const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev);
-unsigned int pci_do_scan_bus(struct pci_bus *bus);
-struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr);
 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
 
 /* kmem_cache style wrapper around pci_alloc_consistent() */
@@ -672,42 +658,6 @@
 extern struct pci_dev *isa_bridge;
 #endif
 
-/* Some worker functions that PCI Hotplug drivers find useful */
-struct pci_dev_wrapped {
-	struct pci_dev	*dev;
-	void		*data;
-};
-
-struct pci_bus_wrapped {
-	struct pci_bus	*bus;
-	void		*data;
-};
-
-struct pci_visit {
-	int (* pre_visit_pci_bus)	(struct pci_bus_wrapped *,
-					 struct pci_dev_wrapped *);
-	int (* post_visit_pci_bus)	(struct pci_bus_wrapped *,
-					 struct pci_dev_wrapped *);
-
-	int (* pre_visit_pci_dev)	(struct pci_dev_wrapped *,
-					 struct pci_bus_wrapped *);
-	int (* visit_pci_dev)		(struct pci_dev_wrapped *,
-					 struct pci_bus_wrapped *);
-	int (* post_visit_pci_dev)	(struct pci_dev_wrapped *,
-					 struct pci_bus_wrapped *);
-};
-
-extern int pci_visit_dev(struct pci_visit *fn,
-			 struct pci_dev_wrapped *wrapped_dev,
-			 struct pci_bus_wrapped *wrapped_parent);
-extern int pci_remove_device_safe(struct pci_dev *dev);
-
-static inline void
-pci_dynids_set_use_driver_data(struct pci_driver *pdrv, int val)
-{
-	pdrv->dynids.use_driver_data = val;
-}
-
 #endif /* CONFIG_PCI */
 
 /* Include architecture-dependent settings and functions */
@@ -756,7 +706,6 @@
 static inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; }
 static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
 static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
-static inline void pci_dynids_set_use_driver_data(struct pci_driver *pdrv, int val) { }
 
 /* Power management related routines */
 static inline int pci_save_state(struct pci_dev *dev, u32 *buffer) { return 0; }


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05               ` Greg KH
@ 2003-06-05  2:05                 ` Greg KH
  2003-06-05  2:05                   ` Greg KH
  2003-06-05  9:19                 ` Russell King
  1 sibling, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.9, 2003/06/03 23:33:47-07:00, greg@kroah.com

[PATCH] PCI: remove CONFIG_PROC_FS checks in .c files.


 drivers/pci/bus.c                      |    2 --
 drivers/pci/hotplug.c                  |    8 --------
 drivers/pci/hotplug/cpci_hotplug_pci.c |    3 +--
 drivers/pci/pci.h                      |    8 ++++++++
 drivers/pci/proc.c                     |    1 -
 5 files changed, 9 insertions(+), 13 deletions(-)


diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
--- a/drivers/pci/bus.c	Wed Jun  4 18:11:47 2003
+++ b/drivers/pci/bus.c	Wed Jun  4 18:11:47 2003
@@ -94,9 +94,7 @@
 
 		device_add(&dev->dev);
 		list_add_tail(&dev->global_list, &pci_devices);
-#ifdef CONFIG_PROC_FS
 		pci_proc_attach_device(dev);
-#endif
 		pci_create_sysfs_dev_files(dev);
 
 	}
diff -Nru a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c	Wed Jun  4 18:11:47 2003
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c	Wed Jun  4 18:11:47 2003
@@ -398,9 +398,8 @@
 	child = pci_find_bus(max + 1);
 	if (!child)
 		return -ENODEV;
-#ifdef CONFIG_PROC_FS
 	pci_proc_attach_bus(child);
-#endif
+
 	/*
 	 * Update parent bridge's subordinate field if there were more bridges
 	 * behind the bridge that was scanned.
diff -Nru a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
--- a/drivers/pci/hotplug.c	Wed Jun  4 18:11:47 2003
+++ b/drivers/pci/hotplug.c	Wed Jun  4 18:11:47 2003
@@ -190,9 +190,7 @@
 	list_del(&dev->bus_list);
 	list_del(&dev->global_list);
 	pci_free_resources(dev);
-#ifdef CONFIG_PROC_FS
 	pci_proc_detach_device(dev);
-#endif
 	return 0;
 }
 EXPORT_SYMBOL(pci_remove_device_safe);
@@ -237,10 +235,7 @@
 		struct pci_bus *b = dev->subordinate;
 
 		pci_remove_behind_bridge(dev);
-
-#ifdef CONFIG_PROC_FS
 		pci_proc_detach_bus(b);
-#endif
 
 		list_del(&b->node);
 		kfree(b);
@@ -251,10 +246,7 @@
 	list_del(&dev->bus_list);
 	list_del(&dev->global_list);
 	pci_free_resources(dev);
-#ifdef CONFIG_PROC_FS
 	pci_proc_detach_device(dev);
-#endif
-
 	pci_put_dev(dev);
 }
 
diff -Nru a/drivers/pci/pci.h b/drivers/pci/pci.h
--- a/drivers/pci/pci.h	Wed Jun  4 18:11:47 2003
+++ b/drivers/pci/pci.h	Wed Jun  4 18:11:47 2003
@@ -9,10 +9,18 @@
 				  void (*alignf)(void *, struct resource *,
 					  	 unsigned long, unsigned long),
 				  void *alignf_data);
+/* PCI /proc functions */
+#ifdef CONFIG_PROC_FS
 extern int pci_proc_attach_device(struct pci_dev *dev);
 extern int pci_proc_detach_device(struct pci_dev *dev);
 extern int pci_proc_attach_bus(struct pci_bus *bus);
 extern int pci_proc_detach_bus(struct pci_bus *bus);
+#else
+static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; }
+static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; }
+static inline int pci_proc_attach_bus(struct pci_bus *bus) { return 0; }
+static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
+#endif
 
 /* Functions for PCI Hotplug drivers to use */
 extern struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr);
diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
--- a/drivers/pci/proc.c	Wed Jun  4 18:11:47 2003
+++ b/drivers/pci/proc.c	Wed Jun  4 18:11:47 2003
@@ -599,7 +599,6 @@
 
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pci_proc_attach_device);
-EXPORT_SYMBOL(pci_proc_detach_device);
 EXPORT_SYMBOL(pci_proc_attach_bus);
 EXPORT_SYMBOL(pci_proc_detach_bus);
 EXPORT_SYMBOL(proc_bus_pci_dir);


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05         ` Greg KH
@ 2003-06-05  2:05           ` Greg KH
  2003-06-05  2:05             ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.5, 2003/06/03 17:08:26-07:00, greg@kroah.com

[PATCH] IBM PCI hotplug: remove hand made pci_find_bus function.


 drivers/hotplug/ibmphp_core.c |   25 +++----------------------
 1 files changed, 3 insertions(+), 22 deletions(-)


diff -Nru a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c
--- a/drivers/hotplug/ibmphp_core.c	Wed Jun  4 18:12:06 2003
+++ b/drivers/hotplug/ibmphp_core.c	Wed Jun  4 18:12:06 2003
@@ -724,25 +724,6 @@
 	return NULL;
 }
 
-/* This routine is to find the pci_bus from kernel structures.
- * Parameters: bus number
- * Returns : pci_bus *  or NULL if not found
- */
-static struct pci_bus *ibmphp_find_bus (u8 busno)
-{
-	const struct list_head *tmp;
-	struct pci_bus *bus;
-	debug ("inside %s, busno = %x \n", __FUNCTION__, busno);
-
-	list_for_each (tmp, &pci_root_buses) {
-		bus = (struct pci_bus *) pci_bus_b (tmp);
-		if (bus)
-			if (bus->number == busno)
-				return bus;
-	}
-	return NULL;
-}
-
 /*************************************************************
  * This routine frees up memory used by struct slot, including
  * the pointers to pci_func, bus, hotplug_slot, controller,
@@ -810,7 +791,7 @@
 	struct pci_dev *dev;
 	u16 l;
 
-	if (ibmphp_find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
+	if (pci_find_bus(busno) || !(ibmphp_find_same_bus_num (busno)))
 		return 1;
 
 	bus = kmalloc (sizeof (*bus), GFP_KERNEL);
@@ -855,7 +836,7 @@
 		func->dev = pci_find_slot (func->busno, PCI_DEVFN(func->device, func->function));
 
 	if (func->dev == NULL) {
-		struct pci_bus *bus = ibmphp_find_bus (func->busno);
+		struct pci_bus *bus = pci_find_bus(func->busno);
 		if (!bus)
 			return 0;
 
@@ -1377,7 +1358,7 @@
 		goto exit;
 	}
 
-	bus = ibmphp_find_bus (0);
+	bus = pci_find_bus(0);
 	if (!bus) {
 		err ("Can't find the root pci bus, can not continue\n");
 		rc = -ENODEV;


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05           ` Greg KH
@ 2003-06-05  2:05             ` Greg KH
  2003-06-05  2:05               ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.6, 2003/06/03 19:36:54-07:00, greg@kroah.com

[PATCH] IBM PCI hotplug: remove direct access of pci_devices variable.


 drivers/hotplug/ibmphp_core.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)


diff -Nru a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c
--- a/drivers/hotplug/ibmphp_core.c	Wed Jun  4 18:12:01 2003
+++ b/drivers/hotplug/ibmphp_core.c	Wed Jun  4 18:12:01 2003
@@ -897,7 +897,6 @@
 	int rc;
 	u8 speed;
 	u8 cmd = 0x0;
-	const struct list_head *tmp;
 	struct pci_dev * dev;
 	int retval;
 
@@ -945,13 +944,11 @@
 				cmd = HPC_BUS_100PCIXMODE;
 				break;
 			case BUS_SPEED_133:
-				/* This is to take care of the bug in CIOBX chip*/
-				list_for_each (tmp, &pci_devices) {
-					dev = (struct pci_dev *) pci_dev_g (tmp);
-					if (dev) {
-						if ((dev->vendor == 0x1166) && (dev->device == 0x0101))
-							ibmphp_hpc_writeslot (slot_cur, HPC_BUS_100PCIXMODE);
-					}
+				/* This is to take care of the bug in CIOBX chip */
+				pci_for_each_dev(dev) {
+					if ((dev->vendor == PCI_VENDOR_ID_SERVERWORKS) &&
+					    (dev->device == 0x0101))
+						ibmphp_hpc_writeslot (slot_cur, HPC_BUS_100PCIXMODE);
 				}
 				cmd = HPC_BUS_133PCIXMODE;
 				break;


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05       ` Greg KH
@ 2003-06-05  2:05         ` Greg KH
  2003-06-05  2:05           ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.4, 2003/06/03 17:08:13-07:00, greg@kroah.com

[PATCH] ACPI PCI Hotplug: remove hand made pci_find_bus function


 drivers/hotplug/acpiphp_glue.c |   26 +-------------------------
 1 files changed, 1 insertion(+), 25 deletions(-)


diff -Nru a/drivers/hotplug/acpiphp_glue.c b/drivers/hotplug/acpiphp_glue.c
--- a/drivers/hotplug/acpiphp_glue.c	Wed Jun  4 18:12:11 2003
+++ b/drivers/hotplug/acpiphp_glue.c	Wed Jun  4 18:12:11 2003
@@ -281,30 +281,6 @@
 	return AE_OK;
 }
 
-
-/* find pci_bus structure associated to specific bus number */
-static struct pci_bus *find_pci_bus(const struct list_head *list, int bus)
-{
-	const struct list_head *l;
-
-	list_for_each (l, list) {
-		struct pci_bus *b = pci_bus_b(l);
-		if (b->number == bus)
-			return b;
-
-		if (!list_empty(&b->children)) {
-			/* XXX recursive call */
-			b = find_pci_bus(&b->children, bus);
-
-			if (b)
-				return b;
-		}
-	}
-
-	return NULL;
-}
-
-
 /* decode ACPI 2.0 _HPP hot plug parameters */
 static void decode_hpp(struct acpiphp_bridge *bridge)
 {
@@ -409,7 +385,7 @@
 	bridge->seg = seg;
 	bridge->bus = bus;
 
-	bridge->pci_bus = find_pci_bus(&pci_root_buses, bus);
+	bridge->pci_bus = pci_find_bus(bus);
 
 	bridge->res_lock = SPIN_LOCK_UNLOCKED;
 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05                   ` Greg KH
@ 2003-06-05  2:05                     ` Greg KH
  0 siblings, 0 replies; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.11, 2003/06/04 10:29:42-07:00, greg@kroah.com

[PATCH] PCI: Grab reference count on pci_dev if the pci driver binds to the device.

And remember to decrement the count after remove() is called.


 drivers/pci/pci-driver.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	Wed Jun  4 18:11:37 2003
+++ b/drivers/pci/pci-driver.c	Wed Jun  4 18:11:37 2003
@@ -138,10 +138,11 @@
 
 	drv = to_pci_driver(dev->driver);
 	pci_dev = to_pci_dev(dev);
-	if (get_device(dev)) {
-		error = __pci_device_probe(drv, pci_dev);
-		put_device(dev);
-	}
+	pci_get_dev(pci_dev);
+	error = __pci_device_probe(drv, pci_dev);
+	if (error)
+		pci_put_dev(pci_dev);
+
 	return error;
 }
 
@@ -155,6 +156,7 @@
 			drv->remove(pci_dev);
 		pci_dev->driver = NULL;
 	}
+	pci_put_dev(pci_dev);
 	return 0;
 }
 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05                 ` Greg KH
@ 2003-06-05  2:05                   ` Greg KH
  2003-06-05  2:05                     ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:05 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

ChangeSet 1.1254.4.10, 2003/06/04 00:02:59-07:00, greg@kroah.com

[PATCH] PCI: Move more functions out of include/linux/pci.h that don't need to be there.


 drivers/pci/pci.h   |    4 ++++
 include/linux/pci.h |    5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)


diff -Nru a/drivers/pci/pci.h b/drivers/pci/pci.h
--- a/drivers/pci/pci.h	Wed Jun  4 18:11:42 2003
+++ b/drivers/pci/pci.h	Wed Jun  4 18:11:42 2003
@@ -27,6 +27,10 @@
 extern unsigned int pci_do_scan_bus(struct pci_bus *bus);
 extern void pci_remove_bus_device(struct pci_dev *dev);
 extern int pci_remove_device_safe(struct pci_dev *dev);
+extern unsigned char pci_max_busnr(void);
+extern unsigned char pci_bus_max_busnr(struct pci_bus *bus);
+extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
+extern struct pci_bus *pci_find_bus(unsigned char busnr);
 
 struct pci_dev_wrapped {
 	struct pci_dev	*dev;
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Wed Jun  4 18:11:42 2003
+++ b/include/linux/pci.h	Wed Jun  4 18:11:42 2003
@@ -563,12 +563,8 @@
 				 unsigned int ss_vendor, unsigned int ss_device,
 				 const struct pci_dev *from);
 struct pci_dev *pci_find_class (unsigned int class, const struct pci_dev *from);
-struct pci_bus *pci_find_bus(unsigned char busnr);
 struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
-unsigned char pci_bus_max_busnr(struct pci_bus* bus);
-unsigned char pci_max_busnr(void);
 int pci_find_capability (struct pci_dev *dev, int cap);
-int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
 
 int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
 int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
@@ -620,7 +616,6 @@
 int pci_enable_wake(struct pci_dev *dev, u32 state, int enable);
 
 /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
-
 void pci_bus_assign_resources(struct pci_bus *bus);
 void pci_bus_size_bridges(struct pci_bus *bus);
 int pci_claim_resource(struct pci_dev *, int);


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  1:31 [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70 Greg KH
  2003-06-05  2:05 ` [PATCH] " Greg KH
@ 2003-06-05  2:14 ` Greg KH
  2003-06-05  8:38   ` Dave Jones
  1 sibling, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  2:14 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

On Wed, Jun 04, 2003 at 06:31:47PM -0700, Greg KH wrote:
> 
> p.s. I'll send these as patches in response to this email to lkml for
> those who want to see them.

I don't think everyone really wants to see all 63 different
pci_for_each_dev() removal patches and the huge drivers/hotplug/* move
patch on the mailing lists, so I didn't post them here.  But they are
available, along with all of the patches in this series on your
favoriate kernel.org mirror at:
	kernel.org/pub/linux/kernel/people/gregkh/pci/2.5/*2.5.70*
if people really want to take a look at them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:14 ` [BK PATCH] " Greg KH
@ 2003-06-05  8:38   ` Dave Jones
  2003-06-05  8:49     ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Dave Jones @ 2003-06-05  8:38 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Wed, Jun 04, 2003 at 07:14:52PM -0700, Greg KH wrote:

 > > p.s. I'll send these as patches in response to this email to lkml for
 > > those who want to see them.
 > 
 > I don't think everyone really wants to see all 63 different
 > pci_for_each_dev() removal patches

I'm puzzled why you did..

-	pci_for_each_dev(device)
+	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)

when you could have just added whatever locking pci_find_device() does
to pci_for_each_dev()  You'd then not have had to touch any of these
drivers, and it'd look a damn sight better to look at IMO.

		Dave


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  8:38   ` Dave Jones
@ 2003-06-05  8:49     ` Greg KH
  2003-06-05  8:59       ` Dave Jones
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  8:49 UTC (permalink / raw)
  To: Dave Jones, linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 09:38:15AM +0100, Dave Jones wrote:
> On Wed, Jun 04, 2003 at 07:14:52PM -0700, Greg KH wrote:
> 
>  > > p.s. I'll send these as patches in response to this email to lkml for
>  > > those who want to see them.
>  > 
>  > I don't think everyone really wants to see all 63 different
>  > pci_for_each_dev() removal patches
> 
> I'm puzzled why you did..
> 
> -	pci_for_each_dev(device)
> +	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
> 
> when you could have just added whatever locking pci_find_device() does
> to pci_for_each_dev()  You'd then not have had to touch any of these
> drivers, and it'd look a damn sight better to look at IMO.

pci_for_each_dev() is currently a macro, not a function, and I'm trying
to get rid of all public access to the pci lists.  The majority of pci
drivers use the pci_find_device() function in just the way that I
converted the few remaining users of pci_for_each_dev() to (yeah, "few"
is a relative number, but check out how many people call
pci_find_device()...)

I guess I could create this to clean it up a bit:
#define pci_find_all_devices(dev)	pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)

but that's really not that much of a change...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  8:49     ` Greg KH
@ 2003-06-05  8:59       ` Dave Jones
  2003-06-05  9:06         ` Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Dave Jones @ 2003-06-05  8:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 01:49:33AM -0700, Greg KH wrote:

 > > -	pci_for_each_dev(device)
 > > +	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
 > > 
 > > when you could have just added whatever locking pci_find_device() does
 > > to pci_for_each_dev()  You'd then not have had to touch any of these
 > > drivers, and it'd look a damn sight better to look at IMO.
 > 
 > pci_for_each_dev() is currently a macro, not a function, and I'm trying
 > to get rid of all public access to the pci lists.  The majority of pci
 > drivers use the pci_find_device() function in just the way that I
 > converted the few remaining users of pci_for_each_dev() to (yeah, "few"
 > is a relative number, but check out how many people call
 > pci_find_device()...)
 > 
 > I guess I could create this to clean it up a bit:
 > #define pci_find_all_devices(dev)	pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)
 > 
 > but that's really not that much of a change...

so why not..

#define pci_for_each_dev(dev) \
	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)

?

Seems to be the same change you made tree-wide, with minimal
interruption to drivers.

		Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  8:59       ` Dave Jones
@ 2003-06-05  9:06         ` Greg KH
  2003-06-05  9:18           ` Dave Jones
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05  9:06 UTC (permalink / raw)
  To: Dave Jones, linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 09:59:38AM +0100, Dave Jones wrote:
> On Thu, Jun 05, 2003 at 01:49:33AM -0700, Greg KH wrote:
> 
>  > > -	pci_for_each_dev(device)
>  > > +	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
>  > > 
>  > > when you could have just added whatever locking pci_find_device() does
>  > > to pci_for_each_dev()  You'd then not have had to touch any of these
>  > > drivers, and it'd look a damn sight better to look at IMO.
>  > 
>  > pci_for_each_dev() is currently a macro, not a function, and I'm trying
>  > to get rid of all public access to the pci lists.  The majority of pci
>  > drivers use the pci_find_device() function in just the way that I
>  > converted the few remaining users of pci_for_each_dev() to (yeah, "few"
>  > is a relative number, but check out how many people call
>  > pci_find_device()...)
>  > 
>  > I guess I could create this to clean it up a bit:
>  > #define pci_find_all_devices(dev)	pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)
>  > 
>  > but that's really not that much of a change...
> 
> so why not..
> 
> #define pci_for_each_dev(dev) \
> 	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
> 
> ?
> 
> Seems to be the same change you made tree-wide, with minimal
> interruption to drivers.

But that would have changed the way that pci_for_each_dev() works.  It
would require that dev=NULL before the function is called.  And having
the same function work subtly different on different kernel versions
would not be the best thing.  Getting rid of it entirely was the better
option, and now that Linus has pulled it, we don't have to worry about
it anymore :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  9:06         ` Greg KH
@ 2003-06-05  9:18           ` Dave Jones
  2003-06-05  9:22             ` Russell King
  2003-06-05 17:18             ` Greg KH
  0 siblings, 2 replies; 24+ messages in thread
From: Dave Jones @ 2003-06-05  9:18 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 02:06:45AM -0700, Greg KH wrote:
 > > so why not..
 > > 
 > > #define pci_for_each_dev(dev) \
 > > 	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
 > > 
 > > ?
 > > 
 > > Seems to be the same change you made tree-wide, with minimal
 > > interruption to drivers.
 > 
 > But that would have changed the way that pci_for_each_dev() works.
 > It would require that dev=NULL before the function is called.

trivial to fix.

 > And having
 > the same function work subtly different on different kernel versions
 > would not be the best thing.

ditto.
 
 > Getting rid of it entirely was the better
 > option, and now that Linus has pulled it, we don't have to worry about
 > it anymore :)

The fact that a tree-wide 'cleanup' like this goes in just a few hours
after its posted before chance to comment is another argument, but
concentrating on the technical point here, I still think this is a
step backwards.

		Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  2:05               ` Greg KH
  2003-06-05  2:05                 ` Greg KH
@ 2003-06-05  9:19                 ` Russell King
  2003-06-05 17:04                   ` Greg KH
  1 sibling, 1 reply; 24+ messages in thread
From: Russell King @ 2003-06-05  9:19 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Wed, Jun 04, 2003 at 07:05:47PM -0700, Greg KH wrote:
> diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
> --- a/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> +++ b/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> @@ -129,6 +129,5 @@
>  	}
>  }
>  
> -EXPORT_SYMBOL(pci_bus_alloc_resource);
>  EXPORT_SYMBOL(pci_bus_add_devices);
>  EXPORT_SYMBOL(pci_enable_bridges);

Please don't remove this one.  Its there for stuff like:

drivers/pcmcia/cardbus.c

struct resource *
cb_alloc_io(unsigned long base, unsigned long num,
            unsigned long align, char *name, socket_info_t *s)
{
...
                ret = pci_bus_alloc_resource(bridge->bus, res, num, 1,
                                             min, 0, cardbus_adjust, &ca);
}

ie, so cardbus can decently allocate resources from the parent bus.

(Unfortunately there's a huge pile of other changes which the above
cardbus code relies on, and I fear that its getting rather late to
get them into 2.5.)

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  9:18           ` Dave Jones
@ 2003-06-05  9:22             ` Russell King
  2003-06-05 17:18             ` Greg KH
  1 sibling, 0 replies; 24+ messages in thread
From: Russell King @ 2003-06-05  9:22 UTC (permalink / raw)
  To: Dave Jones, Greg KH, linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 10:18:02AM +0100, Dave Jones wrote:
>  > Getting rid of it entirely was the better
>  > option, and now that Linus has pulled it, we don't have to worry about
>  > it anymore :)
> 
> The fact that a tree-wide 'cleanup' like this goes in just a few hours
> after its posted before chance to comment is another argument, but
> concentrating on the technical point here, I still think this is a
> step backwards.

Indeed; especially when some people who need to comment aren't on US
time.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  9:19                 ` Russell King
@ 2003-06-05 17:04                   ` Greg KH
  2003-06-05 17:57                     ` Russell King
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05 17:04 UTC (permalink / raw)
  To: linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 10:19:36AM +0100, Russell King wrote:
> On Wed, Jun 04, 2003 at 07:05:47PM -0700, Greg KH wrote:
> > diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
> > --- a/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> > +++ b/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> > @@ -129,6 +129,5 @@
> >  	}
> >  }
> >  
> > -EXPORT_SYMBOL(pci_bus_alloc_resource);
> >  EXPORT_SYMBOL(pci_bus_add_devices);
> >  EXPORT_SYMBOL(pci_enable_bridges);
> 
> Please don't remove this one.  Its there for stuff like:
> 
> drivers/pcmcia/cardbus.c

Sorry, I don't see that in the current kernel version of cardbus.c,
otherwise I would not have moved it out.  Feel free to put it back, if
you need it for any future cardbus changes.

Oh, and I was looking at cardbus.c when doing these changes and saw this
old comment:

/*
 * This file is going away.  Cardbus handling has been re-written to be
 * more of a PCI bridge thing, and the PCI code basically does all the
 * resource handling. This has wrappers to make the rest of the PCMCIA
 * subsystem not notice that it's not here any more.
 *
 *              Linus, Jan 2000
 */

Is that ever going to happen?  Just curious, because if so, I can remove
some more functions from pci.h :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05  9:18           ` Dave Jones
  2003-06-05  9:22             ` Russell King
@ 2003-06-05 17:18             ` Greg KH
  2003-06-05 19:10               ` Dave Jones
  1 sibling, 1 reply; 24+ messages in thread
From: Greg KH @ 2003-06-05 17:18 UTC (permalink / raw)
  To: Dave Jones, linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 10:18:02AM +0100, Dave Jones wrote:
> 
> The fact that a tree-wide 'cleanup' like this goes in just a few hours
> after its posted before chance to comment is another argument, but
> concentrating on the technical point here, I still think this is a
> step backwards.

Why?  I just got rid of a function (well macro) that isn't even needed
(as proven by replacing it with an existing function.)  That's
technically a good thing :)

Now I can agree that some of those replacements could be done with a
different function call, as almost none of the replacements in the
driver/* tree really want to walk all of the pci devices in the tree.
They usually just want to walk all devices of a type of pci device (be
it capability, or other trait.)  I'd be glad to take changes of this
sort in the future.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05 17:04                   ` Greg KH
@ 2003-06-05 17:57                     ` Russell King
  0 siblings, 0 replies; 24+ messages in thread
From: Russell King @ 2003-06-05 17:57 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 10:04:10AM -0700, Greg KH wrote:
> On Thu, Jun 05, 2003 at 10:19:36AM +0100, Russell King wrote:
> > On Wed, Jun 04, 2003 at 07:05:47PM -0700, Greg KH wrote:
> > > diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
> > > --- a/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> > > +++ b/drivers/pci/bus.c	Wed Jun  4 18:11:51 2003
> > > @@ -129,6 +129,5 @@
> > >  	}
> > >  }
> > >  
> > > -EXPORT_SYMBOL(pci_bus_alloc_resource);
> > >  EXPORT_SYMBOL(pci_bus_add_devices);
> > >  EXPORT_SYMBOL(pci_enable_bridges);
> > 
> > Please don't remove this one.  Its there for stuff like:
> > 
> > drivers/pcmcia/cardbus.c
> 
> Sorry, I don't see that in the current kernel version of cardbus.c,
> otherwise I would not have moved it out.  Feel free to put it back, if
> you need it for any future cardbus changes.

Well, if people are going to remove stuff, I'm not going to be bothered
to even submit the changes.  I've got enough to do at the moment to go
around putting stuff back into the kernel which I've already submitted.

> /*
>  * This file is going away.  Cardbus handling has been re-written to be
>  * more of a PCI bridge thing, and the PCI code basically does all the
>  * resource handling. This has wrappers to make the rest of the PCMCIA
>  * subsystem not notice that it's not here any more.
>  *
>  *              Linus, Jan 2000
>  */
> 
> Is that ever going to happen?  Just curious, because if so, I can remove
> some more functions from pci.h :)

It doesn't look like it.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70
  2003-06-05 17:18             ` Greg KH
@ 2003-06-05 19:10               ` Dave Jones
  0 siblings, 0 replies; 24+ messages in thread
From: Dave Jones @ 2003-06-05 19:10 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, pcihpd-discuss

On Thu, Jun 05, 2003 at 10:18:35AM -0700, Greg KH wrote:

 > > The fact that a tree-wide 'cleanup' like this goes in just a few hours
 > > after its posted before chance to comment is another argument, but
 > > concentrating on the technical point here, I still think this is a
 > > step backwards.
 > 
 > Why?  I just got rid of a function (well macro) that isn't even needed
 > (as proven by replacing it with an existing function.)  That's
 > technically a good thing :)

Not when that replacement reduces readability, which in the case of
agpgart is all I care about wrt these changes.

 > Now I can agree that some of those replacements could be done with a
 > different function call, as almost none of the replacements in the
 > driver/* tree really want to walk all of the pci devices in the tree.
 > They usually just want to walk all devices of a type of pci device (be
 > it capability, or other trait.)  I'd be glad to take changes of this
 > sort in the future.

Ok, for the ones I'm interested in, (agpgart), I don't see how things
can get much cleaner than they used to be.

07 - hammer. Needs to walk the whole list, matching pci devices on
     bus 0, func 3, slots >23 & <32
	 This set of rules is so specialised, I see it hard to concieve how
	 a generic helper function for the pci layer could be written.
08 - generic. Needs to know about every AGP device on the bus.
     ok, a for_each_agp_dev may actually make life easier here,
	 but as its the only place this happens, consider it inlined,
	 using pci_for_each_dev
09 - isoch. Could also use a 'for_each_agp_dev', but to be honest,
     it shouldn't be scanning at all, but being passed what it needs.

For the time being, I'm actually tempted to hack up a 'for_each_agp_dev'
for the latter two, but 07 still bugs me.

		Dave


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2003-06-05 18:52 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-05  1:31 [BK PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70 Greg KH
2003-06-05  2:05 ` [PATCH] " Greg KH
2003-06-05  2:05   ` Greg KH
2003-06-05  2:05     ` Greg KH
2003-06-05  2:05       ` Greg KH
2003-06-05  2:05         ` Greg KH
2003-06-05  2:05           ` Greg KH
2003-06-05  2:05             ` Greg KH
2003-06-05  2:05               ` Greg KH
2003-06-05  2:05                 ` Greg KH
2003-06-05  2:05                   ` Greg KH
2003-06-05  2:05                     ` Greg KH
2003-06-05  9:19                 ` Russell King
2003-06-05 17:04                   ` Greg KH
2003-06-05 17:57                     ` Russell King
2003-06-05  2:14 ` [BK PATCH] " Greg KH
2003-06-05  8:38   ` Dave Jones
2003-06-05  8:49     ` Greg KH
2003-06-05  8:59       ` Dave Jones
2003-06-05  9:06         ` Greg KH
2003-06-05  9:18           ` Dave Jones
2003-06-05  9:22             ` Russell King
2003-06-05 17:18             ` Greg KH
2003-06-05 19:10               ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).