Skip to content

Commit e4d953c

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
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>
1 parent 92c8fe1 commit e4d953c

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
@@ -1875,33 +1875,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
18751875
}
18761876
hisi_sas_dereg_device(hisi_hba, device);
18771877

1878-
rc = hisi_sas_debug_I_T_nexus_reset(device);
1879-
if (rc == TMF_RESP_FUNC_COMPLETE && dev_is_sata(device)) {
1880-
struct sas_phy *local_phy;
1881-
1878+
if (dev_is_sata(device)) {
18821879
rc = hisi_sas_softreset_ata_disk(device);
1883-
switch (rc) {
1884-
case -ECOMM:
1885-
rc = -ENODEV;
1886-
break;
1887-
case TMF_RESP_FUNC_FAILED:
1888-
case -EMSGSIZE:
1889-
case -EIO:
1890-
local_phy = sas_get_local_phy(device);
1891-
rc = sas_phy_enable(local_phy, 0);
1892-
if (!rc) {
1893-
local_phy->enabled = 0;
1894-
dev_err(dev, "Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n",
1895-
SAS_ADDR(device->sas_addr), rc);
1896-
rc = -ENODEV;
1897-
}
1898-
sas_put_local_phy(local_phy);
1899-
break;
1900-
default:
1901-
break;
1902-
}
1880+
if (rc == TMF_RESP_FUNC_FAILED)
1881+
dev_err(dev, "ata disk %016llx reset (%d)\n",
1882+
SAS_ADDR(device->sas_addr), rc);
19031883
}
19041884

1885+
rc = hisi_sas_debug_I_T_nexus_reset(device);
19051886
if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
19061887
hisi_sas_release_task(hisi_hba, device);
19071888

0 commit comments

Comments
 (0)