linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PATCH] PCI patches for 2.6.16-rc1
@ 2006-01-20 19:04 Greg KH
  2006-01-20 19:04 ` [PATCH] PCI: irq and pci_ids: patch for Intel ICH8 Greg KH
  2006-01-20 19:23 ` [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH
  0 siblings, 2 replies; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, linux-pci

Here are some small PCI patches against your latest git tree.  They have
all been in the -mm tree for a while with no problems.

They do the following:
	- document some feature-removal things for the future
	- add support for amd pci hotplug devices to the shpchp driver.
	- fix bugs and update the ppc64 rpaphp pci hotplug driver.
	- add some new and remove some duplicate pci ids.
	- make it more obvious that some msi functions are really being
	  used.

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/

The full patches will be sent to the linux-pci mailing list, if anyone
wants to see them.

thanks,

greg k-h

 Documentation/feature-removal-schedule.txt |   14 +
 arch/i386/pci/irq.c                        |    5 
 drivers/pci/hotplug/Kconfig                |    3 
 drivers/pci/hotplug/acpiphp_ibm.c          |   21 --
 drivers/pci/hotplug/ibmphp_core.c          |    4 
 drivers/pci/hotplug/rpadlpar_core.c        |   64 +++---
 drivers/pci/hotplug/rpaphp.h               |   14 -
 drivers/pci/hotplug/rpaphp_core.c          |  114 ++++++-----
 drivers/pci/hotplug/rpaphp_pci.c           |  277 +----------------------------
 drivers/pci/hotplug/rpaphp_slot.c          |   16 -
 drivers/pci/hotplug/shpchp.h               |   94 +++++++++
 drivers/pci/hotplug/shpchp_ctrl.c          |   12 +
 drivers/pci/msi.c                          |    8 
 drivers/pci/msi.h                          |    6 
 drivers/pci/pci.c                          |    2 
 drivers/pci/setup-res.c                    |    1 
 drivers/video/cyblafb.c                    |    1 
 include/linux/pci.h                        |    2 
 include/linux/pci_ids.h                    |   16 -
 19 files changed, 272 insertions(+), 402 deletions(-)


Adrian Bunk:
      PCI: schedule PCI_LEGACY_PROC for removal
      PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability()

Arthur Othieno:
      PCI: cyblafb: remove pci_module_init() return, really.

Grant Coady:
      PCI: pci_ids: remove duplicates gathered during merge period

Grant Grundler:
      PCI: make it easier to see that set_msi_affinity() is used

Jason Gaston:
      PCI: irq and pci_ids: patch for Intel ICH8

Keck, David:
      PCI Hotplug: shpchp: AMD POGO errata fix

linas:
      PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition)
      PCI Hotplug/powerpc: module build break

linas@austin.ibm.com:
      powerpc/PCI hotplug: cleanup: add prefix
      powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices()
      powerpc/PCI hotplug: merge rpaphp_enable_pci_slot()
      powerpc/PCI hotplug: merge config_pci_adapter
      powerpc/PCI hotplug: minor cleanup forward decls
      powerpc/PCI hotplug: remove rpaphp_find_bus()
      powerpc/PCI hotplug: remove remove_bus_device()
      powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap
      powerpc/PCI hotplug: shuffle error checking to better location.

Mark Rustad:
      PCI: restore 2 missing pci ids

Pavel Machek:
      PCI Hotplug: fix up coding style issues
      PCI Hotplug: fix up Kconfig help text

Richard Knutsson:
      pci: Schedule removal of pci_module_init


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

* [PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition)
  2006-01-20 19:04       ` [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability() Greg KH
@ 2006-01-20 19:04         ` Greg KH
  2006-01-20 19:04           ` [PATCH] PCI Hotplug: fix up coding style issues Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition)

Removing and then adding a PCI slot to a running partition results in
a kernel panic. The current code attempts to add iospace for an entire
root bus, which is inappropriate, and silently fails.  When a pci device
tries to use the iospace, a page fault is taken, as the iospace had not
been mapped, and of course the page fault cannot be resolved.

This only occurs for PCI adapters using pio, which may be why it hadn't
been seen earlier (this seems to have been broken for a while).
This patch has survived testing of dozens of slot add and removes.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 40ae159c997fbabbf864283dda902850d136d5aa
tree 549811a397be6ac3d4549786e5826233d6dd6c81
parent ac71be89ce24827756ab7f725c01c3f83b9b3851
author linas <linas@austin.ibm.com> Thu, 12 Jan 2006 14:36:25 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 drivers/pci/hotplug/rpadlpar_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 7d93dba..7f504b3 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -152,7 +152,7 @@ static struct pci_dev *dlpar_pci_add_bus
 	pcibios_claim_one_bus(dev->bus);
 
 	/* ioremap() for child bus, which may or may not succeed */
-	(void) remap_bus_range(dev->bus);
+	remap_bus_range(dev->subordinate);
 
 	/* Add new devices to global lists.  Register in proc, sysfs. */
 	pci_bus_add_devices(phb->bus);


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

* [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability()
  2006-01-20 19:04     ` [PATCH] pci: Schedule removal of pci_module_init Greg KH
@ 2006-01-20 19:04       ` Greg KH
  2006-01-20 19:04         ` [PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition) Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: bunk

[PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability()

This patch #if 0's the unused global function pci_find_ext_capability().

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit fcac4238faf5cace3946d6c0102c176370483ed6
tree aadecf0a10301aebeeb69d12d6709e14e6fef511
parent ac142f4e6f34d59ae0554dc96fe5bb030df02ab9
author Adrian Bunk <bunk@stusta.de> Fri, 06 Jan 2006 03:25:37 +0100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:33 -0800

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

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d2a633e..d2d1879 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -163,6 +163,7 @@ int pci_bus_find_capability(struct pci_b
 	return __pci_bus_find_cap(bus, devfn, hdr_type & 0x7f, cap);
 }
 
+#if 0
 /**
  * pci_find_ext_capability - Find an extended capability
  * @dev: PCI device to query
@@ -210,6 +211,7 @@ int pci_find_ext_capability(struct pci_d
 
 	return 0;
 }
+#endif  /*  0  */
 
 /**
  * pci_find_parent_resource - return resource region of parent bus of given region
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0a44072..fe1a2b0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -406,7 +406,6 @@ struct pci_dev *pci_find_device_reverse 
 struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
 int pci_find_capability (struct pci_dev *dev, int cap);
 int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
-int pci_find_ext_capability (struct pci_dev *dev, int cap);
 struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
 
 struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -626,7 +625,6 @@ static inline int pci_register_driver(st
 static inline void pci_unregister_driver(struct pci_driver *drv) { }
 static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
 static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
-static inline int pci_find_ext_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; }
 
 /* Power management related routines */


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

* [PATCH] PCI: irq and pci_ids: patch for Intel ICH8
  2006-01-20 19:04 [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH
@ 2006-01-20 19:04 ` Greg KH
  2006-01-20 19:04   ` [PATCH] PCI: schedule PCI_LEGACY_PROC for removal Greg KH
  2006-01-20 19:23 ` [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH
  1 sibling, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: jason.d.gaston

[PATCH] PCI: irq and pci_ids: patch for Intel ICH8

This patch adds the Intel ICH8 DID's to the irq.c and pci_ids.h files.

Signed-off-by: Jason Gaston <Jason.d.gaston@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit ac142f4e6f34d59ae0554dc96fe5bb030df02ab9
tree 7c4c0079727fa1e4c5bbfe08ca3fca3ec93445f3
parent e63ee95d25ba6663180153b7533f9c0fe77eb9dd
author Jason Gaston <jason.d.gaston@intel.com> Mon, 09 Jan 2006 10:53:45 -0800
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:33 -0800

 arch/i386/pci/irq.c     |    5 +++++
 include/linux/pci_ids.h |    7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index e715aa9..3ca59ca 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -539,6 +539,11 @@ static __init int intel_router_probe(str
 		case PCI_DEVICE_ID_INTEL_ICH7_30:
 		case PCI_DEVICE_ID_INTEL_ICH7_31:
 		case PCI_DEVICE_ID_INTEL_ESB2_0:
+		case PCI_DEVICE_ID_INTEL_ICH8_0:
+		case PCI_DEVICE_ID_INTEL_ICH8_1:
+		case PCI_DEVICE_ID_INTEL_ICH8_2:
+		case PCI_DEVICE_ID_INTEL_ICH8_3:
+		case PCI_DEVICE_ID_INTEL_ICH8_4:
 			r->name = "PIIX/ICH";
 			r->get = pirq_piix_get;
 			r->set = pirq_piix_set;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ecc1fc1..117e023 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2104,6 +2104,13 @@
 #define PCI_DEVICE_ID_INTEL_ICH7_19	0x27dd
 #define PCI_DEVICE_ID_INTEL_ICH7_20	0x27de
 #define PCI_DEVICE_ID_INTEL_ICH7_21	0x27df
+#define PCI_DEVICE_ID_INTEL_ICH8_0	0x2810
+#define PCI_DEVICE_ID_INTEL_ICH8_1	0x2811
+#define PCI_DEVICE_ID_INTEL_ICH8_2	0x2812
+#define PCI_DEVICE_ID_INTEL_ICH8_3	0x2814
+#define PCI_DEVICE_ID_INTEL_ICH8_4	0x2815
+#define PCI_DEVICE_ID_INTEL_ICH8_5	0x283e
+#define PCI_DEVICE_ID_INTEL_ICH8_6	0x2850
 #define PCI_DEVICE_ID_INTEL_82855PM_HB	0x3340
 #define PCI_DEVICE_ID_INTEL_82830_HB	0x3575
 #define PCI_DEVICE_ID_INTEL_82830_CGC	0x3577


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

* [PATCH] pci: Schedule removal of pci_module_init
  2006-01-20 19:04   ` [PATCH] PCI: schedule PCI_LEGACY_PROC for removal Greg KH
@ 2006-01-20 19:04     ` Greg KH
  2006-01-20 19:04       ` [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability() Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: ricknu-0

[PATCH] pci: Schedule removal of pci_module_init

Scheduled the removal of pci_module_init.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit e63ee95d25ba6663180153b7533f9c0fe77eb9dd
tree 681c68b11871411bac7fe9495b2a529ee6cd5f4e
parent ba2320f76f3b46144b69ebacedcc03e81107fd9a
author Richard Knutsson <ricknu-0@student.ltu.se> Sat, 03 Dec 2005 02:34:12 +0100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:33 -0800

 Documentation/feature-removal-schedule.txt |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index b8143bd..4d4897c 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -155,3 +155,10 @@ What:	Legacy /proc/pci interface (PCI_LE
 When:	March 2006
 Why:	deprecated since 2.5.53 in favor of lspci(8)
 Who:	Adrian Bunk <bunk@stusta.de>
+
+---------------------------
+
+What:	pci_module_init(driver)
+When:	January 2007
+Why:	Is replaced by pci_register_driver(pci_driver).
+Who:	Richard Knutsson <ricknu-0@student.ltu.se> and Greg Kroah-Hartman <gregkh@suse.de>


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

* [PATCH] PCI: schedule PCI_LEGACY_PROC for removal
  2006-01-20 19:04 ` [PATCH] PCI: irq and pci_ids: patch for Intel ICH8 Greg KH
@ 2006-01-20 19:04   ` Greg KH
  2006-01-20 19:04     ` [PATCH] pci: Schedule removal of pci_module_init Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: bunk

[PATCH] PCI: schedule PCI_LEGACY_PROC for removal

PCI_LEGACY_PROC is deprecated since 2.5.53 in favor of lspci(8).

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit ba2320f76f3b46144b69ebacedcc03e81107fd9a
tree ed0c786c9b2a1d34680ab1efd01afe5e7dfa7319
parent 3ee68c4af3fd7228c1be63254b9f884614f9ebb2
author Adrian Bunk <bunk@stusta.de> Thu, 29 Dec 2005 20:07:25 +0100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:33 -0800

 Documentation/feature-removal-schedule.txt |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index b4a1ea7..b8143bd 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -148,3 +148,10 @@ Why:	The 8250 serial driver now has the 
 	brother on Alchemy SOCs.  The loss of features is not considered an
 	issue.
 Who:	Ralf Baechle <ralf@linux-mips.org>
+
+---------------------------
+
+What:	Legacy /proc/pci interface (PCI_LEGACY_PROC)
+When:	March 2006
+Why:	deprecated since 2.5.53 in favor of lspci(8)
+Who:	Adrian Bunk <bunk@stusta.de>


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

* [PATCH] PCI: restore 2 missing pci ids
  2006-01-20 19:04                 ` [PATCH] PCI Hotplug: shpchp: AMD POGO errata fix Greg KH
@ 2006-01-20 19:04                   ` Greg KH
  2006-01-20 19:04                     ` [PATCH] PCI Hotplug/powerpc: module build break Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: MRustad

[PATCH] PCI: restore 2 missing pci ids

Somewhere between 2.6.14 and 2.6.15-rc3, some PCI ids were apparently
removed.  The ecc.c module, which is not a part of the kernel.org tree, but
included in some distributions, fails to compile.

Signed-off-by: Mark Rustad <mrustad@mac.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 9b88de850747ab8ff39ce31ca6ff788210f9441a
tree a9ba9136f00c3434c6adf741b9b3f9308af42d73
parent d181278c96e0b59478bef909ec2476c40169e7ba
author Mark Rustad <MRustad@mac.com> Thu, 05 Jan 2006 22:47:29 -0800
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 include/linux/pci_ids.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 117e023..560b26a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2065,6 +2065,7 @@
 #define PCI_DEVICE_ID_INTEL_82801EB_5	0x24d5
 #define PCI_DEVICE_ID_INTEL_82801EB_6	0x24d6
 #define PCI_DEVICE_ID_INTEL_82801EB_11	0x24db
+#define PCI_DEVICE_ID_INTEL_82801EB_13	0x24dd
 #define PCI_DEVICE_ID_INTEL_ESB_1	0x25a1
 #define PCI_DEVICE_ID_INTEL_ESB_2	0x25a2
 #define PCI_DEVICE_ID_INTEL_ESB_4	0x25a4
@@ -2154,6 +2155,7 @@
 #define PCI_DEVICE_ID_INTEL_82443GX_2	0x71a2
 #define PCI_DEVICE_ID_INTEL_82372FB_1	0x7601
 #define PCI_DEVICE_ID_INTEL_82454GX	0x84c4
+#define PCI_DEVICE_ID_INTEL_82450GX	0x84c5
 #define PCI_DEVICE_ID_INTEL_82451NX	0x84ca
 #define PCI_DEVICE_ID_INTEL_82454NX     0x84cb
 #define PCI_DEVICE_ID_INTEL_84460GX	0x84ea


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

* [PATCH] PCI Hotplug/powerpc: module build break
  2006-01-20 19:04                   ` [PATCH] PCI: restore 2 missing pci ids Greg KH
@ 2006-01-20 19:04                     ` Greg KH
  2006-01-20 19:04                       ` [PATCH] PCI Hotplug: fix up Kconfig help text Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] PCI Hotplug/powerpc: module build break

The RPAPHP hoplug driver will not build as a module, because it calls
on pci_claim_resource(), which is not exported. This exports the symbol.
Problem reported by Olaf Hering <olh@suse.de>

A grep indicates that building drivers/parisc/lba_pci.c
would have trouble building as a module for the same reason.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit ac71be89ce24827756ab7f725c01c3f83b9b3851
tree af94ca4835ef23ac81974b35ba0dc3edb3894648
parent 6404e7c38021e2e9bed564ee3ede2afe43611c3b
author linas <linas@austin.ibm.com> Tue, 10 Jan 2006 15:15:47 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 drivers/pci/setup-res.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 50d6685..ea9277b 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -112,6 +112,7 @@ pci_claim_resource(struct pci_dev *dev, 
 
 	return err;
 }
+EXPORT_SYMBOL_GPL(pci_claim_resource);
 
 int pci_assign_resource(struct pci_dev *dev, int resno)
 {


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

* [PATCH] PCI Hotplug: fix up coding style issues
  2006-01-20 19:04         ` [PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition) Greg KH
@ 2006-01-20 19:04           ` Greg KH
  2006-01-20 19:04             ` [PATCH] PCI: pci_ids: remove duplicates gathered during merge period Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: pavel

[PATCH] PCI Hotplug: fix up coding style issues

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 4153374c18ee71fa8bdaa6a7e88ec42f8ec633f4
tree 9357f0c6a5eafe316803b3151c013bcac3c99bf4
parent 705f309deedc7b2c5c00d89f78336f1e68fe504b
author Pavel Machek <pavel@ucw.cz> Sun, 08 Jan 2006 20:11:59 +0100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 drivers/pci/hotplug/acpiphp_ibm.c |   21 +++++++++------------
 drivers/pci/hotplug/ibmphp_core.c |    4 ++--
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 7e7f913..317457d 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -302,7 +302,7 @@ static int ibm_get_table_from_acpi(char 
 	}
 
 	package = (union acpi_object *) buffer.pointer;
-	if(!(package) ||
+	if (!(package) ||
 			(package->type != ACPI_TYPE_PACKAGE) ||
 			!(package->package.elements)) {
 		err("%s:  Invalid APCI object\n", __FUNCTION__);
@@ -405,7 +405,7 @@ static acpi_status __init ibm_find_acpi_
 	}
 	info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0';
 
-	if(info.current_status && (info.valid & ACPI_VALID_HID) &&
+	if (info.current_status && (info.valid & ACPI_VALID_HID) &&
 			(!strcmp(info.hardware_id.value, IBM_HARDWARE_ID1) ||
 			!strcmp(info.hardware_id.value, IBM_HARDWARE_ID2))) {
 		dbg("found hardware: %s, handle: %p\n", info.hardware_id.value,
@@ -449,13 +449,11 @@ static int __init ibm_acpiphp_init(void)
 	}
 
 	ibm_note.device = device;
-	status = acpi_install_notify_handler(
-			ibm_acpi_handle,
-			ACPI_DEVICE_NOTIFY,
-			ibm_handle_events,
+	status = acpi_install_notify_handler(ibm_acpi_handle,
+			ACPI_DEVICE_NOTIFY, ibm_handle_events,
 			&ibm_note);
 	if (ACPI_FAILURE(status)) {
-		err("%s:  Failed to register notification handler\n",
+		err("%s: Failed to register notification handler\n",
 				__FUNCTION__);
 		retval = -EBUSY;
 		goto init_cleanup;
@@ -482,14 +480,13 @@ static void __exit ibm_acpiphp_exit(void
 	if (acpiphp_unregister_attention(&ibm_attention_info))
 		err("%s: attention info deregistration failed", __FUNCTION__);
 
-	   status = acpi_remove_notify_handler(
+	status = acpi_remove_notify_handler(
 			   ibm_acpi_handle,
 			   ACPI_DEVICE_NOTIFY,
 			   ibm_handle_events);
-	   if (ACPI_FAILURE(status))
-		   err("%s:  Notification handler removal failed\n",
-				   __FUNCTION__);
-	// remove the /sys entries
+	if (ACPI_FAILURE(status))
+		err("%s: Notification handler removal failed\n", __FUNCTION__);
+	/* remove the /sys entries */
 	if (sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr))
 		err("%s: removal of sysfs file apci_table failed\n",
 				__FUNCTION__);
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index aabf1e7..dc59da6 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -235,12 +235,12 @@ static int set_attention_status(struct h
 {
 	int rc = 0;
 	struct slot *pslot;
-	u8 cmd;
+	u8 cmd = 0x00;     /* avoid compiler warning */
 
 	debug("set_attention_status - Entry hotplug_slot[%lx] value[%x]\n",
 			(ulong) hotplug_slot, value);
 	ibmphp_lock_operations();
-	cmd = 0x00;     // avoid compiler warning
+
 
 	if (hotplug_slot) {
 		switch (value) {


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

* [PATCH] PCI: pci_ids: remove duplicates gathered during merge period
  2006-01-20 19:04           ` [PATCH] PCI Hotplug: fix up coding style issues Greg KH
@ 2006-01-20 19:04             ` Greg KH
  2006-01-20 19:04               ` [PATCH] PCI: make it easier to see that set_msi_affinity() is used Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: gcoady

[PATCH] PCI: pci_ids: remove duplicates gathered during merge period

pci_ids.h: remove duplicates.  Compile tested allmodconfig.

Signed-off-by: Grant Coady <gcoady@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 6404e7c38021e2e9bed564ee3ede2afe43611c3b
tree 44e17a37e7d0648a39d9a7319d1f563ed1a1b2e5
parent 9b88de850747ab8ff39ce31ca6ff788210f9441a
author Grant Coady <gcoady@gmail.com> Sun, 15 Jan 2006 16:21:27 +1100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 include/linux/pci_ids.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 560b26a..ab8593a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -394,14 +394,9 @@
 #define PCI_DEVICE_ID_NS_SC1100_SMI	0x0511
 #define PCI_DEVICE_ID_NS_SC1100_XBUS	0x0515
 #define PCI_DEVICE_ID_NS_87410		0xd001
-#define PCI_DEVICE_ID_NS_CS5535_IDE	0x002d
 
 #define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE  0x0028
 #define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE   0x002b
-#define PCI_DEVICE_ID_NS_CS5535_IDE          0x002d
-#define PCI_DEVICE_ID_NS_CS5535_AUDIO        0x002e
-#define PCI_DEVICE_ID_NS_CS5535_USB          0x002f
-#define PCI_DEVICE_ID_NS_CS5535_VIDEO        0x0030
 
 #define PCI_VENDOR_ID_TSENG		0x100c
 #define PCI_DEVICE_ID_TSENG_W32P_2	0x3202
@@ -511,8 +506,6 @@
 #define PCI_DEVICE_ID_AMD_CS5536_UOC    0x2097
 #define PCI_DEVICE_ID_AMD_CS5536_IDE    0x209A
 
-#define PCI_DEVICE_ID_AMD_CS5536_IDE	0x209A
-
 #define PCI_DEVICE_ID_AMD_LX_VIDEO  0x2081
 #define PCI_DEVICE_ID_AMD_LX_AES    0x2082
 


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

* [PATCH] PCI: make it easier to see that set_msi_affinity() is used
  2006-01-20 19:04             ` [PATCH] PCI: pci_ids: remove duplicates gathered during merge period Greg KH
@ 2006-01-20 19:04               ` Greg KH
  2006-01-20 19:04                 ` [PATCH] PCI Hotplug: shpchp: AMD POGO errata fix Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: iod00d

[PATCH] PCI: make it easier to see that set_msi_affinity() is used

I missed this usage in drivers/pci/msi.h:

#ifdef CONFIG_SMP
#define set_msi_irq_affinity    set_msi_affinity
#else
#define set_msi_irq_affinity    NULL
#endif

set_msi_affinity() is declared and exclusively used in msi.c.
Here's a better way so (hopefully) history doesn't repeat itself.

Signed-off-by: Grant Grundler <iod00d@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 705f309deedc7b2c5c00d89f78336f1e68fe504b
tree 77308ae642b7c796f28f65efd66b25aeb83659f5
parent fcac4238faf5cace3946d6c0102c176370483ed6
author Grant Grundler <iod00d@hp.com> Tue, 03 Jan 2006 18:51:46 -0800
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

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

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 202b750..8977556 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -137,6 +137,8 @@ static void set_msi_affinity(unsigned in
 		break;
 	}
 }
+#else
+#define set_msi_affinity NULL
 #endif /* CONFIG_SMP */
 
 static void mask_MSI_irq(unsigned int vector)
@@ -214,7 +216,7 @@ static struct hw_interrupt_type msix_irq
 	.disable	= mask_MSI_irq,
 	.ack		= mask_MSI_irq,
 	.end		= end_msi_irq_w_maskbit,
-	.set_affinity	= set_msi_irq_affinity
+	.set_affinity	= set_msi_affinity
 };
 
 /*
@@ -230,7 +232,7 @@ static struct hw_interrupt_type msi_irq_
 	.disable	= mask_MSI_irq,
 	.ack		= mask_MSI_irq,
 	.end		= end_msi_irq_w_maskbit,
-	.set_affinity	= set_msi_irq_affinity
+	.set_affinity	= set_msi_affinity
 };
 
 /*
@@ -246,7 +248,7 @@ static struct hw_interrupt_type msi_irq_
 	.disable	= do_nothing,
 	.ack		= do_nothing,
 	.end		= end_msi_irq_wo_maskbit,
-	.set_affinity	= set_msi_irq_affinity
+	.set_affinity	= set_msi_affinity
 };
 
 static void msi_data_init(struct msg_data *msi_data,
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h
index 402136a..4ac52d4 100644
--- a/drivers/pci/msi.h
+++ b/drivers/pci/msi.h
@@ -22,12 +22,6 @@ extern int vector_irq[NR_VECTORS];
 extern void (*interrupt[NR_IRQS])(void);
 extern int pci_vector_resources(int last, int nr_released);
 
-#ifdef CONFIG_SMP
-#define set_msi_irq_affinity	set_msi_affinity
-#else
-#define set_msi_irq_affinity	NULL
-#endif
-
 /*
  * MSI-X Address Register
  */


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

* [PATCH] PCI Hotplug: shpchp: AMD POGO errata fix
  2006-01-20 19:04               ` [PATCH] PCI: make it easier to see that set_msi_affinity() is used Greg KH
@ 2006-01-20 19:04                 ` Greg KH
  2006-01-20 19:04                   ` [PATCH] PCI: restore 2 missing pci ids Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: david.keck

[PATCH] PCI Hotplug: shpchp: AMD POGO errata fix

This patch fixes the AMD POGO errata on the hotplug controller where the
platform will lock up or reboot if PERR/SERR generation is enabled and a
slot is sent an enable command.  This fix disables PERR/SERR generation
before a slot is sent the enable command by first saving related
registers, turning off SERR/PERR generation, enabling the slot, then
restoring the registers.

Signed-off-by: David Keck <david.keck@amd.com>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 74fe8a7679336ce8229401b13f7af364694818b1
tree 7e81db557f6d91a08ef8bcea60c4910fd7de1d86
parent 40ae159c997fbabbf864283dda902850d136d5aa
author Keck, David <david.keck@amd.com> Mon, 16 Jan 2006 15:22:36 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 drivers/pci/hotplug/shpchp.h      |   94 +++++++++++++++++++++++++++++++++++++
 drivers/pci/hotplug/shpchp_ctrl.c |   12 ++++-
 2 files changed, 105 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index ce0e9b6..7d6f521 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -95,6 +95,7 @@ struct controller {
 	u8 function;
 	u8 slot_device_offset;
 	u8 add_support;
+	u32 pcix_misc2_reg;	/* for amd pogo errata */
 	enum pci_bus_speed speed;
 	u32 first_slot;		/* First physical slot number */
 	u8 slot_bus;		/* Bus where the slots handled by this controller sit */
@@ -113,6 +114,26 @@ struct hotplug_params {
 
 /* Define AMD SHPC ID  */
 #define PCI_DEVICE_ID_AMD_GOLAM_7450	0x7450 
+#define PCI_DEVICE_ID_AMD_POGO_7458	0x7458
+
+/* AMD PCIX bridge registers */
+
+#define PCIX_MEM_BASE_LIMIT_OFFSET	0x1C
+#define PCIX_MISCII_OFFSET		0x48
+#define PCIX_MISC_BRIDGE_ERRORS_OFFSET	0x80
+
+/* AMD PCIX_MISCII masks and offsets */
+#define PERRNONFATALENABLE_MASK		0x00040000
+#define PERRFATALENABLE_MASK		0x00080000
+#define PERRFLOODENABLE_MASK		0x00100000
+#define SERRNONFATALENABLE_MASK		0x00200000
+#define SERRFATALENABLE_MASK		0x00400000
+
+/* AMD PCIX_MISC_BRIDGE_ERRORS masks and offsets */
+#define PERR_OBSERVED_MASK		0x00000001
+
+/* AMD PCIX_MEM_BASE_LIMIT masks */
+#define RSE_MASK			0x40000000
 
 #define INT_BUTTON_IGNORE		0
 #define INT_PRESENCE_ON			1
@@ -333,6 +354,79 @@ static inline int wait_for_ctrl_irq (str
 	return retval;
 }
 
+static inline void amd_pogo_errata_save_misc_reg(struct slot *p_slot)
+{
+	u32 pcix_misc2_temp;
+
+	/* save MiscII register */
+	pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp);
+
+	p_slot->ctrl->pcix_misc2_reg = pcix_misc2_temp;
+
+	/* clear SERR/PERR enable bits */
+	pcix_misc2_temp &= ~SERRFATALENABLE_MASK;
+	pcix_misc2_temp &= ~SERRNONFATALENABLE_MASK;
+	pcix_misc2_temp &= ~PERRFLOODENABLE_MASK;
+	pcix_misc2_temp &= ~PERRFATALENABLE_MASK;
+	pcix_misc2_temp &= ~PERRNONFATALENABLE_MASK;
+	pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, pcix_misc2_temp);
+}
+
+static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot)
+{
+	u32 pcix_misc2_temp;
+	u32 pcix_bridge_errors_reg;
+	u32 pcix_mem_base_reg;
+	u8  perr_set;
+	u8  rse_set;
+
+	/* write-one-to-clear Bridge_Errors[ PERR_OBSERVED ] */
+	pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, &pcix_bridge_errors_reg);
+	perr_set = pcix_bridge_errors_reg & PERR_OBSERVED_MASK;
+	if (perr_set) {
+		dbg ("%s  W1C: Bridge_Errors[ PERR_OBSERVED = %08X]\n",__FUNCTION__ , perr_set);
+
+		pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, perr_set);
+	}
+
+	/* write-one-to-clear Memory_Base_Limit[ RSE ] */
+	pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, &pcix_mem_base_reg);
+	rse_set = pcix_mem_base_reg & RSE_MASK;
+	if (rse_set) {
+		dbg ("%s  W1C: Memory_Base_Limit[ RSE ]\n",__FUNCTION__ );
+
+		pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set);
+	}
+	/* restore MiscII register */
+	pci_read_config_dword( p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp );
+
+	if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK)
+		pcix_misc2_temp |= SERRFATALENABLE_MASK;
+	else
+		pcix_misc2_temp &= ~SERRFATALENABLE_MASK;
+
+	if (p_slot->ctrl->pcix_misc2_reg & SERRNONFATALENABLE_MASK)
+		pcix_misc2_temp |= SERRNONFATALENABLE_MASK;
+	else
+		pcix_misc2_temp &= ~SERRNONFATALENABLE_MASK;
+
+	if (p_slot->ctrl->pcix_misc2_reg & PERRFLOODENABLE_MASK)
+		pcix_misc2_temp |= PERRFLOODENABLE_MASK;
+	else
+		pcix_misc2_temp &= ~PERRFLOODENABLE_MASK;
+
+	if (p_slot->ctrl->pcix_misc2_reg & PERRFATALENABLE_MASK)
+		pcix_misc2_temp |= PERRFATALENABLE_MASK;
+	else
+		pcix_misc2_temp &= ~PERRFATALENABLE_MASK;
+
+	if (p_slot->ctrl->pcix_misc2_reg & PERRNONFATALENABLE_MASK)
+		pcix_misc2_temp |= PERRNONFATALENABLE_MASK;
+	else
+		pcix_misc2_temp &= ~PERRNONFATALENABLE_MASK;
+	pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, pcix_misc2_temp);
+}
+
 #define SLOT_NAME_SIZE 10
 
 static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot)
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 25ccb0e..643252d 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -894,7 +894,17 @@ int shpchp_enable_slot (struct slot *p_s
 	dbg("%s: p_slot->pwr_save %x\n", __FUNCTION__, p_slot->pwr_save);
 	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 
-	rc = board_added(p_slot);
+	if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) ||
+	    (p_slot->ctrl->pci_dev->device == PCI_DEVICE_ID_AMD_POGO_7458))
+	     && p_slot->ctrl->num_slots == 1) {
+		/* handle amd pogo errata; this must be done before enable  */
+		amd_pogo_errata_save_misc_reg(p_slot);
+		rc = board_added(p_slot);
+		/* handle amd pogo errata; this must be done after enable  */
+		amd_pogo_errata_restore_misc_reg(p_slot);
+	} else
+		rc = board_added(p_slot);
+
 	if (rc) {
 		p_slot->hpc_ops->get_adapter_status(p_slot,
 				&(p_slot->presence_save));


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

* [PATCH] powerpc/PCI hotplug: remove rpaphp_find_bus()
  2006-01-20 19:04                                 ` [PATCH] powerpc/PCI hotplug: minor cleanup forward decls Greg KH
@ 2006-01-20 19:04                                   ` Greg KH
  2006-01-20 19:04                                     ` [PATCH] powerpc/PCI hotplug: remove remove_bus_device() Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: remove rpaphp_find_bus()

The function rpaphp_find_pci_bus() has been migrated to
pcibios_find_pci_bus() in arch/powerpc/platforms/pseries/pci_dlpar.c
This patch removes the old version.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 42ce64544f4cfbafcf8a0fbe779414d2bf81e607
tree 9863ef9598e83536182d6b509f7a5f2708bcb57c
parent 74fe8a7679336ce8229401b13f7af364694818b1
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:18:26 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpadlpar_core.c |    6 +++---
 drivers/pci/hotplug/rpaphp.h        |    3 ---
 drivers/pci/hotplug/rpaphp_pci.c    |   34 ++--------------------------------
 3 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 7f504b3..bc17a13 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -174,7 +174,7 @@ static int dlpar_add_pci_slot(char *drc_
 {
 	struct pci_dev *dev;
 
-	if (rpaphp_find_pci_bus(dn))
+	if (pcibios_find_pci_bus(dn))
 		return -EINVAL;
 
 	/* Add pci bus */
@@ -221,7 +221,7 @@ static int dlpar_remove_phb(char *drc_na
 	struct pci_dn *pdn;
 	int rc = 0;
 
-	if (!rpaphp_find_pci_bus(dn))
+	if (!pcibios_find_pci_bus(dn))
 		return -EINVAL;
 
 	slot = find_slot(dn);
@@ -366,7 +366,7 @@ int dlpar_remove_pci_slot(char *drc_name
 	struct pci_bus *bus;
 	struct slot *slot;
 
-	bus = rpaphp_find_pci_bus(dn);
+	bus = pcibios_find_pci_bus(dn);
 	if (!bus)
 		return -EINVAL;
 
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 57ea71a..b333a35 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -88,13 +88,10 @@ extern int num_slots;
 /* function prototypes */
 
 /* rpaphp_pci.c */
-extern struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn);
-extern int rpaphp_claim_resource(struct pci_dev *dev, int resource);
 extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
 extern void rpaphp_init_new_devs(struct pci_bus *bus);
-extern void rpaphp_eeh_init_nodes(struct device_node *dn);
 
 extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
 extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 396b54b..f16d0f9 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -32,36 +32,6 @@
 #include "../pci.h"		/* for pci_add_new_bus */
 #include "rpaphp.h"
 
-static struct pci_bus *find_bus_among_children(struct pci_bus *bus,
-					struct device_node *dn)
-{
-	struct pci_bus *child = NULL;
-	struct list_head *tmp;
-	struct device_node *busdn;
-
-	busdn = pci_bus_to_OF_node(bus);
-	if (busdn == dn)
-		return bus;
-
-	list_for_each(tmp, &bus->children) {
-		child = find_bus_among_children(pci_bus_b(tmp), dn);
-		if (child)
-			break;
-	}
-	return child;
-}
-
-struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn)
-{
-	struct pci_dn *pdn = dn->data;
-
-	if (!pdn  || !pdn->phb || !pdn->phb->bus)
-		return NULL;
-
-	return find_bus_among_children(pdn->phb->bus, dn);
-}
-EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus);
-
 static int rpaphp_get_sensor_state(struct slot *slot, int *state)
 {
 	int rc;
@@ -120,7 +90,7 @@ int rpaphp_get_pci_adapter_status(struct
 			/* config/unconfig adapter */
 			*value = slot->state;
 		} else {
-			bus = rpaphp_find_pci_bus(slot->dn);
+			bus = pcibios_find_pci_bus(slot->dn);
 			if (bus && !list_empty(&bus->devices))
 				*value = CONFIGURED;
 			else
@@ -370,7 +340,7 @@ static int setup_pci_slot(struct slot *s
 	struct pci_bus *bus;
 
 	BUG_ON(!dn);
-	bus = rpaphp_find_pci_bus(dn);
+	bus = pcibios_find_pci_bus(dn);
 	if (!bus) {
 		err("%s: no pci_bus for dn %s\n", __FUNCTION__, dn->full_name);
 		goto exit_rc;


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

* [PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices()
  2006-01-20 19:04                         ` [PATCH] powerpc/PCI hotplug: cleanup: add prefix Greg KH
@ 2006-01-20 19:04                           ` Greg KH
  2006-01-20 19:04                             ` [PATCH] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot() Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices()

The function rpaphp_fixup_new_pci_devices() has been migrated to
pcibios_fixup_new_pci_devices() in
arch/powerpc/platforms/pseries/pci_dlpar.c
This patch removes the old version.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 22a585a88bd1cdd7d3b757b1b6d57d7ce12b3e08
tree 298814389983cc63cdbaba0e45f8fa92685a2c0e
parent 42ce64544f4cfbafcf8a0fbe779414d2bf81e607
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:20:26 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpadlpar_core.c |    2 
 drivers/pci/hotplug/rpaphp.h        |    1 
 drivers/pci/hotplug/rpaphp_pci.c    |  142 -----------------------------------
 3 files changed, 2 insertions(+), 143 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index bc17a13..6c14810 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -146,7 +146,7 @@ static struct pci_dev *dlpar_pci_add_bus
 	    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
 		of_scan_pci_bridge(dn, dev);
 
-	rpaphp_init_new_devs(dev->subordinate);
+	pcibios_fixup_new_pci_devices(dev->subordinate,0);
 
 	/* Claim new bus resources */
 	pcibios_claim_one_bus(dev->bus);
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index b333a35..6aa91ef 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -91,7 +91,6 @@ extern int num_slots;
 extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
-extern void rpaphp_init_new_devs(struct pci_bus *bus);
 
 extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
 extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index f16d0f9..1a12ebd 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -101,140 +101,6 @@ exit:
 	return rc;
 }
 
-/* Must be called before pci_bus_add_devices */
-void rpaphp_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
-{
-	struct pci_dev *dev;
-
-	list_for_each_entry(dev, &bus->devices, bus_list) {
-		/*
-		 * Skip already-present devices (which are on the
-		 * global device list.)
-		 */
-		if (list_empty(&dev->global_list)) {
-			int i;
-			
-			/* Need to setup IOMMU tables */
-			ppc_md.iommu_dev_setup(dev);
-
-			if(fix_bus)
-				pcibios_fixup_device_resources(dev, bus);
-			pci_read_irq_line(dev);
-			for (i = 0; i < PCI_NUM_RESOURCES; i++) {
-				struct resource *r = &dev->resource[i];
-
-				if (r->parent || !r->start || !r->flags)
-					continue;
-				pci_claim_resource(dev, i);
-			}
-		}
-	}
-}
-
-static void rpaphp_eeh_add_bus_device(struct pci_bus *bus)
-{
-	struct pci_dev *dev;
-
-	list_for_each_entry(dev, &bus->devices, bus_list) {
-		eeh_add_device_late(dev);
-		if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
-			struct pci_bus *subbus = dev->subordinate;
-			if (subbus)
-				rpaphp_eeh_add_bus_device (subbus);
-		}
-	}
-}
-
-static int rpaphp_pci_config_bridge(struct pci_dev *dev)
-{
-	u8 sec_busno;
-	struct pci_bus *child_bus;
-	struct pci_dev *child_dev;
-
-	dbg("Enter %s:  BRIDGE dev=%s\n", __FUNCTION__, pci_name(dev));
-
-	/* get busno of downstream bus */
-	pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
-		
-	/* add to children of PCI bridge dev->bus */
-	child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
-	if (!child_bus) {
-		err("%s: could not add second bus\n", __FUNCTION__);
-		return -EIO;
-	}
-	sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
-	/* do pci_scan_child_bus */
-	pci_scan_child_bus(child_bus);
-
-	list_for_each_entry(child_dev, &child_bus->devices, bus_list) {
-		eeh_add_device_late(child_dev);
-	}
-
-	 /* fixup new pci devices without touching bus struct */
-	rpaphp_fixup_new_pci_devices(child_bus, 0);
-
-	/* Make the discovered devices available */
-	pci_bus_add_devices(child_bus);
-	return 0;
-}
-
-void rpaphp_init_new_devs(struct pci_bus *bus)
-{
-	rpaphp_fixup_new_pci_devices(bus, 0);
-	rpaphp_eeh_add_bus_device(bus);
-}
-EXPORT_SYMBOL_GPL(rpaphp_init_new_devs);
-
-/*****************************************************************************
- rpaphp_pci_config_slot() will  configure all devices under the
- given slot->dn and return the the first pci_dev.
- *****************************************************************************/
-static struct pci_dev *
-rpaphp_pci_config_slot(struct pci_bus *bus)
-{
-	struct device_node *dn = pci_bus_to_OF_node(bus);
-	struct pci_dev *dev = NULL;
-	int slotno;
-	int num;
-
-	dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);
-	if (!dn || !dn->child)
-		return NULL;
-
-	if (_machine == PLATFORM_PSERIES_LPAR) {
-		of_scan_bus(dn, bus);
-		if (list_empty(&bus->devices)) {
-			err("%s: No new device found\n", __FUNCTION__);
-			return NULL;
-		}
-
-		rpaphp_init_new_devs(bus);
-		pci_bus_add_devices(bus);
-		dev = list_entry(&bus->devices, struct pci_dev, bus_list);
-	} else {
-		slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
-
-		/* pci_scan_slot should find all children */
-		num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
-		if (num) {
-			rpaphp_fixup_new_pci_devices(bus, 1);
-			pci_bus_add_devices(bus);
-		}
-		if (list_empty(&bus->devices)) {
-			err("%s: No new device found\n", __FUNCTION__);
-			return NULL;
-		}
-		list_for_each_entry(dev, &bus->devices, bus_list) {
-			if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
-				rpaphp_pci_config_bridge(dev);
-
-			rpaphp_eeh_add_bus_device(bus);
-		}
-	}
-
-	return dev;
-}
-
 static void print_slot_pci_funcs(struct pci_bus *bus)
 {
 	struct device_node *dn;
@@ -253,19 +119,13 @@ static void print_slot_pci_funcs(struct 
 int rpaphp_config_pci_adapter(struct pci_bus *bus)
 {
 	struct device_node *dn = pci_bus_to_OF_node(bus);
-	struct pci_dev *dev;
 	int rc = -ENODEV;
 
 	dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name);
 	if (!dn)
 		goto exit;
 
-	eeh_add_device_tree_early(dn);
-	dev = rpaphp_pci_config_slot(bus);
-	if (!dev) {
-		err("%s: can't find any devices.\n", __FUNCTION__);
-		goto exit;
-	}
+	pcibios_add_pci_devices(bus);
 	print_slot_pci_funcs(bus);
 	rc = 0;
 exit:


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

* [PATCH] powerpc/PCI hotplug: minor cleanup forward decls
  2006-01-20 19:04                               ` [PATCH] powerpc/PCI hotplug: merge config_pci_adapter Greg KH
@ 2006-01-20 19:04                                 ` Greg KH
  2006-01-20 19:04                                   ` [PATCH] powerpc/PCI hotplug: remove rpaphp_find_bus() Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: minor cleanup forward decls

Minor cleanup. Move structure initializer to bottom of file,
this allows elimination of eyeball-strain-inducing forward
declarations.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 3138b8204e439aaa9ee4a6693ed1305ac36e356e
tree 23a367450c47de1dd95aebe43d71676a305be285
parent 170aa7441c7f262b09b85ab21948bd95f3d80887
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:32:58 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpaphp_core.c |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index c0e521c..6e79f56 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -56,25 +56,6 @@ MODULE_LICENSE("GPL");
 
 module_param(debug, bool, 0644);
 
-static int enable_slot(struct hotplug_slot *slot);
-static int disable_slot(struct hotplug_slot *slot);
-static int set_attention_status(struct hotplug_slot *slot, u8 value);
-static int get_power_status(struct hotplug_slot *slot, u8 * value);
-static int get_attention_status(struct hotplug_slot *slot, u8 * value);
-static int get_adapter_status(struct hotplug_slot *slot, u8 * value);
-static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
-
-struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
-	.owner = THIS_MODULE,
-	.enable_slot = enable_slot,
-	.disable_slot = disable_slot,
-	.set_attention_status = set_attention_status,
-	.get_power_status = get_power_status,
-	.get_attention_status = get_attention_status,
-	.get_adapter_status = get_adapter_status,
-	.get_max_bus_speed = get_max_bus_speed,
-};
-
 static int rpaphp_get_attention_status(struct slot *slot)
 {
 	return slot->hotplug_slot->info->attention_status;
@@ -455,6 +436,17 @@ static int disable_slot(struct hotplug_s
 	return retval;
 }
 
+struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
+	.owner = THIS_MODULE,
+	.enable_slot = enable_slot,
+	.disable_slot = disable_slot,
+	.set_attention_status = set_attention_status,
+	.get_power_status = get_power_status,
+	.get_attention_status = get_attention_status,
+	.get_adapter_status = get_adapter_status,
+	.get_max_bus_speed = get_max_bus_speed,
+};
+
 module_init(rpaphp_init);
 module_exit(rpaphp_exit);
 


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

* [PATCH] powerpc/PCI hotplug: merge config_pci_adapter
  2006-01-20 19:04                             ` [PATCH] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot() Greg KH
@ 2006-01-20 19:04                               ` Greg KH
  2006-01-20 19:04                                 ` [PATCH] powerpc/PCI hotplug: minor cleanup forward decls Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: merge config_pci_adapter

Remove general baroqueness.  The function rpaphp_config_pci_adapter()
is really just one line of code, once all the dbg printks are removed.
And its called in only one place. So replace the call by the one line.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 2a291fc8e77fad35c129ae5b11bbe13d835c01c1
tree 285acb9205261675f5dde1dbcdcccaab802903e4
parent 22a585a88bd1cdd7d3b757b1b6d57d7ce12b3e08
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:22:07 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpaphp.h     |    1 -
 drivers/pci/hotplug/rpaphp_pci.c |   35 ++++-------------------------------
 2 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 6aa91ef..89d705c 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -92,7 +92,6 @@ extern int rpaphp_enable_pci_slot(struct
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
 
-extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
 extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
 
 /* rpaphp_core.c */
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 1a12ebd..b93d9c9 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -116,24 +116,6 @@ static void print_slot_pci_funcs(struct 
 	return;
 }
 
-int rpaphp_config_pci_adapter(struct pci_bus *bus)
-{
-	struct device_node *dn = pci_bus_to_OF_node(bus);
-	int rc = -ENODEV;
-
-	dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name);
-	if (!dn)
-		goto exit;
-
-	pcibios_add_pci_devices(bus);
-	print_slot_pci_funcs(bus);
-	rc = 0;
-exit:
-	dbg("Exit %s:  rc=%d\n", __FUNCTION__, rc);
-	return rc;
-}
-EXPORT_SYMBOL_GPL(rpaphp_config_pci_adapter);
-
 static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
 {
 	eeh_remove_device(dev);
@@ -225,10 +207,7 @@ static int setup_pci_slot(struct slot *s
 		if (slot->hotplug_slot->info->adapter_status == NOT_CONFIGURED) {
 			dbg("%s CONFIGURING pci adapter in slot[%s]\n",  
 				__FUNCTION__, slot->name);
-			if (rpaphp_config_pci_adapter(slot->bus)) {
-				err("%s: CONFIG pci adapter failed\n", __FUNCTION__);
-				goto exit_rc;		
-			}
+			pcibios_add_pci_devices(slot->bus);
 
 		} else if (slot->hotplug_slot->info->adapter_status != CONFIGURED) {
 			err("%s: slot[%s]'s adapter_status is NOT_VALID.\n",
@@ -274,16 +253,10 @@ int rpaphp_enable_pci_slot(struct slot *
 	/* if slot is not empty, enable the adapter */
 	if (state == PRESENT) {
 		dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name);
-		retval = rpaphp_config_pci_adapter(slot->bus);
-		if (!retval) {
-			slot->state = CONFIGURED;
-			info("%s: devices in slot[%s] configured\n",
+		pcibios_add_pci_devices(slot->bus);
+		slot->state = CONFIGURED;
+		info("%s: devices in slot[%s] configured\n",
 					__FUNCTION__, slot->name);
-		} else {
-			slot->state = NOT_CONFIGURED;
-			dbg("%s: no pci_dev struct for adapter in slot[%s]\n",
-			    __FUNCTION__, slot->name);
-		}
 	} else if (state == EMPTY) {
 		dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name);
 		slot->state = EMPTY;


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

* [PATCH] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot()
  2006-01-20 19:04                           ` [PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices() Greg KH
@ 2006-01-20 19:04                             ` Greg KH
  2006-01-20 19:04                               ` [PATCH] powerpc/PCI hotplug: merge config_pci_adapter Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot()

Remove general baroqueness.  The function rpaphp_enable_pci_slot()
has a fairly simple logic structure, once all of the debug printk's
are removed. Its called from only one place, and that place also
has a very simple structure once he printk's are removed.  Merge
the two together.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 259d8eac4d548e0e0fdbe25227e2ead29e73feb9
tree 93956dbd55f6b9fb8fff48ce36f069bd9c192e92
parent 6ed2ae1c1dcf0f55af12a172914b770d75d22509
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:28:22 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpaphp.h      |    1 +
 drivers/pci/hotplug/rpaphp_core.c |   38 +++++++++++++++++++++++++++----------
 drivers/pci/hotplug/rpaphp_pci.c  |   30 +----------------------------
 3 files changed, 30 insertions(+), 39 deletions(-)

diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 6e4f93b..095c9aa 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -91,6 +91,7 @@ extern int num_slots;
 extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
+extern int rpaphp_get_sensor_state(struct slot *slot, int *state);
 
 /* rpaphp_core.c */
 extern int rpaphp_add_slot(struct device_node *dn);
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index acf1764..341fdd5 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -393,22 +393,40 @@ static void __exit rpaphp_exit(void)
 	cleanup_slots();
 }
 
-static int enable_slot(struct hotplug_slot *hotplug_slot)
+static int __enable_slot(struct slot *slot)
 {
-	int retval = 0;
-	struct slot *slot = (struct slot *)hotplug_slot->private;
+	int state;
+	int retval;
+
+	if (slot->state == CONFIGURED)
+		return 0;
 
-	if (slot->state == CONFIGURED) {
-		dbg("%s: %s is already enabled\n", __FUNCTION__, slot->name);
-		goto exit;
+	retval = rpaphp_get_sensor_state(slot, &state);
+	if (retval)
+		return retval;
+
+	if (state == PRESENT) {
+		pcibios_add_pci_devices(slot->bus);
+		slot->state = CONFIGURED;
+	} else if (state == EMPTY) {
+		slot->state = EMPTY;
+	} else {
+		err("%s: slot[%s] is in invalid state\n", __FUNCTION__, slot->name);
+		slot->state = NOT_VALID;
+		return -EINVAL;
 	}
+	return 0;
+}
+
+static int enable_slot(struct hotplug_slot *hotplug_slot)
+{
+	int retval;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
-	dbg("ENABLING SLOT %s\n", slot->name);
 	down(&rpaphp_sem);
-	retval = rpaphp_enable_pci_slot(slot);
+	retval = __enable_slot(slot);
 	up(&rpaphp_sem);
-exit:
-	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
+
 	return retval;
 }
 
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index ce7ebec..d1297d0 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -32,7 +32,7 @@
 #include "../pci.h"		/* for pci_add_new_bus */
 #include "rpaphp.h"
 
-static int rpaphp_get_sensor_state(struct slot *slot, int *state)
+int rpaphp_get_sensor_state(struct slot *slot, int *state)
 {
 	int rc;
 	int setlevel;
@@ -212,31 +212,3 @@ exit_rc:
 	return rc;
 }
 
-int rpaphp_enable_pci_slot(struct slot *slot)
-{
-	int retval = 0, state;
-
-	retval = rpaphp_get_sensor_state(slot, &state);
-	if (retval)
-		goto exit;
-	dbg("%s: sensor state[%d]\n", __FUNCTION__, state);
-	/* if slot is not empty, enable the adapter */
-	if (state == PRESENT) {
-		dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name);
-		pcibios_add_pci_devices(slot->bus);
-		slot->state = CONFIGURED;
-		info("%s: devices in slot[%s] configured\n",
-					__FUNCTION__, slot->name);
-	} else if (state == EMPTY) {
-		dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name);
-		slot->state = EMPTY;
-	} else {
-		err("%s: slot[%s] is in invalid state\n", __FUNCTION__,
-		    slot->name);
-		slot->state = NOT_VALID;
-		retval = -EINVAL;
-	}
-exit:
-	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
-	return retval;
-}


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

* [PATCH] PCI Hotplug: fix up Kconfig help text
  2006-01-20 19:04                     ` [PATCH] PCI Hotplug/powerpc: module build break Greg KH
@ 2006-01-20 19:04                       ` Greg KH
  2006-01-20 19:04                         ` [PATCH] powerpc/PCI hotplug: cleanup: add prefix Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: pavel

[PATCH] PCI Hotplug: fix up Kconfig help text

Remove reference to pcihpfs that no longer exists.

Signed-off-by: Pavel Machek <pavel@suse.cz>

---
commit d181278c96e0b59478bef909ec2476c40169e7ba
tree 0973a8ecbeffd44fb57343d771dbe493036a16e7
parent 4153374c18ee71fa8bdaa6a7e88ec42f8ec633f4
author Pavel Machek <pavel@ucw.cz> Mon, 09 Jan 2006 16:16:00 +0100
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:34 -0800

 drivers/pci/hotplug/Kconfig |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 2f1289e..222a1cc 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -11,8 +11,7 @@ config HOTPLUG_PCI
 	---help---
 	  Say Y here if you have a motherboard with a PCI Hotplug controller.
 	  This allows you to add and remove PCI cards while the machine is
-	  powered up and running.  The file system pcihpfs must be mounted
-	  in order to interact with any PCI Hotplug controllers.
+	  powered up and running.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called pci_hotplug.


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

* [PATCH] powerpc/PCI hotplug: cleanup: add prefix
  2006-01-20 19:04                       ` [PATCH] PCI Hotplug: fix up Kconfig help text Greg KH
@ 2006-01-20 19:04                         ` Greg KH
  2006-01-20 19:04                           ` [PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices() Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: cleanup: add prefix

Minor cleanup. Add the prefix rpaphp_* to several generic-sounding routines.
Remove rpaphp_remove_slot(), which is a one-liner.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 170aa7441c7f262b09b85ab21948bd95f3d80887
tree a66122a1f1da2f7dfb940eddc6815aea42029e2a
parent 259d8eac4d548e0e0fdbe25227e2ead29e73feb9
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:31:01 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpadlpar_core.c |    4 ++--
 drivers/pci/hotplug/rpaphp.h        |    6 +++---
 drivers/pci/hotplug/rpaphp_core.c   |   14 +++++---------
 drivers/pci/hotplug/rpaphp_pci.c    |    4 ++--
 drivers/pci/hotplug/rpaphp_slot.c   |   16 ++++++++--------
 5 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 15e853e..d3aa9df 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -227,7 +227,7 @@ static int dlpar_remove_phb(char *drc_na
 	slot = find_slot(dn);
 	if (slot) {
 		/* Remove hotplug slot */
-		if (rpaphp_remove_slot(slot)) {
+		if (rpaphp_deregister_slot(slot)) {
 			printk(KERN_ERR
 				"%s: unable to remove hotplug slot %s\n",
 				__FUNCTION__, drc_name);
@@ -373,7 +373,7 @@ int dlpar_remove_pci_slot(char *drc_name
 	slot = find_slot(dn);
 	if (slot) {
 		/* Remove hotplug slot */
-		if (rpaphp_remove_slot(slot)) {
+		if (rpaphp_deregister_slot(slot)) {
 			printk(KERN_ERR
 				"%s: unable to remove hotplug slot %s\n",
 				__FUNCTION__, drc_name);
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 095c9aa..310b618 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -89,7 +89,7 @@ extern int num_slots;
 
 /* rpaphp_pci.c */
 extern int rpaphp_enable_pci_slot(struct slot *slot);
-extern int register_pci_slot(struct slot *slot);
+extern int rpaphp_register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
 extern int rpaphp_get_sensor_state(struct slot *slot, int *state);
 
@@ -102,8 +102,8 @@ extern int rpaphp_get_drc_props(struct d
 /* rpaphp_slot.c */
 extern void dealloc_slot_struct(struct slot *slot);
 extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
-extern int register_slot(struct slot *slot);
-extern int deregister_slot(struct slot *slot);
+extern int rpaphp_register_slot(struct slot *slot);
+extern int rpaphp_deregister_slot(struct slot *slot);
 extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
 extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
 	
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 341fdd5..c0e521c 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -196,11 +196,6 @@ static int get_max_bus_speed(struct hotp
 	return 0;
 }
 
-int rpaphp_remove_slot(struct slot *slot)
-{
-	return deregister_slot(slot);
-}
-
 static int get_children_props(struct device_node *dn, int **drc_indexes,
 		int **drc_names, int **drc_types, int **drc_power_domains)
 {
@@ -307,13 +302,15 @@ static int is_php_dn(struct device_node 
 	return 0;
 }
 
-/****************************************************************
+/**
+ * rpaphp_add_slot -- add hotplug or dlpar slot
+ *
  *	rpaphp not only registers PCI hotplug slots(HOTPLUG), 
  *	but also logical DR slots(EMBEDDED).
  *	HOTPLUG slot: An adapter can be physically added/removed. 
  *	EMBEDDED slot: An adapter can be logically removed/added
  *		  from/to a partition with the slot.
- ***************************************************************/
+ */
 int rpaphp_add_slot(struct device_node *dn)
 {
 	struct slot *slot;
@@ -344,7 +341,7 @@ int rpaphp_add_slot(struct device_node *
 			dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
 					indexes[i + 1], name, type);
 
-			retval = register_pci_slot(slot);
+			retval = rpaphp_register_pci_slot(slot);
 		}
 	}
 exit:
@@ -462,6 +459,5 @@ module_init(rpaphp_init);
 module_exit(rpaphp_exit);
 
 EXPORT_SYMBOL_GPL(rpaphp_add_slot);
-EXPORT_SYMBOL_GPL(rpaphp_remove_slot);
 EXPORT_SYMBOL_GPL(rpaphp_slot_head);
 EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index d1297d0..6f6cbed 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -199,7 +199,7 @@ exit_rc:
 	return -EINVAL;
 }
 
-int register_pci_slot(struct slot *slot)
+int rpaphp_register_pci_slot(struct slot *slot)
 {
 	int rc = -EINVAL;
 
@@ -207,7 +207,7 @@ int register_pci_slot(struct slot *slot)
 		goto exit_rc;
 	if (setup_pci_slot(slot))
 		goto exit_rc;
-	rc = register_slot(slot);
+	rc = rpaphp_register_slot(slot);
 exit_rc:
 	return rc;
 }
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index daa89ae..04cc1e7 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -35,16 +35,16 @@
 
 static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf)
 {
-        char *value;
-        int retval = -ENOENT;
+	char *value;
+	int retval = -ENOENT;
 	struct slot *slot = (struct slot *)php_slot->private;
 
 	if (!slot)
 		return retval;
 
-        value = slot->location;
-        retval = sprintf (buf, "%s\n", value);
-        return retval;
+	value = slot->location;
+	retval = sprintf (buf, "%s\n", value);
+	return retval;
 }
 
 static struct hotplug_slot_attribute hotplug_slot_attr_location = {
@@ -137,7 +137,7 @@ static int is_registered(struct slot *sl
 	return 0;
 }
 
-int deregister_slot(struct slot *slot)
+int rpaphp_deregister_slot(struct slot *slot)
 {
 	int retval = 0;
 	struct hotplug_slot *php_slot = slot->hotplug_slot;
@@ -160,7 +160,7 @@ int deregister_slot(struct slot *slot)
 	return retval;
 }
 
-int register_slot(struct slot *slot)
+int rpaphp_register_slot(struct slot *slot)
 {
 	int retval;
 
@@ -169,7 +169,7 @@ int register_slot(struct slot *slot)
 		slot->power_domain, slot->type);
 	/* should not try to register the same slot twice */
 	if (is_registered(slot)) { /* should't be here */
-		err("register_slot: slot[%s] is already registered\n", slot->name);
+		err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
 		rpaphp_release_slot(slot->hotplug_slot);
 		return -EAGAIN;
 	}	


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

* [PATCH] powerpc/PCI hotplug: shuffle error checking to better location.
  2006-01-20 19:04                                       ` [PATCH] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap Greg KH
@ 2006-01-20 19:04                                         ` Greg KH
  2006-01-20 19:04                                           ` [PATCH] PCI: cyblafb: remove pci_module_init() return, really Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: shuffle error checking to better location.

Error checking is scattered through various layers of the dlpar code,
leading to a somewhat opaque code structure. This patch consolidates
error checking in one routine, simplifying the code a tad. There's
also some whitespace cleanup here too.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 2f8d04252f3ae653d142229c2f28ff88afb46ed8
tree da6abf3cc396887e3ccd3f13d2c938388ff66e52
parent 3138b8204e439aaa9ee4a6693ed1305ac36e356e
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:35:23 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:36 -0800

 drivers/pci/hotplug/rpadlpar_core.c |   44 ++++++++++++++++++-----------------
 1 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index d3aa9df..3eefe2c 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -103,13 +103,13 @@ static struct slot *find_slot(struct dev
 	struct list_head *tmp, *n;
 	struct slot *slot;
 
-        list_for_each_safe(tmp, n, &rpaphp_slot_head) {
-                slot = list_entry(tmp, struct slot, rpaphp_slot_list);
-                if (slot->dn == dn)
-                        return slot;
-        }
+	list_for_each_safe(tmp, n, &rpaphp_slot_head) {
+		slot = list_entry(tmp, struct slot, rpaphp_slot_list);
+		if (slot->dn == dn)
+			return slot;
+	}
 
-        return NULL;
+	return NULL;
 }
 
 static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent,
@@ -126,9 +126,9 @@ static struct pci_dev *dlpar_find_new_de
 	return NULL;
 }
 
-static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
+static void dlpar_pci_add_bus(struct device_node *dn)
 {
-	struct pci_dn *pdn = dn->data;
+	struct pci_dn *pdn = PCI_DN(dn);
 	struct pci_controller *phb = pdn->phb;
 	struct pci_dev *dev = NULL;
 
@@ -139,7 +139,7 @@ static struct pci_dev *dlpar_pci_add_bus
 	if (!dev) {
 		printk(KERN_ERR "%s: failed to create pci dev for %s\n",
 				__FUNCTION__, dn->full_name);
-		return NULL;
+		return;
 	}
 
 	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
@@ -156,35 +156,35 @@ static struct pci_dev *dlpar_pci_add_bus
 
 	/* Add new devices to global lists.  Register in proc, sysfs. */
 	pci_bus_add_devices(phb->bus);
-
-	/* Confirm new bridge dev was created */
-	dev = dlpar_find_new_dev(phb->bus, dn);
-	if (dev) {
-		if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
-			printk(KERN_ERR "%s: unexpected header type %d\n",
-				__FUNCTION__, dev->hdr_type);
-			return NULL;
-		}
-	}
-
-	return dev;
 }
 
 static int dlpar_add_pci_slot(char *drc_name, struct device_node *dn)
 {
 	struct pci_dev *dev;
+	struct pci_controller *phb;
 
 	if (pcibios_find_pci_bus(dn))
 		return -EINVAL;
 
 	/* Add pci bus */
-	dev = dlpar_pci_add_bus(dn);
+	dlpar_pci_add_bus(dn);
+
+	/* Confirm new bridge dev was created */
+	phb = PCI_DN(dn)->phb;
+	dev = dlpar_find_new_dev(phb->bus, dn);
+
 	if (!dev) {
 		printk(KERN_ERR "%s: unable to add bus %s\n", __FUNCTION__,
 			drc_name);
 		return -EIO;
 	}
 
+	if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
+		printk(KERN_ERR "%s: unexpected header type %d, unable to add bus %s\n",
+			__FUNCTION__, dev->hdr_type, drc_name);
+		return -EIO;
+	}
+
 	/* Add hotplug slot */
 	if (rpaphp_add_slot(dn)) {
 		printk(KERN_ERR "%s: unable to add hotplug slot %s\n",


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

* [PATCH] powerpc/PCI hotplug: remove remove_bus_device()
  2006-01-20 19:04                                   ` [PATCH] powerpc/PCI hotplug: remove rpaphp_find_bus() Greg KH
@ 2006-01-20 19:04                                     ` Greg KH
  2006-01-20 19:04                                       ` [PATCH] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: remove remove_bus_device()

The function rpaphp_eeh_remove_bus_device() is a dupe of
eeh_remove_bus_device(). Remove it.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 5091bcbccd26ae37caea6330a1f267427422f18f
tree fd401066a0ad4976668d7b507e485c870e9e2cac
parent 2a291fc8e77fad35c129ae5b11bbe13d835c01c1
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:24:27 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpaphp_pci.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index b93d9c9..1f5e73b 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -116,30 +116,12 @@ static void print_slot_pci_funcs(struct 
 	return;
 }
 
-static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
-{
-	eeh_remove_device(dev);
-	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
-		struct pci_bus *bus = dev->subordinate;
-		struct list_head *ln;
-		if (!bus)
-			return; 
-		for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
-			struct pci_dev *pdev = pci_dev_b(ln);
-			if (pdev)
-				rpaphp_eeh_remove_bus_device(pdev);
-		}
-
-	}
-	return;
-}
-
 int rpaphp_unconfig_pci_adapter(struct pci_bus *bus)
 {
 	struct pci_dev *dev, *tmp;
 
 	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
-		rpaphp_eeh_remove_bus_device(dev);
+		eeh_remove_bus_device(dev);
 		pci_remove_bus_device(dev);
 	}
 	return 0;


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

* [PATCH] PCI: cyblafb: remove pci_module_init() return, really.
  2006-01-20 19:04                                         ` [PATCH] powerpc/PCI hotplug: shuffle error checking to better location Greg KH
@ 2006-01-20 19:04                                           ` Greg KH
  0 siblings, 0 replies; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: apgo

[PATCH] PCI: cyblafb: remove pci_module_init() return, really.

Richard Knutsson <ricknu-0@student.ltu.se> did the original pci_module_init()
cleanups:

    http://marc.theaimsgroup.com/?l=linux-kernel&m=113330872125068&w=2
    http://marc.theaimsgroup.com/?l=linux-kernel&m=113330888507321&w=2

Greg, on it's way upstream, pci_module_init() return sneaked back in for
cyblafb?

    http://marc.theaimsgroup.com/?l=linux-pci&m=113652969209562&w=2
    http://marc.theaimsgroup.com/?l=linux-pci&m=113683930220421&w=2

Remove for good.

Signed-off-by: Arthur Othieno <apgo@patchbomb.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit f4be67dc68bec2cddfe147642a7411b5e1dd9af1
tree 39ef2de1a00a98cf1fd58c2990e23745a3b5162c
parent 2f8d04252f3ae653d142229c2f28ff88afb46ed8
author Arthur Othieno <apgo@patchbomb.org> Wed, 18 Jan 2006 21:12:57 -0500
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:36 -0800

 drivers/video/cyblafb.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c
index 2b97246..0ae0a97 100644
--- a/drivers/video/cyblafb.c
+++ b/drivers/video/cyblafb.c
@@ -1665,7 +1665,6 @@ static int __devinit cyblafb_init(void)
 		}
 #endif
 	output("CyblaFB version %s initializing\n", VERSION);
-	return pci_module_init(&cyblafb_pci_driver);
 	return pci_register_driver(&cyblafb_pci_driver);
 }
 


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

* [PATCH] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap
  2006-01-20 19:04                                     ` [PATCH] powerpc/PCI hotplug: remove remove_bus_device() Greg KH
@ 2006-01-20 19:04                                       ` Greg KH
  2006-01-20 19:04                                         ` [PATCH] powerpc/PCI hotplug: shuffle error checking to better location Greg KH
  0 siblings, 1 reply; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linas

[PATCH] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap

Remove general baroqueness.  The function rpaphp_unconfig_pci_adapter()
is really just three lines of code, once all the dbg printks are removed.
And its called in only one place. So replace the call by the thre lines.
Also, provide proper semaphore locking in the affected function
disable_slot()

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 6ed2ae1c1dcf0f55af12a172914b770d75d22509
tree a95f09f9c6deed21e74880ae8c831f03e64b6b12
parent 5091bcbccd26ae37caea6330a1f267427422f18f
author linas@austin.ibm.com <linas@austin.ibm.com> Thu, 12 Jan 2006 18:26:27 -0600
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 20 Jan 2006 10:29:35 -0800

 drivers/pci/hotplug/rpadlpar_core.c |    6 +++++-
 drivers/pci/hotplug/rpaphp.h        |    2 --
 drivers/pci/hotplug/rpaphp_core.c   |   32 ++++++++++++++++++--------------
 drivers/pci/hotplug/rpaphp_pci.c    |   12 ------------
 4 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 6c14810..15e853e 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -380,7 +380,11 @@ int dlpar_remove_pci_slot(char *drc_name
 			return -EIO;
 		}
 	} else {
-		rpaphp_unconfig_pci_adapter(bus);
+		struct pci_dev *dev, *tmp;
+		list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
+			eeh_remove_bus_device(dev);
+			pci_remove_bus_device(dev);
+		}
 	}
 
 	if (unmap_bus_range(bus)) {
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 89d705c..6e4f93b 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -92,8 +92,6 @@ extern int rpaphp_enable_pci_slot(struct
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
 
-extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
-
 /* rpaphp_core.c */
 extern int rpaphp_add_slot(struct device_node *dn);
 extern int rpaphp_remove_slot(struct slot *slot);
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index cf075c3..acf1764 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -412,27 +412,31 @@ exit:
 	return retval;
 }
 
-static int disable_slot(struct hotplug_slot *hotplug_slot)
+static int __disable_slot(struct slot *slot)
 {
-	int retval = -EINVAL;
-	struct slot *slot = (struct slot *)hotplug_slot->private;
+	struct pci_dev *dev, *tmp;
 
-	dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name);
+	if (slot->state == NOT_CONFIGURED)
+		return -EINVAL;
 
-	if (slot->state == NOT_CONFIGURED) {
-		dbg("%s: %s is already disabled\n", __FUNCTION__, slot->name);
-		goto exit;
+	list_for_each_entry_safe(dev, tmp, &slot->bus->devices, bus_list) {
+		eeh_remove_bus_device(dev);
+		pci_remove_bus_device(dev);
 	}
 
-	dbg("DISABLING SLOT %s\n", slot->name);
+	slot->state = NOT_CONFIGURED;
+	return 0;
+}
+
+static int disable_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = (struct slot *)hotplug_slot->private;
+	int retval;
+
 	down(&rpaphp_sem);
-	retval = rpaphp_unconfig_pci_adapter(slot->bus);
+	retval = __disable_slot (slot);
 	up(&rpaphp_sem);
-	slot->state = NOT_CONFIGURED;
-	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
-	     slot->name);
-exit:
-	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
+
 	return retval;
 }
 
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 1f5e73b..ce7ebec 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -116,18 +116,6 @@ static void print_slot_pci_funcs(struct 
 	return;
 }
 
-int rpaphp_unconfig_pci_adapter(struct pci_bus *bus)
-{
-	struct pci_dev *dev, *tmp;
-
-	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
-		eeh_remove_bus_device(dev);
-		pci_remove_bus_device(dev);
-	}
-	return 0;
-}
-EXPORT_SYMBOL_GPL(rpaphp_unconfig_pci_adapter);
-
 static int setup_pci_hotplug_slot_info(struct slot *slot)
 {
 	struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info;


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

* Re: [GIT PATCH] PCI patches for 2.6.16-rc1
  2006-01-20 19:04 [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH
  2006-01-20 19:04 ` [PATCH] PCI: irq and pci_ids: patch for Intel ICH8 Greg KH
@ 2006-01-20 19:23 ` Greg KH
  1 sibling, 0 replies; 24+ messages in thread
From: Greg KH @ 2006-01-20 19:23 UTC (permalink / raw)
  To: Greg KH; +Cc: Linus Torvalds, Andrew Morton, linux-kernel, linux-pci

On Fri, Jan 20, 2006 at 11:04:00AM -0800, Greg KH wrote:
> Here are some small PCI patches against your latest git tree.  They have
> all been in the -mm tree for a while with no problems.
> 
> They do the following:
> 	- document some feature-removal things for the future
> 	- add support for amd pci hotplug devices to the shpchp driver.
> 	- fix bugs and update the ppc64 rpaphp pci hotplug driver.
> 	- add some new and remove some duplicate pci ids.
> 	- make it more obvious that some msi functions are really being
> 	  used.
> 
> Please pull from:
> 	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/
> or if master.kernel.org hasn't synced up yet:
> 	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/
> 
> The full patches will be sent to the linux-pci mailing list, if anyone
> wants to see them.

Oops, also sent them to the linux-kernel mailing list too, sorry about
that.

/me hits his patchbomb script with a big stick...

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

end of thread, other threads:[~2006-01-20 19:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20 19:04 [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH
2006-01-20 19:04 ` [PATCH] PCI: irq and pci_ids: patch for Intel ICH8 Greg KH
2006-01-20 19:04   ` [PATCH] PCI: schedule PCI_LEGACY_PROC for removal Greg KH
2006-01-20 19:04     ` [PATCH] pci: Schedule removal of pci_module_init Greg KH
2006-01-20 19:04       ` [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability() Greg KH
2006-01-20 19:04         ` [PATCH] PCI Hotplug: PCI panic on dlpar add (add pci slot to running partition) Greg KH
2006-01-20 19:04           ` [PATCH] PCI Hotplug: fix up coding style issues Greg KH
2006-01-20 19:04             ` [PATCH] PCI: pci_ids: remove duplicates gathered during merge period Greg KH
2006-01-20 19:04               ` [PATCH] PCI: make it easier to see that set_msi_affinity() is used Greg KH
2006-01-20 19:04                 ` [PATCH] PCI Hotplug: shpchp: AMD POGO errata fix Greg KH
2006-01-20 19:04                   ` [PATCH] PCI: restore 2 missing pci ids Greg KH
2006-01-20 19:04                     ` [PATCH] PCI Hotplug/powerpc: module build break Greg KH
2006-01-20 19:04                       ` [PATCH] PCI Hotplug: fix up Kconfig help text Greg KH
2006-01-20 19:04                         ` [PATCH] powerpc/PCI hotplug: cleanup: add prefix Greg KH
2006-01-20 19:04                           ` [PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices() Greg KH
2006-01-20 19:04                             ` [PATCH] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot() Greg KH
2006-01-20 19:04                               ` [PATCH] powerpc/PCI hotplug: merge config_pci_adapter Greg KH
2006-01-20 19:04                                 ` [PATCH] powerpc/PCI hotplug: minor cleanup forward decls Greg KH
2006-01-20 19:04                                   ` [PATCH] powerpc/PCI hotplug: remove rpaphp_find_bus() Greg KH
2006-01-20 19:04                                     ` [PATCH] powerpc/PCI hotplug: remove remove_bus_device() Greg KH
2006-01-20 19:04                                       ` [PATCH] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap Greg KH
2006-01-20 19:04                                         ` [PATCH] powerpc/PCI hotplug: shuffle error checking to better location Greg KH
2006-01-20 19:04                                           ` [PATCH] PCI: cyblafb: remove pci_module_init() return, really Greg KH
2006-01-20 19:23 ` [GIT PATCH] PCI patches for 2.6.16-rc1 Greg KH

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).