Skip to content

Commit 3c2673a

Browse files
Jie Zhanmartinkpetersen
authored andcommitted
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 0f3fce5 ("[SCSI] libsas: fix ata_eh clobbering ex_phys via smp_ata_check_ready") commit 87c8331 ("[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: 71453bd ("scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset") Signed-off-by: Jie Zhan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9181ce3 commit 3c2673a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,13 +1694,15 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)
16941694
return rc;
16951695
}
16961696

1697+
/* Remote phy */
16971698
if (rc)
16981699
return rc;
16991700

1700-
/* Remote phy */
17011701
if (dev_is_sata(device)) {
1702-
rc = sas_ata_wait_after_reset(device,
1703-
HISI_SAS_WAIT_PHYUP_TIMEOUT);
1702+
struct ata_link *link = &device->sata_dev.ap->link;
1703+
1704+
rc = ata_wait_after_reset(link, HISI_SAS_WAIT_PHYUP_TIMEOUT,
1705+
smp_ata_check_ready_type);
17041706
} else {
17051707
msleep(2000);
17061708
}

0 commit comments

Comments
 (0)