diff mbox series

[10/15] scsi: libsas: Add a flag SAS_HA_RESUMING of sas_ha

Message ID 1637117108-230103-11-git-send-email-chenxiang66@hisilicon.com (mailing list archive)
State Changes Requested
Headers show
Series Add runtime PM support for libsas | expand

Commit Message

chenxiang Nov. 17, 2021, 2:45 a.m. UTC
From: Xiang Chen <chenxiang66@hisilicon.com>

Add a flag SAS_HA_RESUMING and use it to indicate the process of resuming
sas_ha.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/libsas/sas_init.c | 2 ++
 include/scsi/libsas.h          | 1 +
 2 files changed, 3 insertions(+)

Comments

John Garry Dec. 13, 2021, 11:17 a.m. UTC | #1
On 17/11/2021 02:45, chenxiang wrote:

I'd just have "scsi: libsas: Add flag SAS_HA_RESUMING"

> From: Xiang Chen<chenxiang66@hisilicon.com>
> 
> Add a flag SAS_HA_RESUMING and use it to indicate the process of resuming
> sas_ha.

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

> 
> Signed-off-by: Xiang Chen<chenxiang66@hisilicon.com>
> Reviewed-by: John Garry<john.garry@huawei.com>
chenxiang Dec. 15, 2021, 7:34 a.m. UTC | #2
在 2021/12/13 19:17, John Garry 写道:
> On 17/11/2021 02:45, chenxiang wrote:
>
> I'd just have "scsi: libsas: Add flag SAS_HA_RESUMING"

Ok

>
>> From: Xiang Chen<chenxiang66@hisilicon.com>
>>
>> Add a flag SAS_HA_RESUMING and use it to indicate the process of 
>> resuming
>> sas_ha.
>
> Add a flag SAS_HA_RESUMING and use it to indicate the state of 
> resuming the host controller.
Ok
>
>>
>> Signed-off-by: Xiang Chen<chenxiang66@hisilicon.com>
>> Reviewed-by: John Garry<john.garry@huawei.com>
>
>
> .
>
diff mbox series

Patch

diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c
index 974c4a305ece..069e40fc8411 100644
--- a/drivers/scsi/libsas/sas_init.c
+++ b/drivers/scsi/libsas/sas_init.c
@@ -362,6 +362,7 @@  void sas_prep_resume_ha(struct sas_ha_struct *ha)
 	int i;
 
 	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 */
 	for (i = 0; i < ha->num_phys; i++) {
@@ -443,6 +444,7 @@  static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain)
 	scsi_unblock_requests(ha->core.shost);
 	if (drain)
 		sas_drain_work(ha);
+	clear_bit(SAS_HA_RESUMING, &ha->state);
 
 	/* send event PORTE_BROADCAST_RCVD to identify some new inserted
 	 * disks for expander
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index a795a2d9e5b1..698f2032807b 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -356,6 +356,7 @@  enum sas_ha_state {
 	SAS_HA_DRAINING,
 	SAS_HA_ATA_EH_ACTIVE,
 	SAS_HA_FROZEN,
+	SAS_HA_RESUMING,
 };
 
 struct sas_ha_struct {