SCSI contingent allegiance condition

On a computer SCSI connection, a contingent allegiance condition occurs while a SCSI device reports an error.

SCSI communication takes place between an initiator and a target. The initiator sends a command to the target which then responds. At the end of the command the target returns a Status Code byte which is usually 00h for success, 02h for a Check Condition (error), or 08h for busy.

When the target returns a Check Condition in response to a command, the initiator usually then issues a SCSI Request Sense command in order to obtain more information. During the time between the reporting of a Check Condition and the issuing of the Request Sense command, the target is in the special state called the contingent allegiance condition.

Details
While a target is in a contingent allegiance condition it must retain the sense information that relates to the error that caused it to enter that condition. This can be a complex issue in configurations which contain more than one initiator. A well-designed target may be able to maintain sense data for one initiator while servicing commands from another initiator. If a check condition then needs to be reported to a second or third initiator then this may become prohibitively difficult. The SCSI definition of the contingent allegiance condition allows the target to use the busy response to incoming commands and to suspend servicing of any recent commands that are still in its execution queue.

The events that can cause a target to enter the contingent allegiance condition are
 * Target responds to a SCSI command with a check condition 02h
 * Target responds to a SCSI command with command terminated 22h
 * An unexpected disconnect

The events that can cause a target to exit the contingent allegiance condition are
 * Target receives a hard reset
 * Target receives an abort message
 * Target receives a bus device reset message
 * Target receives any command from the relevant initiator

Extended contingent allegiance condition
When the target needs to perform a long error-recovery procedure (typically one that lasts more than one second) it can enter the extended contingent allegiance condition. This may be necessary in high performance systems or in cases where there is a danger that initiator may reset the target after a short timeout interval, thereby aborting the error-recovery procedure. As in the contingent allegiance condition, the target is allowed to use the busy response to incoming commands and to suspend servicing of any recent commands that are still in its execution queue.

When a target enters the extended contingent allegiance condition it will send an Initiate Recovery message to the initiator.

The SCSI events that can cause a target to exit the extended contingent allegiance condition are
 * Target receives a Bus Device Reset
 * Target receives a hard reset
 * Target receives a Release Recovery message from the relevant initiator