From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH 01/22] ppc/eeh: move EEH initialization around
Date: Sat, 8 Sep 2012 16:44:02 +0800 [thread overview]
Message-ID: <1347093863-6319-2-git-send-email-shangw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1347093863-6319-1-git-send-email-shangw@linux.vnet.ibm.com>
Currently, we have 3 phases for EEH initialization on pSeries platform.
All of them are done through builtin functions: platform initialization,
EEH device creation, and EEH subsystem enablement. All of them are done
no later than ppc_md.setup_arch. That means that the slab/slub isn't ready
yet, so we have to allocate memory chunks on basis of PAGE_SIZE for those
dynamically created EEH devices. That's pretty expensive.
In order to utilize slab/slub for memory allocation, we have to move the EEH
initialization functions around, but all of them should be called after slab
is ready.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/eeh.h | 16 ----------------
arch/powerpc/kernel/rtas_pci.c | 3 ---
arch/powerpc/platforms/pseries/eeh.c | 10 +++++++---
arch/powerpc/platforms/pseries/eeh_dev.c | 6 +++++-
arch/powerpc/platforms/pseries/eeh_pseries.c | 4 +++-
arch/powerpc/platforms/pseries/setup.c | 2 --
6 files changed, 15 insertions(+), 26 deletions(-)
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index d60f998..06dedff 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -117,11 +117,6 @@ extern int eeh_subsystem_enabled;
void * __devinit eeh_dev_init(struct device_node *dn, void *data);
void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb);
-void __init eeh_dev_phb_init(void);
-void __init eeh_init(void);
-#ifdef CONFIG_PPC_PSERIES
-int __init eeh_pseries_init(void);
-#endif
int __init eeh_ops_register(struct eeh_ops *ops);
int __exit eeh_ops_unregister(const char *name);
unsigned long eeh_check_failure(const volatile void __iomem *token,
@@ -156,17 +151,6 @@ static inline void *eeh_dev_init(struct device_node *dn, void *data)
static inline void eeh_dev_phb_init_dynamic(struct pci_controller *phb) { }
-static inline void eeh_dev_phb_init(void) { }
-
-static inline void eeh_init(void) { }
-
-#ifdef CONFIG_PPC_PSERIES
-static inline int eeh_pseries_init(void)
-{
- return 0;
-}
-#endif /* CONFIG_PPC_PSERIES */
-
static inline unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val)
{
return val;
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 179af90..140735c 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -275,9 +275,6 @@ void __init find_and_init_phbs(void)
of_node_put(root);
pci_devs_phb_init();
- /* Create EEH devices for all PHBs */
- eeh_dev_phb_init();
-
/*
* PCI_PROBE_ONLY and PCI_REASSIGN_ALL_BUS can be set via properties
* in chosen.
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index ecd394c..e819448 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -982,7 +982,7 @@ int __exit eeh_ops_unregister(const char *name)
* Even if force-off is set, the EEH hardware is still enabled, so that
* newer systems can boot.
*/
-void __init eeh_init(void)
+static int __init eeh_init(void)
{
struct pci_controller *hose, *tmp;
struct device_node *phb;
@@ -992,11 +992,11 @@ void __init eeh_init(void)
if (!eeh_ops) {
pr_warning("%s: Platform EEH operation not found\n",
__func__);
- return;
+ return -EEXIST;
} else if ((ret = eeh_ops->init())) {
pr_warning("%s: Failed to call platform init function (%d)\n",
__func__, ret);
- return;
+ return ret;
}
raw_spin_lock_init(&confirm_error_lock);
@@ -1011,8 +1011,12 @@ void __init eeh_init(void)
printk(KERN_INFO "EEH: PCI Enhanced I/O Error Handling Enabled\n");
else
printk(KERN_WARNING "EEH: No capable adapters found\n");
+
+ return ret;
}
+core_initcall_sync(eeh_init);
+
/**
* eeh_add_device_early - Enable EEH for the indicated device_node
* @dn: device node for which to set up EEH
diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c
index c4507d0..ab68c59 100644
--- a/arch/powerpc/platforms/pseries/eeh_dev.c
+++ b/arch/powerpc/platforms/pseries/eeh_dev.c
@@ -93,10 +93,14 @@ void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb)
* Scan all the existing PHBs and create EEH devices for their OF
* nodes and their children OF nodes
*/
-void __init eeh_dev_phb_init(void)
+static int __init eeh_dev_phb_init(void)
{
struct pci_controller *phb, *tmp;
list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
eeh_dev_phb_init_dynamic(phb);
+
+ return 0;
}
+
+core_initcall(eeh_dev_phb_init);
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index c33360ec..5e2805a 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -559,7 +559,9 @@ static struct eeh_ops pseries_eeh_ops = {
* EEH initialization on pseries platform. This function should be
* called before any EEH related functions.
*/
-int __init eeh_pseries_init(void)
+static int __init eeh_pseries_init(void)
{
return eeh_ops_register(&pseries_eeh_ops);
}
+
+early_initcall(eeh_pseries_init);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 51ecac9..5406473 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -388,10 +388,8 @@ static void __init pSeries_setup_arch(void)
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
- eeh_pseries_init();
find_and_init_phbs();
pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
- eeh_init();
pSeries_nvram_init();
--
1.7.5.4
next prev parent reply other threads:[~2012-09-08 8:45 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-08 8:44 [PATCH 00/22 V4] powerpc/eeh: PE support Gavin Shan
2012-09-08 8:44 ` Gavin Shan [this message]
2012-09-08 8:44 ` [PATCH 02/22] ppc/eeh: use slab to allocate eeh devices Gavin Shan
2012-09-08 8:44 ` [PATCH 03/22] ppc/eeh: more logs for EEH initialization Gavin Shan
2012-09-08 8:44 ` [PATCH 04/22] ppc/eeh: Introduce eeh_pe struct Gavin Shan
2012-09-08 8:44 ` [PATCH 05/22] ppc/eeh: introduce global mutex Gavin Shan
2012-09-08 8:44 ` [PATCH 06/22] ppc/eeh: Create PEs for PHBs Gavin Shan
2012-09-08 8:44 ` [PATCH 07/22] ppc/eeh: Search PE based on requirement Gavin Shan
2012-09-08 8:44 ` [PATCH 08/22] ppc/eeh: create PEs duing EEH initialization Gavin Shan
2012-09-08 8:44 ` [PATCH 09/22] ppc/eeh: remove PE at appropriate time Gavin Shan
2012-09-08 8:44 ` [PATCH 10/22] ppc/eeh: build EEH event based on PE Gavin Shan
2012-09-08 8:44 ` [PATCH 11/22] ppc/eeh: trace EEH state " Gavin Shan
2012-09-08 8:44 ` [PATCH 12/22] ppc/eeh: trace error based on PE from beginning Gavin Shan
2012-09-08 8:44 ` [PATCH 13/22] ppc/eeh: eeh options based on PE Gavin Shan
2012-09-08 8:44 ` [PATCH 14/22] ppc/eeh: device bars restore " Gavin Shan
2012-09-08 8:44 ` [PATCH 15/22] ppc/eeh: I/O enable and log retrival " Gavin Shan
2012-09-08 8:44 ` [PATCH 16/22] ppc/eeh: do reset " Gavin Shan
2012-09-08 8:44 ` [PATCH 17/22] ppc/eeh: make EEH handler PE sensitive Gavin Shan
2012-09-08 8:44 ` [PATCH 18/22] ppc/eeh: handle EEH error based on PE Gavin Shan
2012-09-08 8:44 ` [PATCH 19/22] ppc/eeh: move stats to PE Gavin Shan
2012-09-08 8:44 ` [PATCH 20/22] ppc/eeh: probe mode support Gavin Shan
2012-09-08 8:44 ` [PATCH 21/22] ppc/eeh: trace eeh device from I/O cache Gavin Shan
2012-09-08 8:44 ` [PATCH 22/22] ppc/eeh: cleanup on EEH PCI address cache Gavin Shan
2012-09-09 23:59 ` Benjamin Herrenschmidt
2012-09-10 0:04 ` Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347093863-6319-2-git-send-email-shangw@linux.vnet.ibm.com \
--to=shangw@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).