2006-03-01 00:19:50

by Mark Fasheh

[permalink] [raw]
Subject: [PATCH] powerpc: restore eeh_add_device_late() prototype

A search on the linux-kernel, linuxppc-dev mailing lists and the git tree at
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc didn't show
this issue fixed or reported. If I missed something please ignore :)

I get a compile failure trying to build a powerpc kernel:

arch/powerpc/platforms/pseries/eeh.c: In function `eeh_add_device_tree_late':
arch/powerpc/platforms/pseries/eeh.c:901: warning: implicit declaration of function `eeh_add_device_late'
arch/powerpc/platforms/pseries/eeh.c: At top level:
arch/powerpc/platforms/pseries/eeh.c:918: error: conflicting types for 'eeh_add_device_late'
arch/powerpc/platforms/pseries/eeh.c:901: error: previous implicit declaration of 'eeh_add_device_late' was here
make[2]: *** [arch/powerpc/platforms/pseries/eeh.o] Error 1

It seems commit 827c1a6c1a5dcb2902fecfb648f9af6a532934eb removed this
prototype from eeh.h. The following patch restores it.
--Mark

diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 7dfb408..4250fa1 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -62,6 +62,7 @@ void __init pci_addr_cache_build(void);
*/
void eeh_add_device_early(struct device_node *);
void eeh_add_device_tree_early(struct device_node *);
+void eeh_add_device_late(struct pci_dev *);
void eeh_add_device_tree_late(struct pci_bus *);

/**
@@ -117,6 +118,8 @@ static inline void pci_addr_cache_build(

static inline void eeh_add_device_early(struct device_node *dn) { }

+static inline void eeh_add_device_late(struct pci_dev *dev) { }
+
static inline void eeh_remove_device(struct pci_dev *dev) { }

static inline void eeh_add_device_tree_early(struct device_node *dn) { }


2006-03-01 01:03:01

by Mark Fasheh

[permalink] [raw]
Subject: Re: [PATCH] powerpc: restore eeh_add_device_late() prototype

Sigh, I forgot to actually CC [email protected], and I also left off
my signed-off-by line (added below). Sorry about that.

On Tue, Feb 28, 2006 at 04:19:09PM -0800, Mark Fasheh wrote:
A search on the linux-kernel, linuxppc-dev mailing lists and the git tree at
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc didn't show
this issue fixed or reported. If I missed something please ignore :)

I get a compile failure trying to build a powerpc kernel:

arch/powerpc/platforms/pseries/eeh.c: In function `eeh_add_device_tree_late':
arch/powerpc/platforms/pseries/eeh.c:901: warning: implicit declaration of function `eeh_add_device_late'
arch/powerpc/platforms/pseries/eeh.c: At top level:
arch/powerpc/platforms/pseries/eeh.c:918: error: conflicting types for 'eeh_add_device_late'
arch/powerpc/platforms/pseries/eeh.c:901: error: previous implicit declaration of 'eeh_add_device_late' was here
make[2]: *** [arch/powerpc/platforms/pseries/eeh.o] Error 1

It seems commit 827c1a6c1a5dcb2902fecfb648f9af6a532934eb removed this
prototype from eeh.h. The following patch restores it.

Signed-off-by: Mark Fasheh <[email protected]>

diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 7dfb408..4250fa1 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -62,6 +62,7 @@ void __init pci_addr_cache_build(void);
*/
void eeh_add_device_early(struct device_node *);
void eeh_add_device_tree_early(struct device_node *);
+void eeh_add_device_late(struct pci_dev *);
void eeh_add_device_tree_late(struct pci_bus *);

