From 1f05388933cb6e57ed9e51768c194ff145002f3b Mon Sep 17 00:00:00 2001 From: Jeff Skirvin Date: Thu, 8 Mar 2012 22:42:08 -0800 Subject: isci: Don't wait for an RNC suspend if it's being destroyed. Make sure that the wait for suspend can handle the RNC destruction case. Signed-off-by: Jeff Skirvin Signed-off-by: Dan Williams --- drivers/scsi/isci/remote_node_context.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/scsi/isci/remote_node_context.h') diff --git a/drivers/scsi/isci/remote_node_context.h b/drivers/scsi/isci/remote_node_context.h index c61c02e095ad..0d4a24d647b4 100644 --- a/drivers/scsi/isci/remote_node_context.h +++ b/drivers/scsi/isci/remote_node_context.h @@ -226,4 +226,11 @@ enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context int sci_remote_node_context_is_safe_to_abort( struct sci_remote_node_context *sci_rnc); +static inline bool sci_remote_node_context_is_being_destroyed( + struct sci_remote_node_context *sci_rnc) +{ + return ((sci_rnc->sm.current_state_id == SCI_RNC_INVALIDATING) + && (sci_rnc->destination_state == RNC_DEST_FINAL)) + || (sci_rnc->sm.current_state_id == SCI_RNC_INITIAL); +} #endif /* _SCIC_SDS_REMOTE_NODE_CONTEXT_H_ */ -- cgit v1.2.3-55-g7522