]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
authorYihang Li <liyihang9@huawei.com>
Mon, 14 Apr 2025 08:08:44 +0000 (16:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:09 +0000 (11:07 +0100)
[ Upstream commit e4d953ca557e02edd3aed7390043e1b8ad1c9723 ]

In commit 21c7e972475e ("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: 21c7e972475e ("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>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 02855164bf28dc8411ae7008c601884510dff62f..360f2799f2a13a674744bbcba9b01428af596523 100644 (file)
@@ -1758,33 +1758,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
        }
        hisi_sas_dereg_device(hisi_hba, device);
 
-       rc = hisi_sas_debug_I_T_nexus_reset(device);
-       if (rc == TMF_RESP_FUNC_COMPLETE && dev_is_sata(device)) {
-               struct sas_phy *local_phy;
-
+       if (dev_is_sata(device)) {
                rc = hisi_sas_softreset_ata_disk(device);
-               switch (rc) {
-               case -ECOMM:
-                       rc = -ENODEV;
-                       break;
-               case TMF_RESP_FUNC_FAILED:
-               case -EMSGSIZE:
-               case -EIO:
-                       local_phy = sas_get_local_phy(device);
-                       rc = sas_phy_enable(local_phy, 0);
-                       if (!rc) {
-                               local_phy->enabled = 0;
-                               dev_err(dev, "Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n",
-                                       SAS_ADDR(device->sas_addr), rc);
-                               rc = -ENODEV;
-                       }
-                       sas_put_local_phy(local_phy);
-                       break;
-               default:
-                       break;
-               }
+               if (rc == TMF_RESP_FUNC_FAILED)
+                       dev_err(dev, "ata disk %016llx reset (%d)\n",
+                               SAS_ADDR(device->sas_addr), rc);
        }
 
+       rc = hisi_sas_debug_I_T_nexus_reset(device);
        if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
                hisi_sas_release_task(hisi_hba, device);