* [PATCH] powerpc/pci: Move pseries code into pseries platform specific area
@ 2009-04-30 14:14 Kumar Gala
2009-04-30 14:49 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2009-04-30 14:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras
There doesn't appear to be any specific reason that we need to setup the
pseries specific notifier in generic arch pci code. Move it into pseries
land.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/kernel/pci_dn.c | 28 +---------------------------
arch/powerpc/platforms/pseries/setup.c | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 1c67de5..d5e36e5 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -27,7 +27,6 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/pci-bridge.h>
-#include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>
@@ -35,7 +34,7 @@
* Traverse_func that inits the PCI fields of the device node.
* NOTE: this *must* be done before read/write config to the device.
*/
-static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
+void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
const int *type =
@@ -184,29 +183,6 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
}
EXPORT_SYMBOL(fetch_dev_dn);
-static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
-{
- struct device_node *np = node;
- struct pci_dn *pci = NULL;
- int err = NOTIFY_OK;
-
- switch (action) {
- case PSERIES_RECONFIG_ADD:
- pci = np->parent->data;
- if (pci)
- update_dn_pci_info(np, pci->phb);
- break;
- default:
- err = NOTIFY_DONE;
- break;
- }
- return err;
-}
-
-static struct notifier_block pci_dn_reconfig_nb = {
- .notifier_call = pci_dn_reconfig_notifier,
-};
-
/**
* pci_devs_phb_init - Initialize phbs and pci devs under them.
*
@@ -223,6 +199,4 @@ void __init pci_devs_phb_init(void)
/* This must be done first so the device nodes have valid pci info! */
list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
pci_devs_phb_init_dynamic(phb);
-
- pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ec34170..096ea1b 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -63,6 +63,7 @@
#include <asm/smp.h>
#include <asm/firmware.h>
#include <asm/eeh.h>
+#include <asm/pSeries_reconfig.h>
#include "plpar_wrappers.h"
#include "pseries.h"
@@ -254,6 +255,31 @@ static void __init pseries_discover_pic(void)
" interrupt-controller\n");
}
+extern void * update_dn_pci_info(struct device_node *dn, void *data);
+
+static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
+{
+ struct device_node *np = node;
+ struct pci_dn *pci = NULL;
+ int err = NOTIFY_OK;
+
+ switch (action) {
+ case PSERIES_RECONFIG_ADD:
+ pci = np->parent->data;
+ if (pci)
+ update_dn_pci_info(np, pci->phb);
+ break;
+ default:
+ err = NOTIFY_DONE;
+ break;
+ }
+ return err;
+}
+
+static struct notifier_block pci_dn_reconfig_nb = {
+ .notifier_call = pci_dn_reconfig_notifier,
+};
+
static void __init pSeries_setup_arch(void)
{
/* Discover PIC type and setup ppc_md accordingly */
@@ -271,6 +297,7 @@ static void __init pSeries_setup_arch(void)
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
find_and_init_phbs();
+ pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
eeh_init();
pSeries_nvram_init();
--
1.6.0.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pci: Move pseries code into pseries platform specific area
2009-04-30 14:14 [PATCH] powerpc/pci: Move pseries code into pseries platform specific area Kumar Gala
@ 2009-04-30 14:49 ` Michael Ellerman
2009-04-30 15:35 ` Kumar Gala
0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2009-04-30 14:49 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On Thu, 2009-04-30 at 09:14 -0500, Kumar Gala wrote:
> There doesn't appear to be any specific reason that we need to setup the
> pseries specific notifier in generic arch pci code. Move it into pseries
> land.
Yeah I guess. Although if some other platform ever wants to do PCI
hotplug it probably wants to call update_dn_pci_info() also.
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -254,6 +255,31 @@ static void __init pseries_discover_pic(void)
> " interrupt-controller\n");
> }
>
> +extern void * update_dn_pci_info(struct device_node *dn, void *data);
Ahem :)
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pci: Move pseries code into pseries platform specific area
2009-04-30 14:49 ` Michael Ellerman
@ 2009-04-30 15:35 ` Kumar Gala
2009-04-30 22:52 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2009-04-30 15:35 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev, Paul Mackerras
On Apr 30, 2009, at 9:49 AM, Michael Ellerman wrote:
> On Thu, 2009-04-30 at 09:14 -0500, Kumar Gala wrote:
>> There doesn't appear to be any specific reason that we need to
>> setup the
>> pseries specific notifier in generic arch pci code. Move it into
>> pseries
>> land.
>
> Yeah I guess. Although if some other platform ever wants to do PCI
> hotplug it probably wants to call update_dn_pci_info() also.
when that happens we can worry about, also the code I moved is pretty
pseries specific (seeing as the event is called PSERIES_RECONFIG_ADD)
>> --- a/arch/powerpc/platforms/pseries/setup.c
>> +++ b/arch/powerpc/platforms/pseries/setup.c
>> @@ -254,6 +255,31 @@ static void __init pseries_discover_pic(void)
>> " interrupt-controller\n");
>> }
>>
>> +extern void * update_dn_pci_info(struct device_node *dn, void
>> *data);
>
> Ahem :)
Yeah, was being lazy. I'll move it into asm/pci-bridge.h
- k
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pci: Move pseries code into pseries platform specific area
2009-04-30 15:35 ` Kumar Gala
@ 2009-04-30 22:52 ` Michael Ellerman
0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2009-04-30 22:52 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
On Thu, 2009-04-30 at 10:35 -0500, Kumar Gala wrote:
> On Apr 30, 2009, at 9:49 AM, Michael Ellerman wrote:
>
> > On Thu, 2009-04-30 at 09:14 -0500, Kumar Gala wrote:
> >> There doesn't appear to be any specific reason that we need to
> >> setup the
> >> pseries specific notifier in generic arch pci code. Move it into
> >> pseries
> >> land.
> >
> > Yeah I guess. Although if some other platform ever wants to do PCI
> > hotplug it probably wants to call update_dn_pci_info() also.
>
> when that happens we can worry about, also the code I moved is pretty
> pseries specific (seeing as the event is called PSERIES_RECONFIG_ADD)
Yeah I agree.
> >> --- a/arch/powerpc/platforms/pseries/setup.c
> >> +++ b/arch/powerpc/platforms/pseries/setup.c
> >> @@ -254,6 +255,31 @@ static void __init pseries_discover_pic(void)
> >> " interrupt-controller\n");
> >> }
> >>
> >> +extern void * update_dn_pci_info(struct device_node *dn, void
> >> *data);
> >
> > Ahem :)
>
> Yeah, was being lazy. I'll move it into asm/pci-bridge.h
Please do :)
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-30 22:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 14:14 [PATCH] powerpc/pci: Move pseries code into pseries platform specific area Kumar Gala
2009-04-30 14:49 ` Michael Ellerman
2009-04-30 15:35 ` Kumar Gala
2009-04-30 22:52 ` Michael Ellerman
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).