From: John Garry <john.garry@huawei.com>
To: <jejb@linux.ibm.com>, <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, John Garry <john.garry@huawei.com>
Subject: [PATCH 2/3] scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset
Date: Thu, 12 May 2022 19:15:33 +0800 [thread overview]
Message-ID: <1652354134-171343-3-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1652354134-171343-1-git-send-email-john.garry@huawei.com>
We have seen errors like this when a SATA device is probed:
[524.566298] hisi_sas_v3_hw 0000L74:02.0: erroneous completion iptt=4096 ...
[524.582827] sas: TMF task open reject failed 500e004aaaaaaaa00
Since commit 21c7e972475e ("scsi: hisi_sas: Disable SATA disk phy for
severe I_T nexus reset failure"), we issue an ATA softreset to disks after
a phy reset to ensure that they are in sound working order. If the
softreset is issued before the remote phy has come back up then the
softreset will fail (errors as above). Remedy this by waiting for the
phy to come back up after the reset.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com>
Tested-by: Yihang Li <liyihang6@hisilicon.com>
---
drivers/scsi/hisi_sas/hisi_sas_main.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 4bda2f6cb352..997f27e2f1e5 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1710,13 +1710,18 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)
/* report PHY down if timed out */
if (rc == -ETIMEDOUT)
hisi_sas_phy_down(hisi_hba, sas_phy->id, 0, GFP_KERNEL);
- } else if (sas_dev->dev_status != HISI_SAS_DEV_INIT) {
- /*
- * If in init state, we rely on caller to wait for link to be
- * ready; otherwise, except phy reset is fail, delay.
- */
- if (!rc)
- msleep(2000);
+ return rc;
+ }
+
+ if (rc)
+ return rc;
+
+ /* Remote phy */
+ if (dev_is_sata(device)) {
+ rc = sas_ata_wait_after_reset(device,
+ HISI_SAS_WAIT_PHYUP_TIMEOUT);
+ } else {
+ msleep(2000);
}
return rc;
--
2.26.2
next prev parent reply other threads:[~2022-05-12 11:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 11:15 [PATCH 0/3] hisi_sas: A device rescan and IT nexus reset fix John Garry
2022-05-12 11:15 ` [PATCH 1/3] scsi: libsas: Refactor sas_ata_hard_reset() John Garry
2022-05-12 11:15 ` John Garry [this message]
2022-05-12 11:15 ` [PATCH 3/3] scsi: hisi_sas: Fix rescan after deleting a disk John Garry
2022-05-17 1:51 ` [PATCH 0/3] hisi_sas: A device rescan and IT nexus reset fix Martin K. Petersen
2022-05-20 1:09 ` Martin K. Petersen
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=1652354134-171343-3-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®