Skip to content

UPSTREAM: scsi: ufs: core: Apply PM QoS vote whenever the UFS clocks are on - #1611

Closed
ggiriprasad wants to merge 1 commit into
qualcomm-linux:mainfrom
ggiriprasad:main-ufs-pm-qos-vote
Closed

ggiriprasad wants to merge 1 commit into
qualcomm-linux:mainfrom
ggiriprasad:main-ufs-pm-qos-vote

Conversation

@ggiriprasad

Copy link
Copy Markdown

ufshcd_setup_clocks() applied the PM QoS vote only when clock scaling
was not supported, relying on ufshcd_scale_clks() otherwise. Since that
path only updates the vote while scaling up or down, and devfreq scaling
never toggles the clocks, a scale-down drops the vote while the clocks
stay on. The vote is not reference counted and nothing restores it, so
the CPUs can enter deep idle while a request (e.g. a Query request) is
still outstanding, which delays the completion interrupt and can lead to
command timeouts.

Apply the vote in ufshcd_setup_clocks() unconditionally and drop the
ufshcd_pm_qos_update() call from ufshcd_scale_clks(), so the vote
tracks only the clock on/off state: held whenever the clocks are on,
released when they are gated off.

Maili MTP ABL-ESP Boot crash fix.

Link: https://lore.kernel.org/all/20261202104637.1339868-2-manish.pandey@oss.qualcomm.com/
Upstream: https://lore.kernel.org/all/sashiko-outbox-245551@kernel.org/

…are on

ufshcd_setup_clocks() applied the PM QoS vote only when clock scaling
was not supported, relying on ufshcd_scale_clks() otherwise. But that
only updates the vote while scaling up or down, and a scale-down drops
it while the clocks stay on. The CPUs can then enter deep idle while a
request (e.g. a Query request) is still outstanding, delaying the
completion interrupt and causing command timeouts.

Apply the vote in ufshcd_setup_clocks() unconditionally and drop the
ufshcd_pm_qos_update() call from ufshcd_scale_clks(), so the vote
tracks only the clock on/off state: held whenever the clocks are on,
released when they are gated off.

Fixes: 2777e73 ("scsi: ufs: core: Add CPU latency QoS support for UFS driver")
Link: https://lore.kernel.org/all/20261202104637.1339868-2-manish.pandey@oss.qualcomm.com/
Signed-off-by: Manish Pandey <manish.pandey@oss.qualcomm.com>
Signed-off-by: Giri Prasad Goriparthi <giri.goriparthi@oss.qualcomm.com>
@ggiriprasad ggiriprasad closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant