本文内容参考SATA3.3协议第15章节
15 Error Handling
15.1 Architecture
15.2 Phy error handling overview
There are three primary categories of error that the Phy layer detects internally:
a) no device present; // 对应SStatus register中DET值为0000b
b) OOB signaling sequence failure; and // 对应SStatus register中DET值为0001b
c) Phy internal error (loss of synchronization of communications link) // 对应SError register中ERR域中bit[E]表示为phy internal error
前2个错误都是存储在SStatus register里,第三个错误存储在SStatus register和SError register里。
协议14.2.2中可以查看SStatus register
协议14.2.3中可以查看SError register
ERR域各bit详细解释见协议手册
15.3 Link layer error handling overview
There are two primary categories of errors that the Link layer detects internally are:
a) invalid state transitions; and
b) data integrity errors.
Invalid state transition errors may arise from a number of sources and the Link layer responses to
many such error conditions as defined in clause 9. Data integrity errors generally arise from
noise in the physical interconnect.
第一个错误如果发生在frame传输给Phy的过程中,则在传输完SOF后,再传输个R_ERR;如果错误不是发生在frame传输过程中,则Link直接切换为idle状态,等待下一次操作。
15.4 Transport layer error handling
In addition to the error information passed to it by the Link layer, the Transport layer internally
detects the following categories of errors:
a) internal errors;
b) frame errors;
c) protocol errors; and
d) state errors.
传输层都会通知链路层所检测到的error(SStatus and SError registers里反映),链路层再通过每次frame传输完成后的R_ERR/R_OK来报告错误(不过R_ERR相较于D2B FIS不能指出错误的原因)。
15.5 Application layer error handling
There are three overall error detection mechanisms that software identifies and responds to
Serial ATA errors:
a) bad status in the Command Block Status register;
b) bad status in the SError register; and
c) command failed to complete (i.e., timeout).