Commit f27e42c7 authored by Abel Vesa's avatar Abel Vesa Committed by Bjorn Andersson

clk: qcom: gcc-x1e80100: Fix halt_check for all pipe clocks

In case of all pipe clocks, there is a QMP PHY clock that is feeding them.
If, for whatever reason, the clock from the PHY is not enabled, halt bit
will not get set, and the clock controller driver will assume the clock
is stuck in a specific state. The way this is supposed to be properly
fixed is to defer the checking of the halt bit until after the PHY clock
has been initialized, but doing so complicates the clock controller
driver. In fact, since these pipe clocks are consumed by the PHY, while
the PHY is also the one providing the source, if clock gets stuck, the PHY
driver would be to blame. So instead of checking the halt bit in here,
just skip it and assume the PHY driver is handling the source clock
correctly.

Fixes: 161b7c40 ("clk: qcom: Add Global Clock controller (GCC) driver for X1E80100")
Signed-off-by: default avatarAbel Vesa <abel.vesa@linaro.org>
Reviewed-by: default avatarTaniya Das <quic_tdas@quicinc.com>
Link: https://lore.kernel.org/r/20240628-x1e80100-clk-gcc-fix-halt-check-for-usb-phy-pipe-clks-v2-1-db3be54b1143@linaro.orgSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent f2743ae3
...@@ -2812,7 +2812,7 @@ static struct clk_branch gcc_pcie_0_mstr_axi_clk = { ...@@ -2812,7 +2812,7 @@ static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
static struct clk_branch gcc_pcie_0_pipe_clk = { static struct clk_branch gcc_pcie_0_pipe_clk = {
.halt_reg = 0xa0044, .halt_reg = 0xa0044,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52010, .enable_reg = 0x52010,
.enable_mask = BIT(25), .enable_mask = BIT(25),
...@@ -2901,7 +2901,7 @@ static struct clk_branch gcc_pcie_1_mstr_axi_clk = { ...@@ -2901,7 +2901,7 @@ static struct clk_branch gcc_pcie_1_mstr_axi_clk = {
static struct clk_branch gcc_pcie_1_pipe_clk = { static struct clk_branch gcc_pcie_1_pipe_clk = {
.halt_reg = 0x2c044, .halt_reg = 0x2c044,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52020, .enable_reg = 0x52020,
.enable_mask = BIT(30), .enable_mask = BIT(30),
...@@ -2990,7 +2990,7 @@ static struct clk_branch gcc_pcie_2_mstr_axi_clk = { ...@@ -2990,7 +2990,7 @@ static struct clk_branch gcc_pcie_2_mstr_axi_clk = {
static struct clk_branch gcc_pcie_2_pipe_clk = { static struct clk_branch gcc_pcie_2_pipe_clk = {
.halt_reg = 0x13044, .halt_reg = 0x13044,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52020, .enable_reg = 0x52020,
.enable_mask = BIT(23), .enable_mask = BIT(23),
...@@ -3110,7 +3110,7 @@ static struct clk_branch gcc_pcie_3_phy_rchng_clk = { ...@@ -3110,7 +3110,7 @@ static struct clk_branch gcc_pcie_3_phy_rchng_clk = {
static struct clk_branch gcc_pcie_3_pipe_clk = { static struct clk_branch gcc_pcie_3_pipe_clk = {
.halt_reg = 0x58050, .halt_reg = 0x58050,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52020, .enable_reg = 0x52020,
.enable_mask = BIT(3), .enable_mask = BIT(3),
...@@ -3235,7 +3235,7 @@ static struct clk_branch gcc_pcie_4_phy_rchng_clk = { ...@@ -3235,7 +3235,7 @@ static struct clk_branch gcc_pcie_4_phy_rchng_clk = {
static struct clk_branch gcc_pcie_4_pipe_clk = { static struct clk_branch gcc_pcie_4_pipe_clk = {
.halt_reg = 0x6b044, .halt_reg = 0x6b044,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52008, .enable_reg = 0x52008,
.enable_mask = BIT(4), .enable_mask = BIT(4),
...@@ -3360,7 +3360,7 @@ static struct clk_branch gcc_pcie_5_phy_rchng_clk = { ...@@ -3360,7 +3360,7 @@ static struct clk_branch gcc_pcie_5_phy_rchng_clk = {
static struct clk_branch gcc_pcie_5_pipe_clk = { static struct clk_branch gcc_pcie_5_pipe_clk = {
.halt_reg = 0x2f044, .halt_reg = 0x2f044,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52018, .enable_reg = 0x52018,
.enable_mask = BIT(17), .enable_mask = BIT(17),
...@@ -3498,7 +3498,7 @@ static struct clk_branch gcc_pcie_6a_phy_rchng_clk = { ...@@ -3498,7 +3498,7 @@ static struct clk_branch gcc_pcie_6a_phy_rchng_clk = {
static struct clk_branch gcc_pcie_6a_pipe_clk = { static struct clk_branch gcc_pcie_6a_pipe_clk = {
.halt_reg = 0x31050, .halt_reg = 0x31050,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52018, .enable_reg = 0x52018,
.enable_mask = BIT(26), .enable_mask = BIT(26),
...@@ -3636,7 +3636,7 @@ static struct clk_branch gcc_pcie_6b_phy_rchng_clk = { ...@@ -3636,7 +3636,7 @@ static struct clk_branch gcc_pcie_6b_phy_rchng_clk = {
static struct clk_branch gcc_pcie_6b_pipe_clk = { static struct clk_branch gcc_pcie_6b_pipe_clk = {
.halt_reg = 0x8d050, .halt_reg = 0x8d050,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52000, .enable_reg = 0x52000,
.enable_mask = BIT(30), .enable_mask = BIT(30),
...@@ -5109,7 +5109,7 @@ static struct clk_branch gcc_usb3_mp_phy_com_aux_clk = { ...@@ -5109,7 +5109,7 @@ static struct clk_branch gcc_usb3_mp_phy_com_aux_clk = {
static struct clk_branch gcc_usb3_mp_phy_pipe_0_clk = { static struct clk_branch gcc_usb3_mp_phy_pipe_0_clk = {
.halt_reg = 0x17290, .halt_reg = 0x17290,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x17290, .enable_reg = 0x17290,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5122,7 +5122,7 @@ static struct clk_branch gcc_usb3_mp_phy_pipe_0_clk = { ...@@ -5122,7 +5122,7 @@ static struct clk_branch gcc_usb3_mp_phy_pipe_0_clk = {
static struct clk_branch gcc_usb3_mp_phy_pipe_1_clk = { static struct clk_branch gcc_usb3_mp_phy_pipe_1_clk = {
.halt_reg = 0x17298, .halt_reg = 0x17298,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x17298, .enable_reg = 0x17298,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5186,7 +5186,7 @@ static struct clk_regmap_mux gcc_usb3_prim_phy_pipe_clk_src = { ...@@ -5186,7 +5186,7 @@ static struct clk_regmap_mux gcc_usb3_prim_phy_pipe_clk_src = {
static struct clk_branch gcc_usb3_prim_phy_pipe_clk = { static struct clk_branch gcc_usb3_prim_phy_pipe_clk = {
.halt_reg = 0x39068, .halt_reg = 0x39068,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0x39068, .hwcg_reg = 0x39068,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
...@@ -5257,7 +5257,7 @@ static struct clk_regmap_mux gcc_usb3_sec_phy_pipe_clk_src = { ...@@ -5257,7 +5257,7 @@ static struct clk_regmap_mux gcc_usb3_sec_phy_pipe_clk_src = {
static struct clk_branch gcc_usb3_sec_phy_pipe_clk = { static struct clk_branch gcc_usb3_sec_phy_pipe_clk = {
.halt_reg = 0xa1068, .halt_reg = 0xa1068,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0xa1068, .hwcg_reg = 0xa1068,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
...@@ -5327,7 +5327,7 @@ static struct clk_regmap_mux gcc_usb3_tert_phy_pipe_clk_src = { ...@@ -5327,7 +5327,7 @@ static struct clk_regmap_mux gcc_usb3_tert_phy_pipe_clk_src = {
static struct clk_branch gcc_usb3_tert_phy_pipe_clk = { static struct clk_branch gcc_usb3_tert_phy_pipe_clk = {
.halt_reg = 0xa2068, .halt_reg = 0xa2068,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0xa2068, .hwcg_reg = 0xa2068,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
...@@ -5405,7 +5405,7 @@ static struct clk_branch gcc_usb4_0_master_clk = { ...@@ -5405,7 +5405,7 @@ static struct clk_branch gcc_usb4_0_master_clk = {
static struct clk_branch gcc_usb4_0_phy_p2rr2p_pipe_clk = { static struct clk_branch gcc_usb4_0_phy_p2rr2p_pipe_clk = {
.halt_reg = 0x9f0d8, .halt_reg = 0x9f0d8,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x9f0d8, .enable_reg = 0x9f0d8,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5418,7 +5418,7 @@ static struct clk_branch gcc_usb4_0_phy_p2rr2p_pipe_clk = { ...@@ -5418,7 +5418,7 @@ static struct clk_branch gcc_usb4_0_phy_p2rr2p_pipe_clk = {
static struct clk_branch gcc_usb4_0_phy_pcie_pipe_clk = { static struct clk_branch gcc_usb4_0_phy_pcie_pipe_clk = {
.halt_reg = 0x9f048, .halt_reg = 0x9f048,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52010, .enable_reg = 0x52010,
.enable_mask = BIT(19), .enable_mask = BIT(19),
...@@ -5457,7 +5457,7 @@ static struct clk_branch gcc_usb4_0_phy_rx1_clk = { ...@@ -5457,7 +5457,7 @@ static struct clk_branch gcc_usb4_0_phy_rx1_clk = {
static struct clk_branch gcc_usb4_0_phy_usb_pipe_clk = { static struct clk_branch gcc_usb4_0_phy_usb_pipe_clk = {
.halt_reg = 0x9f0a4, .halt_reg = 0x9f0a4,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0x9f0a4, .hwcg_reg = 0x9f0a4,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
...@@ -5582,7 +5582,7 @@ static struct clk_branch gcc_usb4_1_master_clk = { ...@@ -5582,7 +5582,7 @@ static struct clk_branch gcc_usb4_1_master_clk = {
static struct clk_branch gcc_usb4_1_phy_p2rr2p_pipe_clk = { static struct clk_branch gcc_usb4_1_phy_p2rr2p_pipe_clk = {
.halt_reg = 0x2b0d8, .halt_reg = 0x2b0d8,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x2b0d8, .enable_reg = 0x2b0d8,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5595,7 +5595,7 @@ static struct clk_branch gcc_usb4_1_phy_p2rr2p_pipe_clk = { ...@@ -5595,7 +5595,7 @@ static struct clk_branch gcc_usb4_1_phy_p2rr2p_pipe_clk = {
static struct clk_branch gcc_usb4_1_phy_pcie_pipe_clk = { static struct clk_branch gcc_usb4_1_phy_pcie_pipe_clk = {
.halt_reg = 0x2b048, .halt_reg = 0x2b048,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52028, .enable_reg = 0x52028,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5634,7 +5634,7 @@ static struct clk_branch gcc_usb4_1_phy_rx1_clk = { ...@@ -5634,7 +5634,7 @@ static struct clk_branch gcc_usb4_1_phy_rx1_clk = {
static struct clk_branch gcc_usb4_1_phy_usb_pipe_clk = { static struct clk_branch gcc_usb4_1_phy_usb_pipe_clk = {
.halt_reg = 0x2b0a4, .halt_reg = 0x2b0a4,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0x2b0a4, .hwcg_reg = 0x2b0a4,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
...@@ -5759,7 +5759,7 @@ static struct clk_branch gcc_usb4_2_master_clk = { ...@@ -5759,7 +5759,7 @@ static struct clk_branch gcc_usb4_2_master_clk = {
static struct clk_branch gcc_usb4_2_phy_p2rr2p_pipe_clk = { static struct clk_branch gcc_usb4_2_phy_p2rr2p_pipe_clk = {
.halt_reg = 0x110d8, .halt_reg = 0x110d8,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x110d8, .enable_reg = 0x110d8,
.enable_mask = BIT(0), .enable_mask = BIT(0),
...@@ -5772,7 +5772,7 @@ static struct clk_branch gcc_usb4_2_phy_p2rr2p_pipe_clk = { ...@@ -5772,7 +5772,7 @@ static struct clk_branch gcc_usb4_2_phy_p2rr2p_pipe_clk = {
static struct clk_branch gcc_usb4_2_phy_pcie_pipe_clk = { static struct clk_branch gcc_usb4_2_phy_pcie_pipe_clk = {
.halt_reg = 0x11048, .halt_reg = 0x11048,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52028, .enable_reg = 0x52028,
.enable_mask = BIT(1), .enable_mask = BIT(1),
...@@ -5811,7 +5811,7 @@ static struct clk_branch gcc_usb4_2_phy_rx1_clk = { ...@@ -5811,7 +5811,7 @@ static struct clk_branch gcc_usb4_2_phy_rx1_clk = {
static struct clk_branch gcc_usb4_2_phy_usb_pipe_clk = { static struct clk_branch gcc_usb4_2_phy_usb_pipe_clk = {
.halt_reg = 0x110a4, .halt_reg = 0x110a4,
.halt_check = BRANCH_HALT_VOTED, .halt_check = BRANCH_HALT_SKIP,
.hwcg_reg = 0x110a4, .hwcg_reg = 0x110a4,
.hwcg_bit = 1, .hwcg_bit = 1,
.clkr = { .clkr = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment