2022-11-18 09:42:39

by Jie Zhan

[permalink] [raw]
Subject: [PATCH for-next 0/5] scsi: hisi_sas/libsas: Fix SATA devices missing issue during hisi_sas_debug_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,
which is probable to happen in hisi_sas_clear_nexus_ha().

The issue came up since commit 71453bd9d1bf ("scsi: hisi_sas: Use
sas_ata_wait_after_reset() in IT nexus reset"), where the ex_phy's
change count is updated in hisi_sas_debug_I_T_nexus_reset(), stopping
future revalidation from discovering the SATA devices after link
reset.

This patchset fixes the issue.

Jie Zhan (5):
Revert "scsi: hisi_sas: Drain bcast events in
hisi_sas_rescan_topology()"
Revert "scsi: hisi_sas: Don't send bcast events from HW during nexus
HA reset"
scsi: libsas: Add smp_ata_check_ready_type()
scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset
scsi: libsas: Do not export sas_ata_wait_after_reset()

drivers/scsi/hisi_sas/hisi_sas_main.c | 31 ++++++++-------------------
drivers/scsi/libsas/sas_ata.c | 28 ++++++++++++++++++++++--
drivers/scsi/libsas/sas_expander.c | 4 ++--
drivers/scsi/libsas/sas_internal.h | 2 ++
include/scsi/sas_ata.h | 7 +++---
5 files changed, 42 insertions(+), 30 deletions(-)

--
2.30.0



2022-11-18 09:42:39

by Jie Zhan

[permalink] [raw]
Subject: [PATCH for-next 1/5] Revert "scsi: hisi_sas: Drain bcast events in hisi_sas_rescan_topology()"

This reverts commit 11ff0c98fca35df16c84d4eee52008faecaf10a6.

Draining or flushing events in hisi_sas_rescan_topology() can hang
the driver, typically with phy up or phy down events being processed,
i.e. sas_porte_bytes_dmaed() or sas_phye_loss_of_signal().

Signed-off-by: Jie Zhan <[email protected]>
---
drivers/scsi/hisi_sas/hisi_sas_main.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 54860d252466..4527ac266bb6 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1323,7 +1323,6 @@ static void hisi_sas_refresh_port_id(struct hisi_hba *hisi_hba)

static void hisi_sas_rescan_topology(struct hisi_hba *hisi_hba, u32 state)
{
- struct sas_ha_struct *sas_ha = &hisi_hba->sha;
struct asd_sas_port *_sas_port = NULL;
int phy_no;

@@ -1352,12 +1351,6 @@ static void hisi_sas_rescan_topology(struct hisi_hba *hisi_hba, u32 state)
hisi_sas_phy_down(hisi_hba, phy_no, 0, GFP_KERNEL);
}
}
- /*
- * Ensure any bcast events are processed prior to calling async nexus
- * reset calls from hisi_sas_clear_nexus_ha() ->
- * hisi_sas_async_I_T_nexus_reset()
- */
- sas_drain_work(sas_ha);
}

static void hisi_sas_reset_init_all_devices(struct hisi_hba *hisi_hba)
--
2.30.0


2022-11-26 03:23:54

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH for-next 0/5] scsi: hisi_sas/libsas: Fix SATA devices missing issue during hisi_sas_debug_I_T_nexus_reset()


Jie,

> SATA devices on an expander may be removed and not be found again
> when I_T nexus reset and revalidation are processed simultaneously,
> which is probable to happen in hisi_sas_clear_nexus_ha().

Applied to 6.2/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2022-12-01 03:51:04

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH for-next 0/5] scsi: hisi_sas/libsas: Fix SATA devices missing issue during hisi_sas_debug_I_T_nexus_reset()

On Fri, 18 Nov 2022 16:37:09 +0800, Jie Zhan wrote:

> SATA devices on an expander may be removed and not be found again
> when I_T nexus reset and revalidation are processed simultaneously,
> which is probable to happen in hisi_sas_clear_nexus_ha().
>
> The issue came up since commit 71453bd9d1bf ("scsi: hisi_sas: Use
> sas_ata_wait_after_reset() in IT nexus reset"), where the ex_phy's
> change count is updated in hisi_sas_debug_I_T_nexus_reset(), stopping
> future revalidation from discovering the SATA devices after link
> reset.
>
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/5] Revert "scsi: hisi_sas: Drain bcast events in hisi_sas_rescan_topology()"
https://git.kernel.org/mkp/scsi/c/7e613be7c63d
[2/5] Revert "scsi: hisi_sas: Don't send bcast events from HW during nexus HA reset"
https://git.kernel.org/mkp/scsi/c/94a3555d1f0f
[3/5] scsi: libsas: Add smp_ata_check_ready_type()
https://git.kernel.org/mkp/scsi/c/9181ce3cb5d9
[4/5] scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset
https://git.kernel.org/mkp/scsi/c/3c2673a09cf1
[5/5] scsi: libsas: Do not export sas_ata_wait_after_reset()
https://git.kernel.org/mkp/scsi/c/4d450cf2b00d

--
Martin K. Petersen Oracle Linux Engineering