aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/eeh.h
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-02-27 15:03:53 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-08 19:08:54 -0500
commitaa1e6374ae11788752535ae0c8c6395c9cad1393 (patch)
tree6763bddf1be60f6753badbfc00459e93c4625be7 /arch/powerpc/include/asm/eeh.h
parentcce4b2d243ddd9e8d5da159b893117afd7ccad5c (diff)
powerpc/eeh: Platform dependent EEH operations
EEH has been implemented on RTAS-compliant pSeries platform. That's to say, the EEH operations will be implemented through RTAS calls eventually. The situation limited feasible extension on EEH. In order to support EEH on multiple platforms like pseries and powernv simutaneously. We have to split the platform dependent EEH options up out of current implementation. The patch addresses supporting EEH on multiple platforms. The pseries platform dependent EEH operations will be abstracted by struct eeh_ops. EEH core components will be built based on the registered EEH operations. With the mechanism, what the individual platform needs to do is implement platform dependent EEH operations. For now, the pseries platform is covered under the mechanism. That means we have to think about other platforms to support EEH, like powernv. Besides, we only have framework for the mechanism and we have to implement it for pseries platform later. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/eeh.h')
-rw-r--r--arch/powerpc/include/asm/eeh.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index 232887721ff4..0666c52b8f14 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -31,6 +31,26 @@ struct device_node;
31 31
32#ifdef CONFIG_EEH 32#ifdef CONFIG_EEH
33 33
34/*
35 * The struct is used to trace the registered EEH operation
36 * callback functions. Actually, those operation callback
37 * functions are heavily platform dependent. That means the
38 * platform should register its own EEH operation callback
39 * functions before any EEH further operations.
40 */
41struct eeh_ops {
42 char *name;
43 int (*init)(void);
44 int (*set_option)(struct device_node *dn, int option);
45 int (*get_pe_addr)(struct device_node *dn);
46 int (*get_state)(struct device_node *dn, int *state);
47 int (*reset)(struct device_node *dn, int option);
48 int (*wait_state)(struct device_node *dn, int max_wait);
49 int (*get_log)(struct device_node *dn, int severity, char *drv_log, unsigned long len);
50 int (*configure_bridge)(struct device_node *dn);
51};
52
53extern struct eeh_ops *eeh_ops;
34extern int eeh_subsystem_enabled; 54extern int eeh_subsystem_enabled;
35 55
36/* Values for eeh_mode bits in device_node */ 56/* Values for eeh_mode bits in device_node */
@@ -47,6 +67,11 @@ extern int eeh_subsystem_enabled;
47#define EEH_MAX_ALLOWED_FREEZES 5 67#define EEH_MAX_ALLOWED_FREEZES 5
48 68
49void __init eeh_init(void); 69void __init eeh_init(void);
70#ifdef CONFIG_PPC_PSERIES
71int __init eeh_pseries_init(void);
72#endif
73int __init eeh_ops_register(struct eeh_ops *ops);
74int __exit eeh_ops_unregister(const char *name);
50unsigned long eeh_check_failure(const volatile void __iomem *token, 75unsigned long eeh_check_failure(const volatile void __iomem *token,
51 unsigned long val); 76 unsigned long val);
52int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev); 77int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev);
@@ -73,6 +98,13 @@ void eeh_remove_bus_device(struct pci_dev *);
73#else /* !CONFIG_EEH */ 98#else /* !CONFIG_EEH */
74static inline void eeh_init(void) { } 99static inline void eeh_init(void) { }
75 100
101#ifdef CONFIG_PPC_PSERIES
102static inline int eeh_pseries_init(void)
103{
104 return 0;
105}
106#endif /* CONFIG_PPC_PSERIES */
107
76static inline unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val) 108static inline unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val)
77{ 109{
78 return val; 110 return val;