/**
@@ -117,6 +118,8 @@ static inline void pci_addr_cache_build(

static inline void eeh_add_device_early(struct device_node *dn) { }

+static inline void eeh_add_device_late(struct pci_dev *dev) { }
+
static inline void eeh_remove_device(struct pci_dev *dev) { }

static inline void eeh_add_device_tree_early(struct device_node *dn) { }

2006-03-01 16:38:53

by John Rose

[permalink] [raw]
Subject: [PATCH] move eeh_add_device_tree_late()

Good catch, Mark.

Commit 827c1a6c1a5dcb2902fecfb648f9af6a532934eb introduced a new
function that calls eeh_add_device_late() implicitly. This patch
reorders the two functions in question to fix the compile error. This
might be preferable to exposing eeh_add_device_late() in eeh.h.

Apologies Paul/everyone, please don't kill me.

Thanks-
John

Signed-off-by: John Rose <[email protected]>

diff -puN arch/powerpc/platforms/pseries/eeh.c~fix_eeh_bb arch/powerpc/platforms/pseries/eeh.c
--- 2_6_linus_3/arch/powerpc/platforms/pseries/eeh.c~fix_eeh_bb 2006-03-01 10:30:52.000000000 -0600
+++ 2_6_linus_3-johnrose/arch/powerpc/platforms/pseries/eeh.c 2006-03-01 10:31:28.000000000 -0600
@@ -893,20 +893,6 @@ void eeh_add_device_tree_early(struct de
}
EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);

-void eeh_add_device_tree_late(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)
- eeh_add_device_tree_late(subbus);
- }
- }
-}
-
/**
* eeh_add_device_late - perform EEH initialization for the indicated pci device
* @dev: pci device for which to set up EEH
@@ -935,6 +921,20 @@ void eeh_add_device_late(struct pci_dev
}
EXPORT_SYMBOL_GPL(eeh_add_device_late);

+void eeh_add_device_tree_late(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)
+ eeh_add_device_tree_late(subbus);
+ }
+ }
+}
+
/**
* eeh_remove_device - undo EEH setup for the indicated pci device
* @dev: pci device to be removed

_

2006-03-01 18:00:07

by Mark Fasheh

[permalink] [raw]
Subject: Re: [PATCH] move eeh_add_device_tree_late()

On Wed, Mar 01, 2006 at 10:35:55AM -0600, John Rose wrote:
> Good catch, Mark.
Heh, thanks.

> Commit 827c1a6c1a5dcb2902fecfb648f9af6a532934eb introduced a new
> function that calls eeh_add_device_late() implicitly. This patch
> reorders the two functions in question to fix the compile error. This
> might be preferable to exposing eeh_add_device_late() in eeh.h.
Hmm, you still left the EXPORT_SYMBOL(eeh_add_device_late) and you didn't
make eeh_add_device_late() static. Shouldn't you do that if you don't want
to make it accessible outside of eeh.c?
--Mark

--
Mark Fasheh
Senior Software Developer, Oracle
[email protected]

2006-03-01 19:00:26

by John Rose

[permalink] [raw]
Subject: [PATCH] move eeh_add_device_tree_late()

> Hmm, you still left the EXPORT_SYMBOL(eeh_add_device_late) and you didn't
> make eeh_add_device_late() static. Shouldn't you do that if you don't want
> to make it accessible outside of eeh.c?
> --Mark

Again, good points. Ever have one of those days? Take 2.

Commit 827c1a6c1a5dcb2902fecfb648f9af6a532934eb introduced a new
function that calls eeh_add_device_late() implicitly. This patch
reorders the two functions in question to fix the compile error. This
might be preferable to exposing eeh_add_device_late() in eeh.h.

Thanks-
John

Signed-off-by: John Rose <[email protected]>

diff -puN arch/powerpc/platforms/pseries/eeh.c~fix_eeh_bb arch/powerpc/platforms/pseries/eeh.c
--- 2_6_linus_3/arch/powerpc/platforms/pseries/eeh.c~fix_eeh_bb 2006-03-01 10:30:52.000000000 -0600
+++ 2_6_linus_3-johnrose/arch/powerpc/platforms/pseries/eeh.c 2006-03-01 12:54:03.000000000 -0600
@@ -893,20 +893,6 @@ void eeh_add_device_tree_early(struct de
}
EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);

-void eeh_add_device_tree_late(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)
- eeh_add_device_tree_late(subbus);
- }
- }
-}
-
/**
* eeh_add_device_late - perform EEH initialization for the indicated pci device
* @dev: pci device for which to set up EEH
@@ -914,7 +900,7 @@ void eeh_add_device_tree_late(struct pci
* This routine must be used to complete EEH initialization for PCI
* devices that were added after system boot (e.g. hotplug, dlpar).
*/
-void eeh_add_device_late(struct pci_dev *dev)
+static void eeh_add_device_late(struct pci_dev *dev)
{
struct device_node *dn;
struct pci_dn *pdn;
@@ -933,7 +919,20 @@ void eeh_add_device_late(struct pci_dev

pci_addr_cache_insert_device (dev);
}
-EXPORT_SYMBOL_GPL(eeh_add_device_late);
+
+void eeh_add_device_tree_late(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)
+ eeh_add_device_tree_late(subbus);
+ }
+ }
+}

/**
* eeh_remove_device - undo EEH setup for the indicated pci device

_