linux/drivers/scsi/hisi_sas
Jie Zhan 3c2673a09c scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset
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 0f3fce5cc7 ("[SCSI] libsas: fix ata_eh clobbering ex_phys via
smp_ata_check_ready")
commit 87c8331fcf ("[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: 71453bd9d1 ("scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset")
Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
Link: https://lore.kernel.org/r/20221118083714.4034612-5-zhanjie9@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-11-26 02:26:02 +00:00
..
hisi_sas_main.c scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset 2022-11-26 02:26:02 +00:00
hisi_sas_v1_hw.c scsi: hisi_sas: Add helper to process bcast events 2022-09-06 22:28:11 -04:00
hisi_sas_v2_hw.c SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
hisi_sas_v3_hw.c scsi: hisi_sas: Modify v3 HW SATA disk error state completion processing 2022-10-18 02:37:45 +00:00
hisi_sas.h scsi: hisi_sas: Add SATA_DISK_ERR bit handling for v3 hw 2022-10-18 02:37:45 +00:00
Kconfig scsi: hisi_sas: Enable debugfs support by default 2021-01-26 23:02:11 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00