Commit 4ea775ab authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen

scsi: libsas: Add flag SAS_HA_RESUMING

Add a flag SAS_HA_RESUMING and use it to indicate the state of resuming the
host controller.

Link: https://lore.kernel.org/r/1639999298-244569-11-git-send-email-chenxiang66@hisilicon.comReviewed-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0da7ca4c
...@@ -362,6 +362,7 @@ void sas_prep_resume_ha(struct sas_ha_struct *ha) ...@@ -362,6 +362,7 @@ void sas_prep_resume_ha(struct sas_ha_struct *ha)
int i; int i;
set_bit(SAS_HA_REGISTERED, &ha->state); set_bit(SAS_HA_REGISTERED, &ha->state);
set_bit(SAS_HA_RESUMING, &ha->state);
/* clear out any stale link events/data from the suspension path */ /* clear out any stale link events/data from the suspension path */
for (i = 0; i < ha->num_phys; i++) { for (i = 0; i < ha->num_phys; i++) {
...@@ -443,6 +444,7 @@ static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain) ...@@ -443,6 +444,7 @@ static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain)
scsi_unblock_requests(ha->core.shost); scsi_unblock_requests(ha->core.shost);
if (drain) if (drain)
sas_drain_work(ha); sas_drain_work(ha);
clear_bit(SAS_HA_RESUMING, &ha->state);
/* send event PORTE_BROADCAST_RCVD to identify some new inserted /* send event PORTE_BROADCAST_RCVD to identify some new inserted
* disks for expander * disks for expander
......
...@@ -356,6 +356,7 @@ enum sas_ha_state { ...@@ -356,6 +356,7 @@ enum sas_ha_state {
SAS_HA_DRAINING, SAS_HA_DRAINING,
SAS_HA_ATA_EH_ACTIVE, SAS_HA_ATA_EH_ACTIVE,
SAS_HA_FROZEN, SAS_HA_FROZEN,
SAS_HA_RESUMING,
}; };
struct sas_ha_struct { struct sas_ha_struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment