diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2014-12-10 22:28:55 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-01-22 22:02:53 -0500 |
commit | 432227e9077eec13b3caf3aec6087f94a2f4327f (patch) | |
tree | 7187da73a487f7251f6c03ace7b0d9c138edf327 | |
parent | 2aa5cf9e48f2f39cc255f8e29964df3ff9ca017b (diff) |
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>
-rw-r--r-- | arch/powerpc/include/asm/eeh.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/eeh_driver.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/eeh_pe.c | 6 |
3 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 9c11d1ed6a36..3e4dd34f2bd2 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
@@ -78,6 +78,7 @@ struct device_node; | |||
78 | 78 | ||
79 | #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ | 79 | #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ |
80 | #define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */ | 80 | #define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */ |
81 | #define EEH_PE_REMOVED (1 << 10) /* Removed permanently */ | ||
81 | 82 | ||
82 | struct eeh_pe { | 83 | struct eeh_pe { |
83 | int type; /* PE type: PHB/Bus/Device */ | 84 | int type; /* PE type: PHB/Bus/Device */ |
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index b17e793ba67e..ac00672af7d1 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c | |||
@@ -806,7 +806,7 @@ perm_error: | |||
806 | eeh_pe_dev_traverse(pe, eeh_report_failure, NULL); | 806 | eeh_pe_dev_traverse(pe, eeh_report_failure, NULL); |
807 | 807 | ||
808 | /* Mark the PE to be removed permanently */ | 808 | /* Mark the PE to be removed permanently */ |
809 | pe->freeze_count = EEH_MAX_ALLOWED_FREEZES + 1; | 809 | eeh_pe_state_mark(pe, EEH_PE_REMOVED); |
810 | 810 | ||
811 | /* | 811 | /* |
812 | * Shut down the device drivers for good. We mark | 812 | * Shut down the device drivers for good. We mark |
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c index fa950fbc2d97..1e4946c36f9e 100644 --- a/arch/powerpc/kernel/eeh_pe.c +++ b/arch/powerpc/kernel/eeh_pe.c | |||
@@ -526,8 +526,7 @@ static void *__eeh_pe_state_mark(void *data, void *flag) | |||
526 | struct pci_dev *pdev; | 526 | struct pci_dev *pdev; |
527 | 527 | ||
528 | /* Keep the state of permanently removed PE intact */ | 528 | /* Keep the state of permanently removed PE intact */ |
529 | if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) && | 529 | if (pe->state & EEH_PE_REMOVED) |
530 | (state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING))) | ||
531 | return NULL; | 530 | return NULL; |
532 | 531 | ||
533 | pe->state |= state; | 532 | pe->state |= state; |
@@ -600,8 +599,7 @@ static void *__eeh_pe_state_clear(void *data, void *flag) | |||
600 | struct pci_dev *pdev; | 599 | struct pci_dev *pdev; |
601 | 600 | ||
602 | /* Keep the state of permanently removed PE intact */ | 601 | /* Keep the state of permanently removed PE intact */ |
603 | if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) && | 602 | if (pe->state & EEH_PE_REMOVED) |
604 | (state & EEH_PE_ISOLATED)) | ||
605 | return NULL; | 603 | return NULL; |
606 | 604 | ||
607 | pe->state &= ~state; | 605 | pe->state &= ~state; |