linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/21] powerpc/eeh: Drop unused argument in eeh_check_failure()
@ 2014-09-30  2:38 Gavin Shan
  2014-09-30  2:38 ` [PATCH 02/21] powerpc/eeh: Add eeh_pe_state sysfs entry Gavin Shan
                   ` (19 more replies)
  0 siblings, 20 replies; 23+ messages in thread
From: Gavin Shan @ 2014-09-30  2:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Vishal Mansur, Gavin Shan

eeh_check_failure() is used to check frozen state of the PE which
owns the indicated I/O address. The argument "val" of the function
isn't used. The patch drops it and return the frozen state of the
PE as expected.

Cc: Vishal Mansur <vmansur@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/eeh.h | 29 ++++++++++++++---------------
 arch/powerpc/kernel/eeh.c      | 15 ++++++---------
 2 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index 9983c3d..adcddb1 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -269,8 +269,7 @@ void eeh_dev_phb_init_dynamic(struct pci_controller *phb);
 int eeh_init(void);
 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,
-				unsigned long val);
+int eeh_check_failure(const volatile void __iomem *token);
 int eeh_dev_check_failure(struct eeh_dev *edev);
 void eeh_addr_cache_build(void);
 void eeh_add_device_early(struct device_node *);
@@ -321,9 +320,9 @@ 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 unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val)
+static inline int eeh_check_failure(const volatile void __iomem *token)
 {
-	return val;
+	return 0;
 }
 
 #define eeh_dev_check_failure(x) (0)
@@ -354,7 +353,7 @@ static inline u8 eeh_readb(const volatile void __iomem *addr)
 {
 	u8 val = in_8(addr);
 	if (EEH_POSSIBLE_ERROR(val, u8))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -362,7 +361,7 @@ static inline u16 eeh_readw(const volatile void __iomem *addr)
 {
 	u16 val = in_le16(addr);
 	if (EEH_POSSIBLE_ERROR(val, u16))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -370,7 +369,7 @@ static inline u32 eeh_readl(const volatile void __iomem *addr)
 {
 	u32 val = in_le32(addr);
 	if (EEH_POSSIBLE_ERROR(val, u32))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -378,7 +377,7 @@ static inline u64 eeh_readq(const volatile void __iomem *addr)
 {
 	u64 val = in_le64(addr);
 	if (EEH_POSSIBLE_ERROR(val, u64))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -386,7 +385,7 @@ static inline u16 eeh_readw_be(const volatile void __iomem *addr)
 {
 	u16 val = in_be16(addr);
 	if (EEH_POSSIBLE_ERROR(val, u16))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -394,7 +393,7 @@ static inline u32 eeh_readl_be(const volatile void __iomem *addr)
 {
 	u32 val = in_be32(addr);
 	if (EEH_POSSIBLE_ERROR(val, u32))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -402,7 +401,7 @@ static inline u64 eeh_readq_be(const volatile void __iomem *addr)
 {
 	u64 val = in_be64(addr);
 	if (EEH_POSSIBLE_ERROR(val, u64))
-		return eeh_check_failure(addr, val);
+		eeh_check_failure(addr);
 	return val;
 }
 
@@ -416,7 +415,7 @@ static inline void eeh_memcpy_fromio(void *dest, const
 	 * were copied. Check all four bytes.
 	 */
 	if (n >= 4 && EEH_POSSIBLE_ERROR(*((u32 *)(dest + n - 4)), u32))
-		eeh_check_failure(src, *((u32 *)(dest + n - 4)));
+		eeh_check_failure(src);
 }
 
 /* in-string eeh macros */
@@ -425,7 +424,7 @@ static inline void eeh_readsb(const volatile void __iomem *addr, void * buf,
 {
 	_insb(addr, buf, ns);
 	if (EEH_POSSIBLE_ERROR((*(((u8*)buf)+ns-1)), u8))
-		eeh_check_failure(addr, *(u8*)buf);
+		eeh_check_failure(addr);
 }
 
 static inline void eeh_readsw(const volatile void __iomem *addr, void * buf,
@@ -433,7 +432,7 @@ static inline void eeh_readsw(const volatile void __iomem *addr, void * buf,
 {
 	_insw(addr, buf, ns);
 	if (EEH_POSSIBLE_ERROR((*(((u16*)buf)+ns-1)), u16))
-		eeh_check_failure(addr, *(u16*)buf);
+		eeh_check_failure(addr);
 }
 
 static inline void eeh_readsl(const volatile void __iomem *addr, void * buf,
@@ -441,7 +440,7 @@ static inline void eeh_readsl(const volatile void __iomem *addr, void * buf,
 {
 	_insl(addr, buf, nl);
 	if (EEH_POSSIBLE_ERROR((*(((u32*)buf)+nl-1)), u32))
-		eeh_check_failure(addr, *(u32*)buf);
+		eeh_check_failure(addr);
 }
 
 #endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 59a64f8..17cf52ba 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -542,17 +542,16 @@ EXPORT_SYMBOL_GPL(eeh_dev_check_failure);
 
 /**
  * eeh_check_failure - Check if all 1's data is due to EEH slot freeze
- * @token: I/O token, should be address in the form 0xA....
- * @val: value, should be all 1's (XXX why do we need this arg??)
+ * @token: I/O address
  *
- * Check for an EEH failure at the given token address.  Call this
+ * Check for an EEH failure at the given I/O address. Call this
  * routine if the result of a read was all 0xff's and you want to
- * find out if this is due to an EEH slot freeze event.  This routine
+ * find out if this is due to an EEH slot freeze event. This routine
  * will query firmware for the EEH status.
  *
  * Note this routine is safe to call in an interrupt context.
  */
-unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val)
+int eeh_check_failure(const volatile void __iomem *token)
 {
 	unsigned long addr;
 	struct eeh_dev *edev;
@@ -562,13 +561,11 @@ unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned lon
 	edev = eeh_addr_cache_get_dev(addr);
 	if (!edev) {
 		eeh_stats.no_device++;
-		return val;
+		return 0;
 	}
 
-	eeh_dev_check_failure(edev);
-	return val;
+	return eeh_dev_check_failure(edev);
 }
-
 EXPORT_SYMBOL(eeh_check_failure);
 
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-10-01  4:20 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  2:38 [PATCH 01/21] powerpc/eeh: Drop unused argument in eeh_check_failure() Gavin Shan
2014-09-30  2:38 ` [PATCH 02/21] powerpc/eeh: Add eeh_pe_state sysfs entry Gavin Shan
2014-10-01  3:43   ` [02/21] " Michael Ellerman
2014-10-01  4:20     ` Gavin Shan
2014-09-30  2:38 ` [PATCH 03/21] powerpc/eeh: Freeze PE before PE reset Gavin Shan
2014-09-30  2:38 ` [PATCH 04/21] powerpc/eeh: Reenable PCI devices after reset Gavin Shan
2014-09-30  2:38 ` [PATCH 05/21] powerpc/eeh: Clear frozen state on passing device Gavin Shan
2014-09-30  2:38 ` [PATCH 06/21] powerpc/powernv: Sync header with firmware Gavin Shan
2014-09-30  2:38 ` [PATCH 07/21] powerpc/eeh: Introduce eeh_ops::err_inject Gavin Shan
2014-09-30  2:38 ` [PATCH 08/21] powerpc/powernv: Add PCI error injection debugfs entry Gavin Shan
2014-09-30  2:38 ` [PATCH 09/21] powerpc/powernv: Clear PAPR error injection registers Gavin Shan
2014-09-30  2:38 ` [PATCH 10/21] powerpc/eeh: Clear frozen device state in time Gavin Shan
2014-09-30  2:39 ` [PATCH 11/21] powerpc/eeh: Fix improper condition in eeh_pci_enable() Gavin Shan
2014-09-30  2:39 ` [PATCH 12/21] powerpc/eeh: Unfreeze PE on enabling EEH functionality Gavin Shan
2014-09-30  2:39 ` [PATCH 13/21] powerpc/eeh: Use eeh_unfreeze_pe() Gavin Shan
2014-09-30  2:39 ` [PATCH 14/21] powerpc/eeh: Block PCI config access during reset Gavin Shan
2014-09-30  2:39 ` [PATCH 15/21] powerpc/pseries: Decrease message level on EEH initialization Gavin Shan
2014-09-30  2:39 ` [PATCH 16/21] powerpc/powernv: Sync OpalPciResetScope with firmware Gavin Shan
2014-09-30  2:39 ` [PATCH 17/21] powerpc/eeh: Tag reset state for user owned PE Gavin Shan
2014-09-30  2:39 ` [PATCH 18/21] powerpc/eeh: Emulate EEH recovery for VFIO devices Gavin Shan
2014-09-30  2:39 ` [PATCH 19/21] powerpc/eeh: Dump PCI config space for all child devices Gavin Shan
2014-09-30  2:39 ` [PATCH 20/21] powerpc/powernv: Fetch frozen PE on top level Gavin Shan
2014-09-30  2:39 ` [PATCH 21/21] powerpc/powernv: Override dma_get_required_mask() Gavin Shan

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).