Skip to content

Commit e738ba4

Browse files
avri-altman-sndkmartinkpetersen
authored andcommitted
scsi: ufs: core: Introduce ufshcd_has_pending_tasks()
Prepare to remove hba->clk_gating.active_reqs check from ufshcd_is_ufs_dev_busy(). Signed-off-by: Avri Altman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 40384c8 commit e738ba4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,16 @@ ufs_get_desired_pm_lvl_for_dev_link_state(enum ufs_dev_pwr_mode dev_state,
258258
return UFS_PM_LVL_0;
259259
}
260260

261+
static bool ufshcd_has_pending_tasks(struct ufs_hba *hba)
262+
{
263+
return hba->outstanding_tasks || hba->active_uic_cmd ||
264+
hba->uic_async_done;
265+
}
266+
261267
static bool ufshcd_is_ufs_dev_busy(struct ufs_hba *hba)
262268
{
263-
return (hba->clk_gating.active_reqs || hba->outstanding_reqs || hba->outstanding_tasks ||
264-
hba->active_uic_cmd || hba->uic_async_done);
269+
return hba->clk_gating.active_reqs || hba->outstanding_reqs ||
270+
ufshcd_has_pending_tasks(hba);
265271
}
266272

267273
static const struct ufs_dev_quirk ufs_fixups[] = {
@@ -1999,8 +2005,7 @@ static void __ufshcd_release(struct ufs_hba *hba)
19992005

20002006
if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended ||
20012007
hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL ||
2002-
hba->outstanding_tasks || !hba->clk_gating.is_initialized ||
2003-
hba->active_uic_cmd || hba->uic_async_done ||
2008+
ufshcd_has_pending_tasks(hba) || !hba->clk_gating.is_initialized ||
20042009
hba->clk_gating.state == CLKS_OFF)
20052010
return;
20062011

0 commit comments

Comments
 (0)