Преглед на файлове

powerpc/eeh: Introduce flag EEH_PE_REMOVED

The conditions that one specific PE's frozen count exceeds the maximal
allowed times (EEH_MAX_ALLOWED_FREEZES) and it's in isolated or recovery
state indicate the PE was removed permanently implicitly. The patch
introduces flag EEH_PE_REMOVED to indicate that explicitly so that we
don't depend on the fixed maximal allowed times, which can be varied as
we do in subsequent patch.

Flag EEH_PE_REMOVED is expected to be marked for the PE whose frozen
count exceeds the maximal allowed times, or just failed from recovery.

Requested-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Gavin Shan преди 11 години
родител
ревизия
432227e907
променени са 3 файла, в които са добавени 4 реда и са изтрити 5 реда
  1. 1 0
      arch/powerpc/include/asm/eeh.h
  2. 1 1
      arch/powerpc/kernel/eeh_driver.c
  3. 2 4
      arch/powerpc/kernel/eeh_pe.c

+ 1 - 0
arch/powerpc/include/asm/eeh.h

@@ -78,6 +78,7 @@ struct device_node;
 
 
 #define EEH_PE_KEEP		(1 << 8)	/* Keep PE on hotplug	*/
 #define EEH_PE_KEEP		(1 << 8)	/* Keep PE on hotplug	*/
 #define EEH_PE_CFG_RESTRICTED	(1 << 9)	/* Block config on error */
 #define EEH_PE_CFG_RESTRICTED	(1 << 9)	/* Block config on error */
+#define EEH_PE_REMOVED		(1 << 10)	/* Removed permanently	*/
 
 
 struct eeh_pe {
 struct eeh_pe {
 	int type;			/* PE type: PHB/Bus/Device	*/
 	int type;			/* PE type: PHB/Bus/Device	*/

+ 1 - 1
arch/powerpc/kernel/eeh_driver.c

@@ -806,7 +806,7 @@ perm_error:
 	eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
 	eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
 
 
 	/* Mark the PE to be removed permanently */
 	/* Mark the PE to be removed permanently */
-	pe->freeze_count = EEH_MAX_ALLOWED_FREEZES + 1;
+	eeh_pe_state_mark(pe, EEH_PE_REMOVED);
 
 
 	/*
 	/*
 	 * Shut down the device drivers for good. We mark
 	 * Shut down the device drivers for good. We mark

+ 2 - 4
arch/powerpc/kernel/eeh_pe.c

@@ -526,8 +526,7 @@ static void *__eeh_pe_state_mark(void *data, void *flag)
 	struct pci_dev *pdev;
 	struct pci_dev *pdev;
 
 
 	/* Keep the state of permanently removed PE intact */
 	/* Keep the state of permanently removed PE intact */
-	if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) &&
-	    (state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING)))
+	if (pe->state & EEH_PE_REMOVED)
 		return NULL;
 		return NULL;
 
 
 	pe->state |= state;
 	pe->state |= state;
@@ -600,8 +599,7 @@ static void *__eeh_pe_state_clear(void *data, void *flag)
 	struct pci_dev *pdev;
 	struct pci_dev *pdev;
 
 
 	/* Keep the state of permanently removed PE intact */
 	/* Keep the state of permanently removed PE intact */
-	if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) &&
-	    (state & EEH_PE_ISOLATED))
+	if (pe->state & EEH_PE_REMOVED)
 		return NULL;
 		return NULL;
 
 
 	pe->state &= ~state;
 	pe->state &= ~state;