Patch "scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-hisi_sas-fix-sata-devices-missing-issue-during-.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit efa8db7e79f545227a86fcce1ef26831d47056af
Author: Jie Zhan <zhanjie9@xxxxxxxxxxxxx>
Date:   Fri Nov 18 16:37:13 2022 +0800

    scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset
    
    [ Upstream commit 3c2673a09cf1181318c07b7dbc1bc532ba3d33e3 ]
    
    SATA devices on an expander may be removed and not be found again when I_T
    nexus reset and revalidation are processed simultaneously.
    
    The issue comes from:
    
     - Revalidation can remove SATA devices in link reset, e.g. in
       hisi_sas_clear_nexus_ha().
    
     - However, hisi_sas_debug_I_T_nexus_reset() polls the state of a SATA
       device on an expander after sending link_reset, where it calls:
        hisi_sas_debug_I_T_nexus_reset
         sas_ata_wait_after_reset
          ata_wait_after_reset
           ata_wait_ready
            smp_ata_check_ready
             sas_ex_phy_discover
              sas_ex_phy_discover_helper
               sas_set_ex_phy
    
       The ex_phy's change count is updated in sas_set_ex_phy(), so SATA
       devices after a link reset may not be found later through revalidation.
    
    A similar issue was reported in:
    commit 0f3fce5cc77e ("[SCSI] libsas: fix ata_eh clobbering ex_phys via
    smp_ata_check_ready")
    commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery competing
    with ata error handling").
    
    To address this issue, in hisi_sas_debug_I_T_nexus_reset(), we now call
    smp_ata_check_ready_type() that only polls the device type while not
    updating the ex_phy's data of libsas.
    
    Fixes: 71453bd9d1bf ("scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset")
    Signed-off-by: Jie Zhan <zhanjie9@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221118083714.4034612-5-zhanjie9@xxxxxxxxxxxxx
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 02fa3c00dcccf..a8142e2b96435 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1708,13 +1708,15 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)
 		return rc;
 	}
 
+	/* Remote phy */
 	if (rc)
 		return rc;
 
-	/* Remote phy */
 	if (dev_is_sata(device)) {
-		rc = sas_ata_wait_after_reset(device,
-					HISI_SAS_WAIT_PHYUP_TIMEOUT);
+		struct ata_link *link = &device->sata_dev.ap->link;
+
+		rc = ata_wait_after_reset(link, HISI_SAS_WAIT_PHYUP_TIMEOUT,
+					  smp_ata_check_ready_type);
 	} else {
 		msleep(2000);
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux