aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2012-03-13 19:36:35 -0400
committerDan Williams <dan.j.williams@intel.com>2012-05-17 17:33:44 -0400
commit79cbab89ff31b6c6ab896d4ed5e3b2ae65193a96 (patch)
treecd88e03d748a9bc6b2df873fc430c3b62282e170 /drivers/scsi
parent3ef768c6c0caa83b9fe66f19a18898ed0315ac36 (diff)
isci: Fix RNC AWAIT_SUSPENSION->INVALIDATING transition.
The RNC state machine would incorrectly transition from SCI_RNC_AWAIT_SUSPENSION directly to SCI_RNC_INVALIDATING when a destruct request was made. This would skip the increment of the suspension count and the abort of pending TCs (although the invalidating state would at least cleanup outstanding TCs). Instead, the RNC will transition to SCI_RNC_SUSPENDED and then start the destruction process. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/isci/remote_node_context.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c
index 920c2bb39333..6f0b61b2cca8 100644
--- a/drivers/scsi/isci/remote_node_context.c
+++ b/drivers/scsi/isci/remote_node_context.c
@@ -222,13 +222,19 @@ static void sci_remote_node_context_notify_user(
222 222
223static void sci_remote_node_context_continue_state_transitions(struct sci_remote_node_context *rnc) 223static void sci_remote_node_context_continue_state_transitions(struct sci_remote_node_context *rnc)
224{ 224{
225 if ((rnc->destination_state == RNC_DEST_READY) || 225 switch (rnc->destination_state) {
226 (rnc->destination_state == RNC_DEST_SUSPENDED_RESUME)) { 226 case RNC_DEST_READY:
227 case RNC_DEST_SUSPENDED_RESUME:
227 rnc->destination_state = RNC_DEST_READY; 228 rnc->destination_state = RNC_DEST_READY;
229 /* Fall through... */
230 case RNC_DEST_FINAL:
228 sci_remote_node_context_resume(rnc, rnc->user_callback, 231 sci_remote_node_context_resume(rnc, rnc->user_callback,
229 rnc->user_cookie); 232 rnc->user_cookie);
230 } else 233 break;
234 default:
231 rnc->destination_state = RNC_DEST_UNSPECIFIED; 235 rnc->destination_state = RNC_DEST_UNSPECIFIED;
236 break;
237 }
232} 238}
233 239
234static void sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc) 240static void sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc)
@@ -539,10 +545,12 @@ enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context
539 case SCI_RNC_READY: 545 case SCI_RNC_READY:
540 case SCI_RNC_TX_SUSPENDED: 546 case SCI_RNC_TX_SUSPENDED:
541 case SCI_RNC_TX_RX_SUSPENDED: 547 case SCI_RNC_TX_RX_SUSPENDED:
542 case SCI_RNC_AWAIT_SUSPENSION:
543 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); 548 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p);
544 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); 549 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING);
545 return SCI_SUCCESS; 550 return SCI_SUCCESS;
551 case SCI_RNC_AWAIT_SUSPENSION:
552 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p);
553 return SCI_SUCCESS;
546 case SCI_RNC_INITIAL: 554 case SCI_RNC_INITIAL:
547 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), 555 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)),
548 "%s: invalid state: %s\n", __func__, 556 "%s: invalid state: %s\n", __func__,