aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-09-07 18:44:21 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-09 19:35:44 -0400
commitd7bb88629dd64242fbbd7dd34ecad073afdbafad (patch)
treeb1411f72e6657e2ff31a8fbfae799dc3f78b86bc /arch/powerpc/include/asm
parentdbbceee12f2160ef1ac848316212f97bf5bc4c16 (diff)
powerpc/eeh: Probe mode support
While EEH module is installed, PCI devices is checked one by one to see if it supports eeh. On different platforms, the PCI devices are referred through different ways when the EEH module is loaded. For example, on pSeries platform, that is done by OF node. However, we would do that by real PCI devices (struct pci_dev) on PowerNV platform in future. So we needs some mechanism to differentiate those cases by classifying them to probe modes, either from OF nodes or real PCI devices. The patch implements the support to eeh probe mode. Also, the EEH on pSeries has set it into EEH_PROBE_MODE_DEVTREE. That means the probe will be done based on OF nodes on pSeries platform. In addition, On pSeries platform, it's done by OF nodes. The patch moves the the probe function from EEH core to platform dependent backend and some cleanup applied. 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')
-rw-r--r--arch/powerpc/include/asm/eeh.h21
-rw-r--r--arch/powerpc/include/asm/ppc-pci.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index 792d2d789751..895fd0d59ed7 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -129,6 +129,8 @@ static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev)
129struct eeh_ops { 129struct eeh_ops {
130 char *name; 130 char *name;
131 int (*init)(void); 131 int (*init)(void);
132 void* (*of_probe)(struct device_node *dn, void *flag);
133 void* (*dev_probe)(struct pci_dev *dev, void *flag);
132 int (*set_option)(struct eeh_pe *pe, int option); 134 int (*set_option)(struct eeh_pe *pe, int option);
133 int (*get_pe_addr)(struct eeh_pe *pe); 135 int (*get_pe_addr)(struct eeh_pe *pe);
134 int (*get_state)(struct eeh_pe *pe, int *state); 136 int (*get_state)(struct eeh_pe *pe, int *state);
@@ -143,6 +145,25 @@ struct eeh_ops {
143extern struct eeh_ops *eeh_ops; 145extern struct eeh_ops *eeh_ops;
144extern int eeh_subsystem_enabled; 146extern int eeh_subsystem_enabled;
145extern struct mutex eeh_mutex; 147extern struct mutex eeh_mutex;
148extern int eeh_probe_mode;
149
150#define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */
151#define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */
152
153static inline void eeh_probe_mode_set(int flag)
154{
155 eeh_probe_mode = flag;
156}
157
158static inline int eeh_probe_mode_devtree(void)
159{
160 return (eeh_probe_mode == EEH_PROBE_MODE_DEVTREE);
161}
162
163static inline int eeh_probe_mode_dev(void)
164{
165 return (eeh_probe_mode == EEH_PROBE_MODE_DEV);
166}
146 167
147static inline void eeh_lock(void) 168static inline void eeh_lock(void)
148{ 169{
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 2a80f080a7ba..56d55c7fed9a 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -54,6 +54,7 @@ struct pci_dev *pci_addr_cache_get_device(unsigned long addr);
54void eeh_slot_error_detail(struct eeh_pe *pe, int severity); 54void eeh_slot_error_detail(struct eeh_pe *pe, int severity);
55int eeh_pci_enable(struct eeh_pe *pe, int function); 55int eeh_pci_enable(struct eeh_pe *pe, int function);
56int eeh_reset_pe(struct eeh_pe *); 56int eeh_reset_pe(struct eeh_pe *);
57void eeh_save_bars(struct eeh_dev *edev);
57int rtas_write_config(struct pci_dn *, int where, int size, u32 val); 58int rtas_write_config(struct pci_dn *, int where, int size, u32 val);
58int rtas_read_config(struct pci_dn *, int where, int size, u32 *val); 59int rtas_read_config(struct pci_dn *, int where, int size, u32 *val);
59void eeh_pe_state_mark(struct eeh_pe *pe, int state); 60void eeh_pe_state_mark(struct eeh_pe *pe, int state);