public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: chenxiang <chenxiang66@hisilicon.com>,
	jejb@linux.vnet.ibm.com, martin.petersen@oracle.com
Cc: linuxarm@huawei.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: hisi_sas: Handle the NCQ error returned by D2H frame
Date: Mon, 1 Apr 2024 16:10:10 +0900	[thread overview]
Message-ID: <415f65a7-ffaf-42a2-a1b5-6182ccc3c3cd@kernel.org> (raw)
In-Reply-To: <20240401054914.721093-2-chenxiang66@hisilicon.com>

On 4/1/24 14:49, chenxiang wrote:
> From: Xingui Yang <yangxingui@huawei.com>
> 
> 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@huawei.com>
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---
>  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...

> +				sas_dev->dev_status = HISI_SAS_DEV_NCQ_ERR;
> +				slot->abort = 1;
> +			} else
> +				ts->stat = SAS_PROTO_RESPONSE;

Missing the curly brackets here.

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

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-04-01  7:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01  5:49 [PATCH 0/2] Some small fixes for hisi_sas chenxiang
2024-04-01  5:49 ` [PATCH 1/2] scsi: hisi_sas: Handle the NCQ error returned by D2H frame chenxiang
2024-04-01  7:10   ` Damien Le Moal [this message]
2024-04-02  1:10     ` chenxiang (M)
2024-04-01  5:49 ` [PATCH 2/2] scsi: hisi_sas: Modify the deadline for ata_wait_after_reset() chenxiang
2024-04-01  7:08   ` Damien Le Moal
2024-04-02  1:51     ` chenxiang (M)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=415f65a7-ffaf-42a2-a1b5-6182ccc3c3cd@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox