Skip to content

Commit

Permalink
scsi: hisi_sas: Don't send bcast events from HW during nexus HA reset
Browse files Browse the repository at this point in the history
Remote devices may go missing from the per-device nexus reset part of the
HA nexus, i.e after the controller reset. This is because libsas may find
the devices to be gone as the phy may be temporarily down when processing
the bcast event generated from the nexus reset. Filter out bcast events
during this time to stop the devices being lost.

Link: https://lore.kernel.org/r/1662378529-101489-6-git-send-email-john.garry@huawei.com
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
John Garry authored and Martin K. Petersen committed Sep 7, 2022
1 parent e9b6bad commit f5f2a27
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/scsi/hisi_sas/hisi_sas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,12 +1823,14 @@ static int hisi_sas_clear_nexus_ha(struct sas_ha_struct *sas_ha)
struct hisi_hba *hisi_hba = sas_ha->lldd_ha;
HISI_SAS_DECLARE_RST_WORK_ON_STACK(r);
ASYNC_DOMAIN_EXCLUSIVE(async);
int i;
int i, ret;

queue_work(hisi_hba->wq, &r.work);
wait_for_completion(r.completion);
if (!r.done)
return TMF_RESP_FUNC_FAILED;
if (!r.done) {
ret = TMF_RESP_FUNC_FAILED;
goto out;
}

for (i = 0; i < HISI_SAS_MAX_DEVICES; i++) {
struct hisi_sas_device *sas_dev = &hisi_hba->devices[i];
Expand All @@ -1845,7 +1847,9 @@ static int hisi_sas_clear_nexus_ha(struct sas_ha_struct *sas_ha)
async_synchronize_full_domain(&async);
hisi_sas_release_tasks(hisi_hba);

return TMF_RESP_FUNC_COMPLETE;
ret = TMF_RESP_FUNC_COMPLETE;
out:
return ret;
}

static int hisi_sas_query_task(struct sas_task *task)
Expand Down Expand Up @@ -1993,10 +1997,14 @@ void hisi_sas_phy_bcast(struct hisi_sas_phy *phy)
{
struct asd_sas_phy *sas_phy = &phy->sas_phy;
struct hisi_hba *hisi_hba = phy->hisi_hba;
struct sas_ha_struct *sha = &hisi_hba->sha;

if (test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
return;

if (test_bit(SAS_HA_FROZEN, &sha->state))
return;

sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD, GFP_ATOMIC);
}
EXPORT_SYMBOL_GPL(hisi_sas_phy_bcast);
Expand Down

0 comments on commit f5f2a27

Please sign in to comment.