Re: [PATCH 1/2] scsi: hisi_sas: Handle the NCQ error returned by D2H frame

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Damien,


在 2024/4/1 星期一 15:10, Damien Le Moal 写道:
On 4/1/24 14:49, chenxiang wrote:
From: Xingui Yang <yangxingui@xxxxxxxxxx>

We find that some disks use D2H frame instead of SDB frame to return NCQ
error. Currently, only the I/O corresponding to the D2H frame is processed
in this scenario, which does not meet the processing requirements of the
NCQ error scenario.
So we set dev_status to HISI_SAS_DEV_NCQ_ERR and abort all I/Os of the disk
in this scenario.

Signed-off-by: Xingui Yang <yangxingui@xxxxxxxxxx>
Signed-off-by: Xiang Chen <chenxiang66@xxxxxxxxxxxxx>
---
  drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 7d2a33514538..3935fa6bc72b 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -2244,7 +2244,14 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
  	case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
  		if ((dw0 & CMPLT_HDR_RSPNS_XFRD_MSK) &&
  		    (sipc_rx_err_type & RX_FIS_STATUS_ERR_MSK)) {
-			ts->stat = SAS_PROTO_RESPONSE;
+			if (task->ata_task.use_ncq) {
+				struct domain_device *device = task->dev;> +				struct hisi_sas_device *sas_dev =
+						device->lldd_dev;
Missing blank line after the declaration. And why the line split for the above
declaration ? That fits in 80 chars line...

Will change it in next version.


+				sas_dev->dev_status = HISI_SAS_DEV_NCQ_ERR;
+				slot->abort = 1;
+			} else
+				ts->stat = SAS_PROTO_RESPONSE;
Missing the curly brackets here.


Will change it in next version.


  		} else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
  			ts->residual = trans_tx_fail_type;
  			ts->stat = SAS_DATA_UNDERRUN;





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux