Skip to content

[qcom-next ] Keep USB3 pipe and UFS TX/RX symbol clocks unpolled - #122

Merged
varada-qcom merged 4 commits into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:qc/clk_gate_phy_fix
Aug 21, 2026
Merged

[qcom-next ] Keep USB3 pipe and UFS TX/RX symbol clocks unpolled#122
varada-qcom merged 4 commits into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:qc/clk_gate_phy_fix

Conversation

@balajiselvanathan

Copy link
Copy Markdown

Keep USB3 pipe and UFS TX/RX symbol clocks unpolled as their CBCR only clears CLK_OFF once the QMP PHY is running, so polling them at GCC enable time would time out.

Upstream link: https://lore.kernel.org/u-boot/20260820-clk_gate-v2-0-8cd0059c162b@oss.qualcomm.com/

Comment thread drivers/clk/qcom/clock-shikra.c Outdated
GATE_CLK(GCC_PCIE_CLKREF_EN, 0xb8000, BIT(0)),
GATE_CLK_POLLED(GCC_PCIE_MSTR_AXI_CLK, 0x7900c, BIT(30), 0xaf020),
GATE_CLK_POLLED(GCC_PCIE_PIPE_CLK, 0x79018, BIT(2), 0xaf050),
/* PHY-sourced: the pipe clock only runs once the QMP PHY is started,

@varada-qcom varada-qcom Aug 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All places, comment style should be

/*
 * PHY-sourced: . . .
 * . . .
 */

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

The USB3 pipe clock and the UFS TX/RX symbol clocks are driven by the
QMP PHY, not GCC, so their CBCR only clears CLK_OFF once the PHY is up.
Polling them at GCC enable time would time out before the PHY starts.

Switch GCC_USB3_PRIM_PHY_PIPE_CLK, GCC_UFS_PHY_TX_SYMBOL_0_CLK,
GCC_UFS_PHY_RX_SYMBOL_0_CLK and GCC_UFS_PHY_RX_SYMBOL_1_CLK back to
GATE_CLK so GCC enable does not poll the CBCR status bit.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The USB3 pipe clock and the UFS TX/RX symbol clocks are driven by the
QMP PHY, not GCC, so their CBCR only clears CLK_OFF once the PHY is up.
Polling them at GCC enable time would time out before the PHY starts.

Switch GCC_USB3_PRIM_PHY_PIPE_CLK, GCC_UFS_PHY_TX_SYMBOL_0_CLK,
GCC_UFS_PHY_RX_SYMBOL_0_CLK and GCC_UFS_PHY_RX_SYMBOL_1_CLK back to
GATE_CLK so GCC enable does not poll the CBCR status bit.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The USB3 pipe clock and the UFS TX/RX symbol clocks are driven by the
QMP PHY, not GCC, so their CBCR only clears CLK_OFF once the PHY is up.
Polling them at GCC enable time would time out before the PHY starts.

Switch GCC_USB3_PRIM_PHY_PIPE_CLK, GCC_UFS_PHY_TX_SYMBOL_0_CLK and
GCC_UFS_PHY_RX_SYMBOL_0_CLK back to GATE_CLK so GCC enable does not
poll the CBCR status bit.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The PCIe pipe clock is driven by the QMP PHY, not GCC, so its CBCR
only clears CLK_OFF once the PHY is up. Polling it at GCC enable time
would time out before the PHY starts.

Switch GCC_PCIE_PIPE_CLK back to GATE_CLK so GCC enable does not poll
the CBCR status bit.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
@varada-qcom
varada-qcom merged commit 0148985 into qualcomm-linux:qcom-next Aug 21, 2026
1 of 3 checks passed
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