From 0e475b4bea0f905db972eb53a33e46484a4a3f34 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 2 Sep 2004 20:22:31 -0700 Subject: [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 Signed-off-by: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc64/eeh.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') 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... */ -- cgit v1.2.3