aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/common.h
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2015-08-13 22:47:34 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-08-26 21:03:47 -0400
commit5cdac81a870f3bb65c50d3f5566a86fb086118d2 (patch)
tree48c2da1d010d7c1fa0aa325f462cce70ce109e87 /drivers/scsi/cxlflash/common.h
parentef2a388dfce6ddc2fd0d1d798a8974396f6b6a22 (diff)
cxlflash: Base error recovery support
Introduce support for enhanced I/O error handling. A device state is added to track 3 possible states of the device: Normal - the device is operating normally and is fully operational Limbo - the device is in a reset/recovery scenario and its operational status is paused Failed/terminating - the device has either failed to be reset/recovered or is being terminated (removed); it is no longer operational All operations are allowed when the device is operating normally. When the device transitions to limbo state, I/O must be paused. To help accomplish this, a wait queue is introduced where existing and new threads can wait until the device is no longer in limbo. When coming out of limbo, threads need to check the state and error out gracefully when encountering the failed state. When the device transitions to the failed/terminating state, normal operations are no longer allowed. Only specially designated operations related to graceful cleanup are permitted. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com> Reviewed-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> Reviewed-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash/common.h')
-rw-r--r--drivers/scsi/cxlflash/common.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
index 5f43608dc8a1..ffdbc572d180 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -76,6 +76,12 @@ enum cxlflash_init_state {
76 INIT_STATE_SCSI 76 INIT_STATE_SCSI
77}; 77};
78 78
79enum cxlflash_state {
80 STATE_NORMAL, /* Normal running state, everything good */
81 STATE_LIMBO, /* Limbo running state, trying to reset/recover */
82 STATE_FAILTERM /* Failed/terminating state, error out users/threads */
83};
84
79/* 85/*
80 * Each context has its own set of resource handles that is visible 86 * Each context has its own set of resource handles that is visible
81 * only from that context. 87 * only from that context.
@@ -91,8 +97,6 @@ struct cxlflash_cfg {
91 97
92 ulong cxlflash_regs_pci; 98 ulong cxlflash_regs_pci;
93 99
94 wait_queue_head_t eeh_waitq;
95
96 struct work_struct work_q; 100 struct work_struct work_q;
97 enum cxlflash_init_state init_state; 101 enum cxlflash_init_state init_state;
98 enum cxlflash_lr_state lr_state; 102 enum cxlflash_lr_state lr_state;
@@ -105,7 +109,8 @@ struct cxlflash_cfg {
105 109
106 wait_queue_head_t tmf_waitq; 110 wait_queue_head_t tmf_waitq;
107 bool tmf_active; 111 bool tmf_active;
108 u8 err_recovery_active:1; 112 wait_queue_head_t limbo_waitq;
113 enum cxlflash_state state;
109}; 114};
110 115
111struct afu_cmd { 116struct afu_cmd {