mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yihang Li <liyihang9@huawei.com>
To: <martin.petersen@oracle.com>, <James.Bottomley@HansenPartnership.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <liyihang9@huawei.com>,
	<liuyonglong@huawei.com>, <prime.zeng@hisilicon.com>
Subject: [PATCH v3 4/4] scsi: hisi_sas: Wait until eh is recovered
Date: Mon, 14 Apr 2025 16:08:45 +0800	[thread overview]
Message-ID: <20250414080845.1220997-5-liyihang9@huawei.com> (raw)
In-Reply-To: <20250414080845.1220997-1-liyihang9@huawei.com>

SATA devices are lost when FLR is performed while the controller and disks
are in suspended state.

This is because the libata layer is called to initialize the SATA device
during controller resuming. If FLR is executed at this time, the IDENTIFY
command fails. As a result, the revalidate fails, and the SATA device is
disabled by the libata layer.

So, wait until eh is recovered.

Signed-off-by: Yihang Li <liyihang9@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 15f1d5d783cb..d7a5522890a3 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -5100,9 +5100,11 @@ static void hisi_sas_reset_prepare_v3_hw(struct pci_dev *pdev)
 {
 	struct sas_ha_struct *sha = pci_get_drvdata(pdev);
 	struct hisi_hba *hisi_hba = sha->lldd_ha;
+	struct Scsi_Host *shost = hisi_hba->shost;
 	struct device *dev = hisi_hba->dev;
 	int rc;
 
+	wait_event(shost->host_wait, !scsi_host_in_recovery(shost));
 	dev_info(dev, "FLR prepare\n");
 	down(&hisi_hba->sem);
 	set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
-- 
2.33.0


  parent reply	other threads:[~2025-04-14  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14  8:08 [PATCH v3 0/4] hisi_sas: Misc patches and cleanups Yihang Li
2025-04-14  8:08 ` [PATCH v3 1/4] scsi: hisi_sas: Use macro instead of magic number Yihang Li
2025-04-14  8:08 ` [PATCH v3 2/4] scsi: hisi_sas: Code style cleanup Yihang Li
2025-04-14  8:08 ` [PATCH v3 3/4] scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk Yihang Li
2025-04-14  8:08 ` Yihang Li [this message]
2025-04-22  1:55 ` [PATCH v3 0/4] hisi_sas: Misc patches and cleanups Martin K. Petersen
2025-04-29  2:08 ` 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=20250414080845.1220997-5-liyihang9@huawei.com \
    --to=liyihang9@huawei.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=prime.zeng@hisilicon.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®