Skip to content

Commit 7e15334

Browse files
Xingui Yangmartinkpetersen
authored andcommitted
scsi: hisi_sas: Modify v3 HW SATA completion error processing
If the I/O completion response frame returned by the target device has been written to the host memory and the err bit in the status field of the received fis is 1, ts->stat should set to SAS_PROTO_RESPONSE, and this will let EH analyze and further determine cause of failure. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xingui Yang <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f090209 commit 7e15334

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ struct hisi_sas_err_record_v3 {
481481
#define RX_DATA_LEN_UNDERFLOW_OFF 6
482482
#define RX_DATA_LEN_UNDERFLOW_MSK (1 << RX_DATA_LEN_UNDERFLOW_OFF)
483483

484+
#define RX_FIS_STATUS_ERR_OFF 0
485+
#define RX_FIS_STATUS_ERR_MSK (1 << RX_FIS_STATUS_ERR_OFF)
486+
484487
#define HISI_SAS_COMMAND_ENTRIES_V3_HW 4096
485488
#define HISI_SAS_MSI_COUNT_V3_HW 32
486489

@@ -2161,6 +2164,7 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
21612164
hisi_sas_status_buf_addr_mem(slot);
21622165
u32 dma_rx_err_type = le32_to_cpu(record->dma_rx_err_type);
21632166
u32 trans_tx_fail_type = le32_to_cpu(record->trans_tx_fail_type);
2167+
u16 sipc_rx_err_type = le16_to_cpu(record->sipc_rx_err_type);
21642168
u32 dw3 = le32_to_cpu(complete_hdr->dw3);
21652169

21662170
switch (task->task_proto) {
@@ -2188,7 +2192,10 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
21882192
case SAS_PROTOCOL_SATA:
21892193
case SAS_PROTOCOL_STP:
21902194
case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
2191-
if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
2195+
if ((complete_hdr->dw0 & CMPLT_HDR_RSPNS_XFRD_MSK) &&
2196+
(sipc_rx_err_type & RX_FIS_STATUS_ERR_MSK)) {
2197+
ts->stat = SAS_PROTO_RESPONSE;
2198+
} else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
21922199
ts->residual = trans_tx_fail_type;
21932200
ts->stat = SAS_DATA_UNDERRUN;
21942201
} else if (dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) {

0 commit comments

Comments
 (0)