Abstract:
A method of responding to a request for data over a bus structure, such as a SCSI bus. Upon receiving a request, a data storage device releases control of the bus and accumulates the requested data in a buffer. Before the data has been completely accumulated, the device acquires control of the bus and begins transmitting the data over the bus. The beginning of transmission occurs late enough that the transmission can occur in a single burst. If the data can be transmitted over the bus in a time period t burst , then the beginning of transmitting should begin substantially a t burst  period before the time at which the buffer completes accumulating the requested data.

Description:
This Application is a continuation of Ser. No. 08/164,899, filed Dec. 9, 1993, now abandoned. 
    
    
     FIELD OF THE INVENTION 
     The present invention pertains to the field of data storage devices. More specifically, it relates to a method for improving transmission of data from a target storage device to a host computer over a predetermined bus structure, such as SCSI. 
     BACKGROUND OF THE INVENTION 
     A computer can request information from a data storage device which is connected to the computer via a bus structure. When the target data storage device transfers information to the host as a series or sequence of DMA bursts as the data becomes available, the host sees a fast response time in receiving the entire transfer. However, bus efficiency may not be optimal, particularly if the bus transfer rate is greater than the rate at which the data is retrieved from the storage medium and becomes available for transfer over the bus by the storage device. Other devices wanting to use the bus structure must wait the entire time that the data is being retrieved and sent by sequential bursts by the storage device, rather than for a shorter transmission time when the data is sent in a single burst over the bus structure at its optimal bus transfer rate. 
     The Small Computer System Interface standard (SCSI) describes a bus structure that can be used in a multi-initiator, multi-target environment. To maximize bus efficiency, SCSI permits a target device, such as a data storage device, to disconnect from the SCSI bus while the target processes a time-consuming data access operation. Once the target is ready to continue data transfer to an initiator (host computer), the target device reconnects to the bus. 
     Thus, to optimize bus usage, a data storage device can disconnect from the bus, accumulate any requested data in its local buffer memory, reconnect to the bus, and then transmit the entire requested data in a single burst. However, the host must wait a longer time to receive the complete transfer of data. 
     The SCSI standard provides the buffer full/empty parameters in mode select page 02h to control how full a target&#39;s buffer memory may become before beginning to transmit over the bus. This protocol is intended to minimize the number of disconnects and reconnects required to complete a transfer, yet enable the target device to begin transmitting before the target&#39;s entire buffer capacity is full. However, these parameters are optimal for only a specific transfer length and buffer accumulation rate. 
     The buffer accumulation rate for a hard disk is related to read/write channel rates. Data is typically recorded as blocks or sectors in concentric data tracks on the disk storage surface. Inner tracks have smaller circumferences than outer tracks. At a constant disk rotation rate, inner tracks will store less data, and transfer data at a lower rate, than outer tracks. One commonly employed technique is to tailor data transfer rates and the number of data blocks or sectors to track radius. Frequently, bands of adjacent tracks are arranged as &#34;zones&#34; on the data storage surface. Transfer rate and the number of data sectors per track are held constant for all of the tracks of the particular zone. With this &#34;zoned data&#34; arrangement, data transfer performance otherwise decreases for different transfer lengths and zones on the disk. 
     A hitherto unsolved need has been for a method of responding to a request for data which maximizes efficiency of a bus, yet does not delay the response time as seen by the requester of the data. 
     SUMMARY OF THE INVENTION WITH OBJECTS 
     A general object of the present invention is to provide a method for improving transmission of data from a target storage device to a host computer over a predetermined bus structure, such as SCSI. 
     Another object of the present invention is to provide a method for responding to a request for data in a manner which maximizes efficiency of transfer over a bus structure such as SCSI without delay of response time as seen by the requester of the data. 
     According to the present invention, when a data storage device such as a hard disk drive, for example, receives a request for data from a host computer via a bus structure, the storage device releases control of the bus. The device then seeks to a destination location at which the requested data is stored and begins to accumulate the requested data in a buffer. The device then acquires control of the bus and transmits the accumulated data over the bus. To speed the response time as seen by the requester of the data, the data storage device begins transmitting before the data has been fully accumulated in its local buffer memory, but late enough such that the data can be transmitted to the requester in a single burst over the bus structure. That is, all of the requested data will have been accumulated in the buffer at the time the data storage device is transmitting it as a single burst. 
     As a feature of the present invention, the time at which an optimized burst transmission begins can be calculated. If the data can be transmitted over the bus in a time period t burst , then the beginning of transmission should occur substantially a t burst  period before the time at which the buffer completes accumulating the requested data, so that the processes of accumulation and transmission end at substantially the same moment. 
     According to another aspect of the invention, if the buffer is not large enough to accumulate all of the requested data, the data storage device releases control of the bus and begins to accumulate the requested data in a buffer to the capacity of the buffer. The device then acquires control of the bus and transmits the accumulated data over the bus. The beginning of transmission occurs before the buffer is completely filled but late enough such that the contents of the entire buffer can be transmitted in a single burst. The data storage device repeats the steps of releasing control of the bus, accumulating data, acquiring control of the bus, and transmitting data over the bus until all of the requested data has been transmitted to the requester. 
     As another feature of the invention, if the entire buffer can be transmitted over the bus in a time period t burst , then the beginning of transmission should occur substantially a t burst  period before the time at which the buffer completes accumulating the requested data. 
     The foregoing and additional objects, features and advantages of the present invention will be more readily apparent from the following detailed description of preferred embodiments thereof which proceed with reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     In the Drawings 
     FIG. 1 is a general block diagram of an exemplary Small Computer System Interface bus having a single host (SCSI initiator) and three peripheral units (SCSI targets). 
     FIG. 2 is a detailed block diagram of a target of FIG. 1. 
     FIG. 3 is a timing diagram of Read/Write Channel and Host Interface activity according to the present invention. 
     FIG. 4 is a table of precalculated values used in the method of the present invention. 
     FIG. 5 is a flowchart for a routine for calculating buffer ratio in accordance with principles of the present invention. 
     FIG. 6 is a flowchart for a routine for calculating reconnect level in accordance with principles of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring to FIG. 1, a computer 10 is connected to a host adapter 14 via its internal system bus 12. The host adapter enables the computer to connect to a Small Computer System Interface (SCSI) bus 16. The host adapter 14, as controlled by the computer 10, acts as a SCSI &#34;initiator.&#34; That is, the host adapter requests &#34;targets&#34; on the SCSI bus to perform operations. 
     A tape drive 20, a disk drive 24, and a printer 28 are connected to the SCSI bus 16 by way of respective embedded controllers 18, 22, 26. These devices are targets on the SCSI bus and perform operations as requested by the host adapter 14. 
     Referring now to FIG. 2, a typical disk drive embedded controller 22 includes a SCSI interface integrated circuit (IC) 40. The SCSI interface IC takes commands, data, and messages from the SCSI bus and processes them. Data to be stored on the disk drive 24 is stored in a buffer and converted to a serial stream by a serializer 44a. Error correction codes are added to the serial stream by an ECC create circuit 46a. The resulting binary stream is encoded by an encoder 48a and stored on the disk drive 24. 
     Data retrieved from the disk 24 goes through the above-described process in reverse. The retrieved data is decoded by a decoder 48b and phase-lock-loop circuit 50. An ECC check circuit 46b detects and corrects errors and sends the resulting serial stream to a deserializer 44b. The resulting bytes are stored in the buffer 42. The SCSI interface IC 40 sends the bytes in the buffer 42 to the host computer 10 by way of the SCSI bus 16. 
     A microprocessor 52 controls the operation of the SCSI interface IC 40. The microprocessor controls whether and when the SCSI interface IC process commands, messages, and data from the host computer 10. 
     Referring now to FIG. 3, the top row (a) shows a string of ten blocks 60a-60j read from the disk drive 24 over the read/write channel to the buffer 42. The gaps 62a-62i between the blocks represents times during which the read/write channel is idle because the read/write head is passing over sector overhead information which may include sector headers as well as embedded sector head positioning servo information. 
     In an exemplary hard drive, each block contains 512 bytes of data. If the read/write channel transfers data at four Megabytes per seconds (MB/s), then the time 64 for the transfer of each block 60a-60j takes 128 microseconds (s). Taking into account an exemplary gap time of 25 s, the effective read/write channel rate is 3.35 MB/s. The second row (b) shows respective transfers of the blocks 68a-68j from the buffer 42 over the SCSI bus 16 to the host adapter 14. Each transfer from the buffer occurs as soon as it has been transferred to the buffer over the read/write channel. Thus, transfer of block 68c over the SCSI bus occurs immediately after transfer of block 60c over the read/write channel. The transfer of the last block 68j ends at time T n . 
     If the SCSI bus transfers data at 10 MB/s, the time 70 for the transfer of each block takes approximately 51 s. There is thus an approximately 102 s long gap 74a-74i between each block. 
     To ensure that each transfer 68a-68j over the SCSI bus can occur as soon as the data is in the buffer 42, the transfer would have to be non-disconnecting. Otherwise, other target devices on the SCSI bus may take control of the bus, delaying transfer of the information. 
     The SCSI bus 16 is used with maximum efficiency when a disk drive transfers requested data in a single burst. Furthermore, according to the present invention, a target disk drive can complete the sending of data over the SCSI bus 16 in the same amount of time as a non-disconnecting operation. 
     According to the present invention, the embedded controller 22 of the drive 24 remains disconnected from the SCSI bus 16 as long as possible, yet still finish the data transfer at time T n . Referring now to row (c) of FIG. 3, the entire transfer is accumulated in the buffer 42 and transferred over the SCSI bus 16 in one burst 80. 
     The time required to transfer the burst, T burst , may be calculated from the requested transfer length xfer --  len contained in the SCSI Command Descriptor Block (CDB) and the host transfer rate, host --  rate, as shown in equation (1). The host transfer rate is negotiated between hosts and targets on a SCSI bus after power-on, with the Synchronous Device Transfer Request (SDTR) message. ##EQU1## 
     The time at which the burst begins, time T reconnect , is calculated such that the end of the burst 80 occurs at time T n . However, once the controller 22 of the target drive 24 has disconnected from the SCSI bus 16, it must reconnect before sending data. Thus, some additional time, T host , is allocated to enable the host to respond to reselection and ensure that data transfer can begin sending at time T reconnect . 
     This amount of additional time T host  can depend on a number of factors and may not be exactly known. If the time T host  is selected to be too short, then the end of the transfer T n  to the host will be delayed by the amount of the error. However, if the time T host  is selected to be too long, then the buffer 42 will not contain data when the SCSI interface IC 40 is ready to send it over the bus. In an exemplary target drive 24, a time T host  of 100 s is used. 
     The time T reconnect  can be calculated according to equation (2). ##EQU2## 
     As shown by equation (2), the controller 22 of the drive 24 can calculate the optimal reconnect time from the transfer length xfer --  len, the channel transfer rate channel --  rate, and the host transfer rate host --  rate. However, most disk drives do not have a dedicated timer to interrupt the microprocessor 52 at time T reconnect . It may be easier to calculate the number of bytes in the buffer 42 at T reconnect  and use that &#34;count&#34; to indicate time T reconnect . 
     
         count= T.sub.connect -T.sub.0 !·channel.sub.-- rate(3) 
    
     Substituting the right side of equation (2) into equation (3) yields equation (4). ##EQU3## product of the T host  and channel --  rate provides a margin, in bytes, for the host computer to respond to reselection. These &#34;fudge --  bytes&#34; are constant, and may be moved outside the parenthesis to simplify the formula. ##EQU4## Equation (5) may then be simplified, as shown in equation (6). ##EQU5## Equation (6) may also be expressed as a high water mark count, in which channel --  rate/host --  rate represents buffer --  ratio, as follows: 
     
         count=xfel.sub.--  len· 1-buffer.sub.-- ratio! -fudge.sub.-- bytes(7) 
    
     To minimize the amount of calculations that must be performed, a table of  1--channel --  ratelhost --  rate! values preferably is constructed, with an entry for each zone on the disk. The table is updated whenever a new host --  rate is negotiated with a SDTR message. The arrival of a read command triggers the calculation of optimal reconnect, and requires only a table lookup, one multiplication, and one subtraction. These operations may be overlapped with a seek or rotational latency operation. 
     Referring now to FIG. 4, a table of  1- channel --  rate/host --  rate! ratios is provided for an exemplary disk rotating at e.g. 5400 revolutions per minute (RPM). Each sector contains a single block of 512 bytes. To optimize storage on the drive, different concentric zones on the disk have a different number of sectors per track, depending upon zone radius. The first and second columns contain the zone number and number of sectors per track, respectively. The third and fourth columns show the amount of time required for the disk 24 to rotate a single sector past a read/write head and the resulting channel rate. The last two columns show the  1- channel --  rate/host --  rate! values for host rates of 5 MB/s and 10 MB/s, respectively. 
     In the usual case, the transfer length xfer --  len is a power of 2, that is 512, 2048, or 8192. In such a case, the multiplication in equation (6) is simply a binary shift left operation. 
     The present invention has been described such that the buffer 42 is large enough to contain the entire length of a transfer. If the transfer length is larger than can be contained in the buffer, the present invention may still be used advantageously by using the buffer size in place of the transfer length xfer --  len in the above calculations. In such a case, more than one burst will be required to complete the transfer. 
     Referring now to FIG. 5, a buffer ratio formula 82 (Equation 7) is calculated by the microprocessor 52 following arrival of a read command from the host computer adapter 14 via the SCSI bus 16. This calculation is preferably carried out while a head positioning servo loop is repositioning the selected data transducer head to a destination track during a track seeking operation. During the FIG. 5 routine 82, a step 84 obtains the zone number of the zone including the destination track location. A step 86 then obtains the indexed zone&#39;s channel --  sector time, e.g. by reference to appropriate data in FIG. 4. A step 88 obtains the host --  ID number which identifies the host adapter 14. A step 90 then determines the host --  ID indexed host --  sector time, also preferably as a table lookup. A logical node 92 then determines if the host --  sector time is greater than the channel --  sector time. If so, a process step 94 sets the current --  buffer ratio to a null value (00). If not, a process step 96 then determines the current --  buffer ratio as 1--host --  sector time/disk --  sector time. After this determination, a return is made at an exit node 98. 
     Referring now to FIG. 6, a reconnect level formula 100 is calculated by the microprocessor 52 at the reconnect time. This formula 100 includes a logical node 102 which determines whether the transfer --  length is greater than the buffer --  size. If so, a process step 104 sets a value A to equal the buffer --  size. If not, a process step 106 sets the value A to be equal to the transfer length xfer --  len. A process step 108 then determines a reconnect level as equal to A·current --  buffer ratio which was determined at steps 94 or 96 during seek time as explained in connection with FIG. 5. After the reconnect level is calculated, a return is made at an exit node 110. 
     In this manner, the reconnect and transmission from buffer steps will take approximately the same amount of time as is required to obtain all of the data from the data storage disk, so that the steps of accumulating the data in the buffer and transmitting the data from the buffer to the host or initiator will end approximately at the same time, thereby realizing an optimal reconnect process. While the present invention has been described in terms of the SCSI bus standard, it will be recognized by those skilled in the art that the invention has utility for other data busses as well. 
     The terms and expressions that have been employed in the foregoing specification are used therein as terms of description and not of limitation, and there is no intention, in the use of such terms and expressions, of excluding equivalents of the features shown and described or portions thereof, it being recognized the scope of the invention is defined and limited only by the claims that follow.