提交 bea163a4 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

Revert "scsi: hisi_sas: fix bug of LM fail to add list which caused by IO...

Revert "scsi: hisi_sas: fix bug of LM fail to add list which caused by IO release when receive underflow cq"

hulk inclusion
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------------------------------

Revert this patch to avoid booting fail on D06 with SATA disks.

This reverts commit 07bfef64b24b2b99f67fc52175840fb6c97d93dd.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 90820fd6
...@@ -420,13 +420,6 @@ struct hisi_sas_err_record_v3 { ...@@ -420,13 +420,6 @@ struct hisi_sas_err_record_v3 {
#define PCI_IRQ_AXI_FATAL 11 #define PCI_IRQ_AXI_FATAL 11
#define PCI_IRQ_CQ_BASE HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW #define PCI_IRQ_CQ_BASE HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW
#define HISI_SAS_IS_RW_CMD(op) \
((op == READ_6) || (op == WRITE_6) || \
(op == READ_10) || (op == WRITE_10) || \
(op == READ_12) || (op == WRITE_12) || \
(op == READ_16) || (op == WRITE_16) || \
(op == READ_32) || (op == WRITE_32))
static bool hisi_sas_intr_conv; static bool hisi_sas_intr_conv;
MODULE_PARM_DESC(intr_conv, "interrupt converge on or off:0 or 1(def=0)"); MODULE_PARM_DESC(intr_conv, "interrupt converge on or off:0 or 1(def=0)");
...@@ -1164,17 +1157,6 @@ static void hisi_sas_fill_prot_v3_hw(struct scsi_cmnd *scsi_cmnd, ...@@ -1164,17 +1157,6 @@ static void hisi_sas_fill_prot_v3_hw(struct scsi_cmnd *scsi_cmnd,
prot->dw0 |= INCR_LBRT_MSK; prot->dw0 |= INCR_LBRT_MSK;
} }
static u32 set_hdr_vdtl(u8 *cmnd)
{
u32 res;
if (!HISI_SAS_IS_RW_CMD(cmnd[0]))
res = 0 << CMD_HDR_VDTL_OFF;
else
res = 1 << CMD_HDR_VDTL_OFF;
return res;
}
static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba, static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot) struct hisi_sas_slot *slot)
{ {
...@@ -1196,11 +1178,11 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba, ...@@ -1196,11 +1178,11 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
(priority << CMD_HDR_PRIORITY_OFF) | (priority << CMD_HDR_PRIORITY_OFF) |
(1 << CMD_HDR_CMD_OFF)); /* ssp */ (1 << CMD_HDR_CMD_OFF)); /* ssp */
dw1 = 1 << CMD_HDR_VDTL_OFF;
if (tmf) { if (tmf) {
dw1 |= 2 << CMD_HDR_FRAME_TYPE_OFF; /* task frame */ dw1 |= 2 << CMD_HDR_FRAME_TYPE_OFF; /* task frame */
dw1 |= DIR_NO_DATA << CMD_HDR_DIR_OFF; dw1 |= DIR_NO_DATA << CMD_HDR_DIR_OFF;
} else { } else {
dw1 = set_hdr_vdtl(&scsi_cmnd->cmnd[0]);
dw1 |= 1 << CMD_HDR_FRAME_TYPE_OFF; dw1 |= 1 << CMD_HDR_FRAME_TYPE_OFF;
switch (scsi_cmnd->sc_data_direction) { switch (scsi_cmnd->sc_data_direction) {
case DMA_TO_DEVICE: case DMA_TO_DEVICE:
...@@ -1944,10 +1926,17 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task, ...@@ -1944,10 +1926,17 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
hisi_hba->complete_hdr[slot->cmplt_queue]; hisi_hba->complete_hdr[slot->cmplt_queue];
struct hisi_sas_complete_v3_hdr *complete_hdr = struct hisi_sas_complete_v3_hdr *complete_hdr =
&complete_queue[slot->cmplt_queue_slot]; &complete_queue[slot->cmplt_queue_slot];
struct hisi_sas_err_record_v3 *record =
hisi_sas_status_buf_addr_mem(slot);
u32 dma_rx_err_type = record->dma_rx_err_type;
u32 trans_tx_fail_type = record->trans_tx_fail_type;
switch (task->task_proto) { switch (task->task_proto) {
case SAS_PROTOCOL_SSP: case SAS_PROTOCOL_SSP:
if (complete_hdr->dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) { if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
ts->residual = trans_tx_fail_type;
ts->stat = SAS_DATA_UNDERRUN;
} else if (complete_hdr->dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) {
ts->stat = SAS_QUEUE_FULL; ts->stat = SAS_QUEUE_FULL;
slot->abort = 1; slot->abort = 1;
} else { } else {
...@@ -1958,7 +1947,10 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task, ...@@ -1958,7 +1947,10 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
case SAS_PROTOCOL_SATA: case SAS_PROTOCOL_SATA:
case SAS_PROTOCOL_STP: case SAS_PROTOCOL_STP:
case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP: case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
if (complete_hdr->dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) { if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
ts->residual = trans_tx_fail_type;
ts->stat = SAS_DATA_UNDERRUN;
} else if (complete_hdr->dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) {
ts->stat = SAS_PHY_DOWN; ts->stat = SAS_PHY_DOWN;
slot->abort = 1; slot->abort = 1;
} else { } else {
...@@ -2054,13 +2046,6 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2054,13 +2046,6 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
complete_hdr->act, complete_hdr->dw3, complete_hdr->act, complete_hdr->dw3,
error_info[0], error_info[1], error_info[0], error_info[1],
error_info[2], error_info[3]); error_info[2], error_info[3]);
if (error_info[3] & RX_DATA_LEN_UNDERFLOW_MSK) {
u32 *tmp_err = hisi_sas_status_buf_addr_mem(slot) +
sizeof(struct hisi_sas_err_record);
dev_info(dev, "underflow, sensekey:0x%x, code:0x%x.\n",
((*(tmp_err + 6)) & 0xff0000) >> 16,
((*(tmp_err + 9)) & 0xff));
}
if (unlikely(slot->abort)) if (unlikely(slot->abort))
return ts->stat; return ts->stat;
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册