1. 09 Jul, 2024 1 commit
    • Stephen Boyd's avatar
      Merge tag 'qcom-clk-for-6.11-2' of... · 691a0180
      Stephen Boyd authored
      Merge tag 'qcom-clk-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
      
      Pull more qcom clk driver updates from Bjorn Andersson:
      
       - Introduces helper logic to expose clock controllers as simple
         interconnect providers
       - Use the interconnect helper above on Qualcomm ipq9574
       - Add CLK_SET_RATE_PARENT to the remaining USB pipe clocks on Qualcomm
         X1Elite.
       - Improve error handling in Qualcomm kpss-xcc driver
       - Mark Qualcomm SC8280XP LPASS clock controller regmap_config const
      
      * tag 'qcom-clk-for-6.11-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
        clk: qcom: ipq9574: Use icc-clk for enabling NoC related clocks
        clk: qcom: common: Add interconnect clocks support
        interconnect: icc-clk: Add devm_icc_clk_register
        interconnect: icc-clk: Specify master/slave ids
        dt-bindings: clock: qcom: Add AHB clock for SM8150
        clk: qcom: gcc-x1e80100: Set parent rate for USB3 sec and tert PHY pipe clks
        dt-bindings: interconnect: Add Qualcomm IPQ9574 support
        clk: qcom: kpss-xcc: Return of_clk_add_hw_provider to transfer the error
        clk: qcom: lpasscc-sc8280xp: Constify struct regmap_config
      691a0180
  2. 08 Jul, 2024 9 commits
    • Stephen Boyd's avatar
      clk: qcom: Park shared RCGs upon registration · 01a0a6cc
      Stephen Boyd authored
      There's two problems with shared RCGs.
      
      The first problem is that they incorrectly report the parent after
      commit 703db1f5 ("clk: qcom: rcg2: Cache CFG register updates for
      parked RCGs"). That's because the cached CFG register value needs to be
      populated when the clk is registered. clk_rcg2_shared_enable() writes
      the cached CFG register value 'parked_cfg'. This value is initially zero
      due to static initializers. If a driver calls clk_enable() before
      setting a rate or parent, it will set the parent to '0' which is
      (almost?) always XO, and may not reflect the parent at registration. In
      the worst case, this switches the RCG from sourcing a fast PLL to the
      slow crystal speed.
      
      The second problem is that the force enable bit isn't cleared. The force
      enable bit is only used during parking and unparking of shared RCGs.
      Otherwise it shouldn't be set because it keeps the RCG enabled even when
      all the branches on the output of the RCG are disabled (the hardware has
      a feedback mechanism so that any child branches keep the RCG enabled
      when the branch enable bit is set). This problem wastes power if the clk
      is unused, and is harmful in the case that the clk framework disables
      the parent of the force enabled RCG. In the latter case, the GDSC the
      shared RCG is associated with will get wedged if the RCG's source clk is
      disabled and the GDSC tries to enable the RCG to do "housekeeping" while
      powering on.
      
      Both of these problems combined with incorrect runtime PM usage in the
      display driver lead to a black screen on Qualcomm sc7180 Trogdor
      chromebooks. What happens is that the bootloader leaves the
      'disp_cc_mdss_rot_clk' enabled and the 'disp_cc_mdss_rot_clk_src' force
      enabled and parented to 'disp_cc_pll0'. The mdss driver probes and
      runtime suspends, disabling the mdss_gdsc which uses the
      'disp_cc_mdss_rot_clk_src' for "housekeeping". The
      'disp_cc_mdss_rot_clk' is disabled during late init because the clk is
      unused, but the parent 'disp_cc_mdss_rot_clk_src' is still force enabled
      because the force enable bit was never cleared. Then 'disp_cc_pll0' is
      disabled because it is also unused. That's because the clk framework
      believes the parent of the RCG is XO when it isn't. A child device of
      the mdss device (e.g. DSI) runtime resumes mdss which powers on the
      mdss_gdsc. This wedges the GDSC because 'disp_cc_mdss_rot_clk_src' is
      parented to 'disp_cc_pll0' and that PLL is off. With the GDSC wedged,
      mdss_runtime_resume() tries to enable 'disp_cc_mdss_mdp_clk' but it
      can't because the GDSC has wedged all the clks associated with the GDSC
      causing clks to stay stuck off.
      
      This leads to the following warning seen at boot and a black screen
      because the display driver fails to probe.
      
       disp_cc_mdss_mdp_clk status stuck at 'off'
       WARNING: CPU: 1 PID: 81 at drivers/clk/qcom/clk-branch.c:87 clk_branch_toggle+0x114/0x168
       Modules linked in:
       CPU: 1 PID: 81 Comm: kworker/u16:4 Not tainted 6.7.0-g0dd3ee31 #1 f5757d475795053fd2ad52247a070cd50dd046f2
       Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
       Workqueue: events_unbound deferred_probe_work_func
       pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
       pc : clk_branch_toggle+0x114/0x168
       lr : clk_branch_toggle+0x110/0x168
       sp : ffffffc08084b670
       pmr_save: 00000060
       x29: ffffffc08084b680 x28: ffffff808006de00 x27: 0000000000000001
       x26: ffffff8080dbd4f4 x25: 0000000000000000 x24: 0000000000000000
       x23: 0000000000000000 x22: ffffffd838461198 x21: ffffffd838007997
       x20: ffffffd837541d5c x19: 0000000000000001 x18: 0000000000000004
       x17: 0000000000000000 x16: 0000000000000010 x15: ffffffd837070fac
       x14: 0000000000000003 x13: 0000000000000004 x12: 0000000000000001
       x11: c0000000ffffdfff x10: ffffffd838347aa0 x9 : 08dadf92e516c000
       x8 : 08dadf92e516c000 x7 : 0000000000000000 x6 : 0000000000000027
       x5 : ffffffd8385a61f2 x4 : 0000000000000000 x3 : ffffffc08084b398
       x2 : ffffffc08084b3a0 x1 : 00000000ffffdfff x0 : 00000000fffffff0
       Call trace:
        clk_branch_toggle+0x114/0x168
        clk_branch2_enable+0x24/0x30
        clk_core_enable+0x5c/0x1c8
        clk_enable+0x38/0x58
        clk_bulk_enable+0x40/0xb0
        mdss_runtime_resume+0x68/0x258
        pm_generic_runtime_resume+0x30/0x44
        __genpd_runtime_resume+0x30/0x80
        genpd_runtime_resume+0x124/0x214
        __rpm_callback+0x7c/0x15c
        rpm_callback+0x30/0x88
        rpm_resume+0x390/0x4d8
        rpm_resume+0x43c/0x4d8
        __pm_runtime_resume+0x54/0x98
        __device_attach+0xe0/0x170
        device_initial_probe+0x1c/0x28
        bus_probe_device+0x48/0xa4
        device_add+0x52c/0x6fc
        mipi_dsi_device_register_full+0x104/0x1a8
        devm_mipi_dsi_device_register_full+0x28/0x78
        ti_sn_bridge_probe+0x1dc/0x2bc
        auxiliary_bus_probe+0x4c/0x94
        really_probe+0xf8/0x270
        __driver_probe_device+0xa8/0x130
        driver_probe_device+0x44/0x104
        __device_attach_driver+0xa4/0xcc
        bus_for_each_drv+0x94/0xe8
        __device_attach+0xf8/0x170
        device_initial_probe+0x1c/0x28
        bus_probe_device+0x48/0xa4
        deferred_probe_work_func+0x9c/0xd8
      
      Fix these problems by parking shared RCGs at boot. This will properly
      initialize the parked_cfg struct member so that the parent is reported
      properly and ensure that the clk won't get stuck on or off because the
      RCG is parented to the safe source (XO).
      
      Fixes: 703db1f5 ("clk: qcom: rcg2: Cache CFG register updates for parked RCGs")
      Reported-by: default avatarStephen Boyd <sboyd@kernel.org>
      Closes: https://lore.kernel.org/r/1290a5a0f7f584fcce722eeb2a1fd898.sboyd@kernel.org
      Closes: https://issuetracker.google.com/319956935Reported-by: default avatarLaura Nao <laura.nao@collabora.com>
      Closes: https://lore.kernel.org/r/20231218091806.7155-1-laura.nao@collabora.com
      Cc: Bjorn Andersson <andersson@kernel.org>
      Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Cc: Douglas Anderson <dianders@chromium.org>
      Cc: Taniya Das <quic_tdas@quicinc.com>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Link: https://lore.kernel.org/r/20240502224703.103150-1-swboyd@chromium.orgReviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      01a0a6cc
    • Stephen Boyd's avatar
      Merge tag 'qcom-clk-for-6.11' of... · ef0ae098
      Stephen Boyd authored
      Merge tag 'qcom-clk-for-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom
      
      Pull Qualcomm clk driver updates from Bjorn Andersson:
      
       - Add clk drivers for Qualcomm SM7150 camera, display and video
       - Add Qualcomm QCM2290 GPU clk driver
       - Add Qualcomm QCS8386/QCS8084 NSS clk driver
       - Add Qualcomm SM8650 camera and video drivers
       - Make qcom_cc_really_probe() take a struct device to allow reuse in
         non-platform-drivers
       - Introduce prepare-only branch clock ops in the qcom clk driver to
         support clocks on buses that take locks
       - Describe parent/child relationship for Qualcomm SC7280 camera GDSCs
       - Support Qualcomm Huayra 2290 alpha PLL
       - Adjust the highest SDCC clock frequency on Qualcomm IPQ6018 to match
         HS200 support
       - Add missing PCIe PIPE clocks on Qualcomm IPQ9574
       - Fix various configurations and properties in the Qualcomm SA8775P,
         X1E80100 and SM7280 drivers
       - Park Qualcomm SM8350 GPU RCGs on XO while disabled
       - Remove unused CONFIG_QCOM_RPMCC Kconfig symbol
       - Add missing MODULE_DESCRIPTIONs to some qcom clk drivers
      
      * tag 'qcom-clk-for-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (61 commits)
        clk: qcom: gcc-x1e80100: Fix halt_check for all pipe clocks
        clk: qcom: gcc-ipq6018: update sdcc max clock frequency
        clk: qcom: camcc-sm8650: Add SM8650 camera clock controller driver
        dt-bindings: clock: qcom: Add SM8650 camera clock controller
        dt-bindings: clock: qcom: Update the order of SC8280XP camcc header
        clk: qcom: videocc-sm8550: Add SM8650 video clock controller
        clk: qcom: videocc-sm8550: Add support for videocc XO clk ares
        dt-bindings: clock: qcom: Add SM8650 video clock controller
        dt-bindings: clock: qcom: Update SM8450 videocc header file name
        clk: qcom: gpucc-sa8775p: Update wait_val fields for GPU GDSC's
        clk: qcom: gpucc-sa8775p: Park RCG's clk source at XO during disable
        clk: qcom: gpucc-sa8775p: Remove the CLK_IS_CRITICAL and ALWAYS_ON flags
        clk: qcom: gcc-sa8775p: Set FORCE_MEM_CORE_ON for gcc_ufs_phy_ice_core_clk
        clk: qcom: gcc-sa8775p: Update the GDSC wait_val fields and flags
        clk: qcom: gcc-sa8775p: Remove support for UFS hw ctl clocks
        clk: qcom: gpucc-sm8350: Park RCG's clk source at XO during disable
        clk: qcom: nsscc-qca8k: Fix the MDIO functions undefined issue
        clk: qcom: select right config in CLK_QCM2290_GPUCC definition
        clk: qcom: Remove QCOM_RPMCC symbol
        clk: qcom: Add QCM2290 GPU clock controller driver
        ...
      ef0ae098
    • Varadarajan Narayanan's avatar
      clk: qcom: ipq9574: Use icc-clk for enabling NoC related clocks · 23711cab
      Varadarajan Narayanan authored
      Use the icc-clk framework to enable few clocks to be able to
      create paths and use the peripherals connected on those NoCs.
      Signed-off-by: default avatarVaradarajan Narayanan <quic_varada@quicinc.com>
      Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
      Link: https://lore.kernel.org/r/20240430064214.2030013-6-quic_varada@quicinc.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      23711cab
    • Varadarajan Narayanan's avatar
      clk: qcom: common: Add interconnect clocks support · 8737ec83
      Varadarajan Narayanan authored
      Unlike MSM platforms that manage NoC related clocks and scaling
      from RPM, IPQ SoCs dont involve RPM in managing NoC related
      clocks and there is no NoC scaling.
      
      However, there is a requirement to enable some NoC interface
      clocks for accessing the peripheral controllers present on
      these NoCs. Though exposing these as normal clocks would work,
      having a minimalistic interconnect driver to handle these clocks
      would make it consistent with other Qualcomm platforms resulting
      in common code paths. This is similar to msm8996-cbf's usage of
      icc-clk framework.
      Signed-off-by: default avatarVaradarajan Narayanan <quic_varada@quicinc.com>
      Link: https://lore.kernel.org/r/20240430064214.2030013-5-quic_varada@quicinc.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      8737ec83
    • Varadarajan Narayanan's avatar
      interconnect: icc-clk: Add devm_icc_clk_register · d3153113
      Varadarajan Narayanan authored
      Wrap icc_clk_register to create devm_icc_clk_register to be
      able to release the resources properly.
      Acked-by: default avatarGeorgi Djakov <djakov@kernel.org>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Signed-off-by: default avatarVaradarajan Narayanan <quic_varada@quicinc.com>
      Link: https://lore.kernel.org/r/20240430064214.2030013-4-quic_varada@quicinc.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      d3153113
    • Varadarajan Narayanan's avatar
      interconnect: icc-clk: Specify master/slave ids · f45b94ff
      Varadarajan Narayanan authored
      Presently, icc-clk driver autogenerates the master and slave ids.
      However, devices with multiple nodes on the interconnect could
      have other constraints and may not match with the auto generated
      node ids.
      
      Hence, modify the driver to use the master/slave ids provided by
      the caller instead of auto generating.
      
      Also, update clk-cbf-8996 accordingly.
      Acked-by: default avatarGeorgi Djakov <djakov@kernel.org>
      Signed-off-by: default avatarVaradarajan Narayanan <quic_varada@quicinc.com>
      Link: https://lore.kernel.org/r/20240430064214.2030013-2-quic_varada@quicinc.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      f45b94ff
    • Bjorn Andersson's avatar
      Merge branch '20240430064214.2030013-3-quic_varada@quicinc.com' into clk-for-6.11 · b3d57c55
      Bjorn Andersson authored
      Merge the IPQ9574 interconnect binding through a topic branch, to make
      it possible to use the constants in the DeviceTree source branch as
      well.
      b3d57c55
    • Satya Priya Kakitapalli's avatar
      dt-bindings: clock: qcom: Add AHB clock for SM8150 · 6a98844a
      Satya Priya Kakitapalli authored
      SM8150 videocc needs AHB clock, so update the bindings for sm8150
      to add the AHB clock.
      
      Fixes: df3f61d2 ("dt-bindings: clock: add SM8150 QCOM video clock bindings")
      Signed-off-by: default avatarSatya Priya Kakitapalli <quic_skakitap@quicinc.com>
      Link: https://lore.kernel.org/r/20240509-videocc-sm8150-dt-node-v4-1-e9617f65e946@quicinc.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      6a98844a
    • Abel Vesa's avatar
      clk: qcom: gcc-x1e80100: Set parent rate for USB3 sec and tert PHY pipe clks · 14539c88
      Abel Vesa authored
      Allow the USB3 second and third GCC PHY pipe clocks to propagate the
      rate to the pipe clocks provided by the QMP combo PHYs. The first
      instance is already doing that.
      
      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 avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://lore.kernel.org/r/20240530-x1e80100-clk-gcc-usb3-sec-tert-set-parent-rate-v1-1-7b2b04cad545@linaro.orgSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
      14539c88
  3. 06 Jul, 2024 3 commits
  4. 02 Jul, 2024 1 commit
  5. 26 Jun, 2024 3 commits
  6. 25 Jun, 2024 6 commits
  7. 23 Jun, 2024 7 commits
  8. 21 Jun, 2024 3 commits
  9. 13 Jun, 2024 7 commits