Skip to content

Commit f17f20e

Browse files
Yihang Lismb49
authored andcommitted
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
BugLink: https://bugs.launchpad.net/bugs/2119603 [ Upstream commit e4d953ca557e02edd3aed7390043e1b8ad1c9723 ] 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> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent c66358a commit f17f20e

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
@@ -1885,33 +1885,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
18851885
}
18861886
hisi_sas_dereg_device(hisi_hba, device);
18871887

1888-
rc = hisi_sas_debug_I_T_nexus_reset(device);
1889-
if (rc == TMF_RESP_FUNC_COMPLETE && dev_is_sata(device)) {
1890-
struct sas_phy *local_phy;
1891-
1888+
if (dev_is_sata(device)) {
18921889
rc = hisi_sas_softreset_ata_disk(device);
1893-
switch (rc) {
1894-
case -ECOMM:
1895-
rc = -ENODEV;
1896-
break;
1897-
case TMF_RESP_FUNC_FAILED:
1898-
case -EMSGSIZE:
1899-
case -EIO:
1900-
local_phy = sas_get_local_phy(device);
1901-
rc = sas_phy_enable(local_phy, 0);
1902-
if (!rc) {
1903-
local_phy->enabled = 0;
1904-
dev_err(dev, "Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n",
1905-
SAS_ADDR(device->sas_addr), rc);
1906-
rc = -ENODEV;
1907-
}
1908-
sas_put_local_phy(local_phy);
1909-
break;
1910-
default:
1911-
break;
1912-
}
1890+
if (rc == TMF_RESP_FUNC_FAILED)
1891+
dev_err(dev, "ata disk %016llx reset (%d)\n",
1892+
SAS_ADDR(device->sas_addr), rc);
19131893
}
19141894

1895+
rc = hisi_sas_debug_I_T_nexus_reset(device);
19151896
if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
19161897
hisi_sas_release_task(hisi_hba, device);
19171898

0 commit comments

Comments
 (0)