Skip to content

Commit 7869c65

Browse files
avri-altman-sndkmartinkpetersen
authored andcommitted
scsi: ufs: core: Prepare to introduce a new clock_gating lock
Remove hba->clk_gating.active_reqs check from ufshcd_is_ufs_dev_busy() function to separate clock gating logic from general device busy checks. 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 e738ba4 commit 7869c65

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ static bool ufshcd_has_pending_tasks(struct ufs_hba *hba)
266266

267267
static bool ufshcd_is_ufs_dev_busy(struct ufs_hba *hba)
268268
{
269-
return hba->clk_gating.active_reqs || hba->outstanding_reqs ||
270-
ufshcd_has_pending_tasks(hba);
269+
return hba->outstanding_reqs || ufshcd_has_pending_tasks(hba);
271270
}
272271

273272
static const struct ufs_dev_quirk ufs_fixups[] = {
@@ -1949,7 +1948,9 @@ static void ufshcd_gate_work(struct work_struct *work)
19491948
goto rel_lock;
19501949
}
19511950

1952-
if (ufshcd_is_ufs_dev_busy(hba) || hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL)
1951+
if (ufshcd_is_ufs_dev_busy(hba) ||
1952+
hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL ||
1953+
hba->clk_gating.active_reqs)
19531954
goto rel_lock;
19541955

19551956
spin_unlock_irqrestore(hba->host->host_lock, flags);
@@ -8226,7 +8227,9 @@ static void ufshcd_rtc_work(struct work_struct *work)
82268227
hba = container_of(to_delayed_work(work), struct ufs_hba, ufs_rtc_update_work);
82278228

82288229
/* Update RTC only when there are no requests in progress and UFSHCI is operational */
8229-
if (!ufshcd_is_ufs_dev_busy(hba) && hba->ufshcd_state == UFSHCD_STATE_OPERATIONAL)
8230+
if (!ufshcd_is_ufs_dev_busy(hba) &&
8231+
hba->ufshcd_state == UFSHCD_STATE_OPERATIONAL &&
8232+
!hba->clk_gating.active_reqs)
82308233
ufshcd_update_rtc(hba);
82318234

82328235
if (ufshcd_is_ufs_dev_active(hba) && hba->dev_info.rtc_update_period)

0 commit comments

Comments
 (0)