summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2004-09-02 20:22:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-02 20:22:31 -0700
commit0e475b4bea0f905db972eb53a33e46484a4a3f34 (patch)
tree6ff7d3e770130a8e2d3ff572b75f04c4d399e027 /include
parent88399f1230887d773ccb77d3c89d0380d432e57b (diff)
[PATCH] ppc64: test for EEH error in PCI Config-Read path
This patch adds explicit checking for EEH slot isolation events into the PCI config space read path. The change itself would have been minor, except that pci config reads don't have a pointer to a struct pci_dev. Thus, I had to restructure the eeh code to accomodate this, which seems to be a good thing anyway, making it a tad cleaner. Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc64/eeh.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h
index f5ec2602b50b..0b705aec9780 100644
--- a/include/asm-ppc64/eeh.h
+++ b/include/asm-ppc64/eeh.h
@@ -44,6 +44,7 @@ struct device_node;
extern void __init eeh_init(void);
unsigned long eeh_check_failure(void *token, unsigned long val);
+int eeh_dn_check_failure (struct device_node *dn, struct pci_dev *dev);
void *eeh_ioremap(unsigned long addr, void *vaddr);
void __init pci_addr_cache_build(void);
@@ -89,7 +90,15 @@ int eeh_set_option(struct pci_dev *dev, int options);
*/
#define EEH_POSSIBLE_IO_ERROR(val, type) ((val) == (type)~0)
-/* The vaddr will equal the addr if EEH checking is disabled for
+/*
+ * Reads from a device which has been isolated by EEH will return
+ * all 1s. This macro gives an all-1s value of the given size (in
+ * bytes: 1, 2, or 4) for comparing with the result of a read.
+ */
+#define EEH_IO_ERROR_VALUE(size) (~0U >> ((4 - (size)) * 8))
+
+/*
+ * The vaddr will equal the addr if EEH checking is disabled for
* this device. This is because eeh_ioremap() will not have
* remapped to 0xA0, and thus both vaddr and addr will be 0xE0...
*/