mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
UPSTREAM: scsi: ufs: ufshpb: Clean up ufshpb_suspend()/resume()
ufshpb_resume() is only called when the HPB state is HPB_SUSPEND, so the
check statement for "ufshpb_get_state(hpb) != HPB_PRESENT" is useless.
Link: https://lore.kernel.org/r/20220505134707.35929-7-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 18ebe2390c)
Change-Id: Iccb0d148c593a3b40f2c744ea6617e7250ac9189
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
4119ade206
commit
0dd3530434
@@ -2349,11 +2349,9 @@ void ufshpb_suspend(struct ufs_hba *hba)
|
||||
|
||||
shost_for_each_device(sdev, hba->host) {
|
||||
hpb = ufshpb_get_hpb_data(sdev);
|
||||
if (!hpb)
|
||||
if (!hpb || ufshpb_get_state(hpb) != HPB_PRESENT)
|
||||
continue;
|
||||
|
||||
if (ufshpb_get_state(hpb) != HPB_PRESENT)
|
||||
continue;
|
||||
ufshpb_set_state(hpb, HPB_SUSPEND);
|
||||
ufshpb_cancel_jobs(hpb);
|
||||
}
|
||||
@@ -2366,20 +2364,15 @@ void ufshpb_resume(struct ufs_hba *hba)
|
||||
|
||||
shost_for_each_device(sdev, hba->host) {
|
||||
hpb = ufshpb_get_hpb_data(sdev);
|
||||
if (!hpb)
|
||||
if (!hpb || ufshpb_get_state(hpb) != HPB_SUSPEND)
|
||||
continue;
|
||||
|
||||
if ((ufshpb_get_state(hpb) != HPB_PRESENT) &&
|
||||
(ufshpb_get_state(hpb) != HPB_SUSPEND))
|
||||
continue;
|
||||
ufshpb_set_state(hpb, HPB_PRESENT);
|
||||
ufshpb_kick_map_work(hpb);
|
||||
if (hpb->is_hcm) {
|
||||
unsigned int poll =
|
||||
hpb->params.timeout_polling_interval_ms;
|
||||
unsigned int poll = hpb->params.timeout_polling_interval_ms;
|
||||
|
||||
schedule_delayed_work(&hpb->ufshpb_read_to_work,
|
||||
msecs_to_jiffies(poll));
|
||||
schedule_delayed_work(&hpb->ufshpb_read_to_work, msecs_to_jiffies(poll));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user