scsi: ufs: Fix system suspend status
Subsystems (2)
PATCH 1/1 scsi: ufs: Fix system suspend status
hba->is_sys_suspended is set after successful system suspend but not clear after successful system resume.
Simply fix this flag to correct host status logs.
A message that is not in the archive (sent off-list or not yet received): 1546870774-19691-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]
cover scsi: ufs: Fix system suspend status
From: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]>
Stanley Chu (1):
scsi: ufs: Fix system suspend status
drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+)
Signature · 1 line
1.9.1
PATCH 1/1 scsi: ufs: Fix system suspend status
In reply to a message not in the archiveFrom: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]>
hba->is_sys_suspended is set after successful system suspend but not clear after successful system resume.
According to current behavior, hba->is_sys_suspended will not be set if host is runtime-suspended but not system-suspended. Thus we shall aligh the same policy: clear this flag even if host remains runtime-suspended after ufshcd_system_resume is successfully returned.
Simply fix this flag to correct host status logs.
--- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ufs/ufshcd.c +2 -0
@@ -7916,6 +7916,8 @@ int ufshcd_system_resume(struct ufs_hba *hba)trace_ufshcd_system_resume (dev_name (hba->dev), ret,ktime_to_us (ktime_sub (ktime_get (), start)), hba->curr_dev_pwr_mode, hba->uic_link_state); +if (!ret) + hba->is_sys_suspended = false;return ret; }EXPORT_SYMBOL (ufshcd_system_resume);
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1546870774-19691-3-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]
(Add missing maintainers/reviewers)
Hi Vinayak, Avri,
What would you think about the simple patch as below ?
Regards.
Thanks.
Quoted 30 lines · On Mon, 2019-01-07 at 22:19 +0800, stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]…
From: Stanley Chu <stanley.chu-NuS5LvNUpcJWk0Htik3J/[email protected]>
hba->is_sys_suspendedis set after successful system suspend but not clear after successful system resume.According to current behavior,
hba->is_sys_suspendedwill not be set if host is runtime-suspended but not system-suspended. Thus we shall aligh the same policy: clear this flag even if host remains runtime-suspended afterufshcd_system_resumeis successfully returned.Simply fix this flag to correct host status logs.
--- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+)drivers/scsi/ufs/ufshcd.c +2
-0@@ -7916,6 +7916,8 @@ int ufshcd_system_resume(struct ufs_hba *hba)trace_ufshcd_system_resume (dev_name (hba->dev), ret,ktime_to_us (ktime_sub (ktime_get (), start)), hba->curr_dev_pwr_mode, hba->uic_link_state); +if (!ret) + hba->is_sys_suspended = false;return ret; }EXPORT_SYMBOL (ufshcd_system_resume);
Avri Altman
Reviewed-byHi,
Quoted 4 lines
hba->is_sys_suspendedis set after successful system suspend but not clear after successful system resume.
Quoted 8 lines
According to current behavior,
hba->is_sys_suspendedwill not be set if host is runtime-suspended but not system-suspended. Thus we shall aligh the same policy: clear this flag even if host remains runtime-suspended afterufshcd_system_resumeis successfully returned.Simply fix this flag to correct host status logs.
This is already happening today for Qualcomm's vops, but you are right - it should happen anyway, regardless the platform's vendor specific resume callback.
Martin K. Petersen
AppliedStanley,
Quoted 9 lines
hba->is_sys_suspendedis set after successful system suspend but not clear after successful system resume.According to current behavior,
hba->is_sys_suspendedwill not be set if host is runtime-suspended but not system-suspended. Thus we shall aligh the same policy: clear this flag even if host remains runtime-suspended afterufshcd_system_resumeis successfully returned.Simply fix this flag to correct host status logs.
Applied to 5.0/scsi-fixes. Thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering