Skip to content

ufs: qcom: Remove unused int err variable from ufs_qcom_init_lane_clks - #1071

Closed
ggiriprasad wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
ggiriprasad:pr-1069
Closed

ufs: qcom: Remove unused int err variable from ufs_qcom_init_lane_clks#1071
ggiriprasad wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
ggiriprasad:pr-1069

Conversation

@ggiriprasad

Copy link
Copy Markdown

This commit removes the unused 'int err;' variable declaration from the ufs_qcom_init_lane_clks() function to match the complete patch for 'Enable only lane clocks in lane clock APIs'.

The variable was declared but never used in the function, as all clock retrieval operations use devm_clk_get() which returns errors via IS_ERR() checks rather than through an err variable.

This fix completes PR #1069 by addressing the missing change that was in the original patch.

nitinrawat123 and others added 2 commits September 10, 2026 03:26
…APIs

ufs_qcom_enable_lane_clks() and ufs_qcom_disable_lane_clks() currently
use clk_bulk_prepare_enable()/clk_bulk_disable_unprepare() on the
entire host->clks array obtained from devm_clk_bulk_get_all(). This
array contains all device clocks, not just lane symbol clocks.

Since the UFS core framework already manages the non-lane clocks via
the setup_clocks callback, the bulk enable/disable in the lane clock
APIs resulted in duplicate reference count increments on those shared
clocks. The extra enable counts were never balanced by a corresponding
disable from the framework's clock gating path, preventing the clock
reference counts from reaching zero and ultimately blocking CXO
shutdown during low-power states.

Fix this by restricting the lane clock APIs to only prepare/enable
and disable/unprepare the three lane symbol clocks (tx_lane0_sync_clk,
rx_lane0_sync_clk, rx_lane1_sync_clk), leaving the handling of all
other clocks to the UFS core framework. The lane clocks are now
acquired individually via devm_clk_get() instead of being looked up
in the bulk clock array.

Link: https://lore.kernel.org/linux-scsi/20260909053944.2827968-1-nitin.rawat@oss.qualcomm.com/T/#meb440ffd6fd2965505bbc86a944250f47a68def5
Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
Signed-off-by: Giri Prasad Goriparthi <giri.goriparthi@oss.qualcomm.com>
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

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.

2 participants