Skip to content

Commit 034c179

Browse files
Yihang Ligregkh
authored andcommitted
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
[ Upstream commit e4d953c ] In commit 21c7e97 ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure"), if the softreset fails upon certain conditions, the PHY connected to the disk is disabled directly. Manual recovery is required, which is inconvenient for users in actual use. In addition, SATA disks do not support simultaneous connection of multiple hosts. Therefore, when multiple controllers are connected to a SATA disk at the same time, the controller which is connected later failed to issue an ATA softreset to the SATA disk. As a result, the PHY associated with the disk is disabled and cannot be automatically recovered. Now that, we will not focus on the execution result of softreset. No matter whether the execution is successful or not, we will directly carry out I_T_nexus_reset. Fixes: 21c7e97 ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure") Signed-off-by: Yihang Li <liyihang9@huawei.com> Link: https://lore.kernel.org/r/20250414080845.1220997-4-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0e7792a commit 034c179

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,33 +1850,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
18501850
}
18511851
hisi_sas_dereg_device(hisi_hba, device);
18521852

1853-
rc = hisi_sas_debug_I_T_nexus_reset(device);
1854-
if (rc == TMF_RESP_FUNC_COMPLETE && dev_is_sata(device)) {
1855-
struct sas_phy *local_phy;
1856-
1853+
if (dev_is_sata(device)) {
18571854
rc = hisi_sas_softreset_ata_disk(device);
1858-
switch (rc) {
1859-
case -ECOMM:
1860-
rc = -ENODEV;
1861-
break;
1862-
case TMF_RESP_FUNC_FAILED:
1863-
case -EMSGSIZE:
1864-
case -EIO:
1865-
local_phy = sas_get_local_phy(device);
1866-
rc = sas_phy_enable(local_phy, 0);
1867-
if (!rc) {
1868-
local_phy->enabled = 0;
1869-
dev_err(dev, "Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n",
1870-
SAS_ADDR(device->sas_addr), rc);
1871-
rc = -ENODEV;
1872-
}
1873-
sas_put_local_phy(local_phy);
1874-
break;
1875-
default:
1876-
break;
1877-
}
1855+
if (rc == TMF_RESP_FUNC_FAILED)
1856+
dev_err(dev, "ata disk %016llx reset (%d)\n",
1857+
SAS_ADDR(device->sas_addr), rc);
18781858
}
18791859

1860+
rc = hisi_sas_debug_I_T_nexus_reset(device);
18801861
if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
18811862
hisi_sas_release_task(hisi_hba, device);
18821863

0 commit comments

Comments
 (0)