Abstract:
A method for minimizing the loss of data within a data buffer of a peripheral device connected to a host computer upon detection of an error. The peripheral device detects the error condition and terminates the presently executing command. The peripheral device suspends internal operations upon detection of the error and notifies the host computer of the suspension of operations. Operations may continue when the host computer issues a priority abort command to the peripheral device to remove it from the suspended state.

Description:
This application is a continuation of application Ser. No. 07/990,271 filed on Dec. 14, 1992, now abandoned. 
    
    
     TECHNICAL FIELD 
     This invention relates to peripheral devices, and more specifically, to a method for suspending internal operations of the peripheral device when a command error is detected by the peripheral device. 
     BACKGROUND OF THE INVENTION 
     During operations of a host computer and a peripheral device, error conditions arise between the host computer and the peripheral device. When this error condition occurs, there is a possibility that user data, typically stored in a data buffer, will be lost if operations are continued during the error condition. Previous methods of dealing with this problem have focused on correcting the error within the host computer. 
     The intelligent peripheral interface [IPI] device generic command for magnetic and optical disc drives, otherwise identified as ANSI X3.132-1987, defines a sequence known as command chaining. The purpose of command chaining is to protect user data in a data buffer when an error condition is detected by a peripheral recording device. 
     The command chaining sequence enables a host computer to logically link a series of commands. Thus, when a command in the chain is unsuccessful, the next command cannot be executed. This causes the command chain to terminate and the remaining commands in the chain are not executed. The termination of the command chain prevents the execution of the next command in the command queue allowing the host computer to initiate an error recovery algorithm for the unsuccessful command. 
     The command chaining sequence places the responsibility on the host computer to logically link the series of commands and to incorporate an error recovery algorithm for any terminated commands. This method puts additional burdens on the host computer by forcing it to maintain the processing capability to logically link the command strings and to store the error recovery algorithm. 
     Thus, a need has arisen for a method for preventing the loss of user data from the buffers of a peripheral recording device when an error is detected by the peripheral device; where the method does not require additional processing capabilities of the host computer to be used. 
     SUMMARY OF THE INVENTION 
     The present invention overcomes the foregoing and other associated problems by using a suspended state condition for the peripheral device. The method protects information within the data buffer of a peripheral device connected to a host computer. When such an error is detected, the command causing the error is terminated and all internal operations of the peripheral device are suspended. After the suspension of operations within the peripheral device, the host computer is notified of the occurrence of the error and of the suspended state condition of the peripheral device. Information may then be recovered from the data buffers of the peripheral device and a command issued by the host computer discontinuing the suspension of operations in the peripheral device. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the present invention and the advantages thereof, reference is now made to the following detailed description taken in conjunction with the accompanying drawings in which: 
     FIG. 1 is a block diagram of a system utilizing the suspended state of the present invention; 
     FIG. 2 is a flow chart illustrating the operation of the suspended state for a write command error; and 
     FIG. 3 is a flow chart illustrating the operation of the suspended state for a read command error. 
     FIG. 4 is a flow chart illustrating the operation of the suspended state for the detection of a non-data error or a boundary condition. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring now to the drawings and more particularly to FIG. 1, there is shown a block diagram of a system for completing the suspended state operation of the present invention. Data is transferred during read and write operations over a data bus 2 passing between a peripheral device 4 and a host computer 6. The peripheral device 4 contains a data buffer 8 and a command queue 10. The data buffer 8 stores the data received or sent over the data bus 2. The data buffer 8 contains the data protected by the suspended state operation of the present invention. The command queue 10 contains a list of commands controlling the read and write operations of the peripheral device 4. 
     There are several types of errors which cause the peripheral device 4 to enter the suspended state. One of these is an error occurring during a write command as will be described with reference to FIG. 2. With reference to FIG. 2, the peripheral device 4 attempts to write a block of data from the data buffer 8 to the recording media at step 12. If the inquiry step 14 determines that the block of data was successfully written to the recording media, the peripheral device 4 then returns to step 12 and writes the next block of data from the data buffer to the recording media. If the write operation was not successful, the peripheral device 4 determines whether another write operation is required at inquiry step 16. 
     If the peripheral device 4 is not required to attempt another write operation for the block of data, it returns to step 12 and attempts to write the next block of data. Otherwise, the peripheral device 4 attempts to rewrite the previous block of data at step 18. A further inquiry at step 20 determines if the rewrite was successful. If so, the peripheral device 4 returns to step 12. If the rewrite was unsuccessful, the present write retry is checked at retry count inquiry step 22. If the retry count is not equal to zero, the write retry count is decremented by one at step 24 and the peripheral device 4 attempts another write operation on the block of data at step 18. When the write retry count of step 22 equals zero, the peripheral device 4 terminates the write command at step 26 and declares a permanent write error at step 28. 
     The peripheral device 4 then suspends internal operation at step 30. The suspension of operations by the peripheral device 4 prevents the execution of the next command in the command queue 10 and protects the integrity of data in the data buffer 8. Next, the peripheral device 4 sets, at step 31, the machine exception status parameter to indicate the existence of a write error and the suspended state condition of the peripheral device. The peripheral device 4 then notifies the host computer 6 of the write error and its suspended state status by a machine exception status parameter at step 32. The machine exception status parameter is a data parameter to inform the host computer 6 of a condition causing the peripheral device 4 to terminate a command. 
     The peripheral device 4 remains in the suspended state and makes an inquiry at step 34 to determine if the host computer 6 has issued a priority abort command. The priority abort command terminates all queued commands within the peripheral device 4 and removes the device from the suspended state at step 36. The peripheral device 4 will return to active status and carry out the next command it receives. If a priority abort command has not been issued, the peripheral device remains in the suspended state and continues to monitor for a priority abort command at step 34. 
     It should be noted that the peripheral device 4 may also be removed from the suspended state by issuing a slave reset, a logical interface reset or a recording device reset command. However, these commands will invalidate all data in the data buffer 8. Thus, when data integrity must be preserved, the priority abort command is used. 
     The peripheral device 4 may also enter the suspended state due to an error occurring during a read operation as described in FIG. 3. Referring to FIG. 3, the peripheral device 4 attempts to read a block of data from the recording media at step 40. If it is determined at step 42 that the data block was successfully read, the peripheral device 4 returns to step 40 to read the next block of data from the recording media. If the read operation is unsuccessful, the peripheral device 4 makes an inquiry at step 44 to determine if the read retry count is equal to zero. 
     If the read retry count is not equal to zero, the count is decremented by one at step 46 and the peripheral device 4 attempts to re-read the block at step 48. If the read retry count is equal to zero, the read command is terminated at step 50 and a permanent read error is declared at step 52. 
     The peripheral device 4 next suspends internal operation at step 54. The suspension of operations by the peripheral device 4 prevents the execution of the next command in the command queue 10 and protects the integrity of the data in the buffer 8. The machine exception status parameter is set at step 55 to indicate the existence of a read error and the suspended state of the peripheral device. The peripheral device 4 notifies the host computer 6 of the permanent read error and its suspended state status by transmission of a machine exception status parameter at step 56. 
     The peripheral device 4 remains in the suspended state and makes an inquiry at step 58 to determine if the host computer 6 has issued a priority abort command. The priority abort command terminates all commands in the command queue 10 of the peripheral device 4 and removes the device from the suspended state at step 60. The peripheral device 4 then returns to active status to carry out the next command it receives. If a priority abort command has not been issued, the peripheral device 4 remains in the suspended state and continues to monitor for a priority abort command at step 58. As mentioned before, the slave reset, the logical interface reset and the recording device reset command may also remove the peripheral device from the suspended state. 
     Referring now to FIG. 4, the peripheral device 4 will enter the suspended state condition when a non-data error or a boundary condition is detected. When a non-data error or a boundary condition is detected at step 70, the presently executing command terminates at step 72 and the peripheral device 4 suspends all internal operations at step 74. The machine exception status parameter is set at step 76 to identify the error and identify that the peripheral device 4 has entered the suspended state. At step 78, the host computer 6 is informed of the condition of the peripheral device 4 by the machine exception status parameter. If the peripheral device 4 determines at inquiry step 80 that a priority abort command has been received, the device is removed from the suspended state at step 82. Otherwise, the peripheral device 4 continues to monitor at step 80 for a priority abort command. 
     Although a preferred embodiment of the invention has been illustrated in the accompanying drawings and described in the foregoing Detailed Description, it will be understood that the invention is not limited to the embodiment disclosed, but is capable of numerous rearrangements and modifications of parts and elements without departing from the spirit of the invention.