aboutsummaryrefslogtreecommitdiff
path: root/drivers/interconnect/qcom
AgeCommit message (Collapse)Author
2023-04-20Merge remote-tracking branch 'rb2/tracking-rb2' into integration-linux-qcomltintegration-linux-qcomlt-20230423-193711-v6.3-rc7-358-gabc3b57af1634cLinaro CI
# Conflicts: # Documentation/devicetree/bindings/arm/qcom.yaml # arch/arm64/boot/dts/qcom/Makefile
2023-04-20interconnect: qcom: Add SM6115 interconnect provider driverBhupesh Sharma
Add driver for the Qualcomm interconnect buses found in SM6115 based platforms. The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs. Cc: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
2023-04-19[HACK] Push DDR to FMAX frequency at bootKonrad Dybcio
2023-03-13interconnect: qcom: msm8974: fix registration raceJohan Hovold
The current interconnect provider registration interface is inherently racy as nodes are not added until the after adding the provider. This can specifically cause racing DT lookups to fail. Switch to using the new API where the provider is not registered until after it has been fully initialised. Fixes: 4e60a9568dc6 ("interconnect: qcom: add msm8974 driver") Cc: stable@vger.kernel.org # 5.5 Reviewed-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-12-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-13interconnect: qcom: rpmh: fix registration raceJohan Hovold
The current interconnect provider registration interface is inherently racy as nodes are not added until the after adding the provider. This can specifically cause racing DT lookups to fail. Switch to using the new API where the provider is not registered until after it has been fully initialised. Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support") Cc: stable@vger.kernel.org # 5.7 Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-11-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-13interconnect: qcom: rpmh: fix probe child-node error handlingJohan Hovold
Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: 57eb14779dfd ("interconnect: qcom: icc-rpmh: Support child NoC device probe") Cc: stable@vger.kernel.org # 6.0 Cc: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-10-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-13interconnect: qcom: rpm: fix registration raceJohan Hovold
The current interconnect provider registration interface is inherently racy as nodes are not added until the after adding the provider. This can specifically cause racing DT lookups to fail. Switch to using the new API where the provider is not registered until after it has been fully initialised. Fixes: 62feb14ee8a3 ("interconnect: qcom: Consolidate interconnect RPM support") Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Cc: stable@vger.kernel.org # 5.7 Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-9-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-07interconnect: qcom: rpm: fix probe child-node error handlingJohan Hovold
Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: e39bf2972c6e ("interconnect: icc-rpm: Support child NoC device probe") Cc: stable@vger.kernel.org # 5.17 Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-7-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-07interconnect: qcom: osm-l3: fix registration raceJohan Hovold
The current interconnect provider registration interface is inherently racy as nodes are not added until the after adding the provider. This can specifically cause racing DT lookups to fail: of_icc_xlate_onecell: invalid index 0 cpu cpu0: error -EINVAL: error finding src node cpu cpu0: dev_pm_opp_of_find_icc_paths: Unable to get path0: -22 qcom-cpufreq-hw: probe of 18591000.cpufreq failed with error -22 Switch to using the new API where the provider is not registered until after it has been fully initialised. Fixes: 5bc9900addaf ("interconnect: qcom: Add OSM L3 interconnect provider support") Cc: stable@vger.kernel.org # 5.7 Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230306075651.2449-6-johan+linaro@kernel.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-06interconnect: qcom: qcm2290: Fix MASTER_SNOC_BIMC_NRTKonrad Dybcio
Due to what seems to be a copy-paste error, the _NRT master was identical to the _RT master, which should not be the case.. Fix it using the values available from the downstream kernel [1]. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/scuba-bus.dtsi#127 Fixes: 1a14b1ac3935 ("interconnect: qcom: Add QCM2290 driver support") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Link: https://lore.kernel.org/r/20230103142120.15605-1-konrad.dybcio@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-06interconnect: qcom: sm8550: switch to qcom_icc_rpmh_* functionDmitry Baryshkov
Change sm8550 interconnect driver to use generic qcom_icc_rpmh_* functions rather than embedding a copy of thema. This also fixes an overallocation of memory for icc_onecell_data structure. Fixes: e6f0d6a30f73 ("interconnect: qcom: Add SM8550 interconnect provider driver") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230105002221.1416479-4-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-06interconnect: qcom: sm8450: switch to qcom_icc_rpmh_* functionDmitry Baryshkov
Change sm8450 interconnect driver to use generic qcom_icc_rpmh_* functions rather than embedding a copy of thema. This also fixes an overallocation of memory for icc_onecell_data structure. Fixes: fafc114a468e ("interconnect: qcom: Add SM8450 interconnect provider driver") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230105002221.1416479-3-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-03-06interconnect: qcom: osm-l3: fix icc_onecell_data allocationDmitry Baryshkov
This is a struct with a trailing zero-length array of icc_node pointers but it's allocated as if it were a single array of icc_nodes instead. Fortunately this overallocates memory rather then allocating less memory than required. Fix by replacing devm_kcalloc() with devm_kzalloc() and struct_size() macro. Fixes: 5bc9900addaf ("interconnect: qcom: Add OSM L3 interconnect provider support") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230105002221.1416479-2-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-02-06Merge tag 'icc-6.3-rc1' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 6.3 Here are the interconnect changes for the 6.3-rc1 merge window with the significant part being new drivers. Driver changes: - New driver for Qualcomm SM8550 - New driver for Qualcomm QDU1000/QRU1000 - New driver for Qualcomm SDM670 - New driver for Qualcomm SA8775P - Drop the IP0 interconnects and migrate them to RPMh clocks instead - Misc improvements in the DT schema for some existing drivers Signed-off-by: Georgi Djakov <djakov@kernel.org> * tag 'icc-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: (25 commits) dt-bindings: interconnect: samsung,exynos-bus: allow opp-table dt-bindings: interconnect: qcom,sa8775p-rpmh: fix a typo dt-bindings: interconnect: Exclude all non msm8939 from snoc-mm interconnect: qcom: add a driver for sa8775p dt-bindings: interconnect: qcom: document the interconnects for sa8775p interconnect: qcom: add sdm670 interconnects dt-bindings: interconnect: add sdm670 interconnects dt-bindings: interconnect: OSM L3: Add SM6350 OSM L3 compatible dt-bindings: interconnect: qcom-bwmon: document SM8550 compatibles dt-bindings: interconnect: split SM8450 to own schema dt-bindings: interconnect: split SC8280XP to own schema dt-bindings: interconnect: split SC7280 to own schema dt-bindings: interconnect: qcom: drop IPA_CORE related defines dt-bindings: interconnect: qcom: Remove ipa-virt compatibles interconnect: qcom: sc8280xp: Drop IP0 interconnects interconnect: qcom: sc8180x: Drop IP0 interconnects interconnect: qcom: sm8250: Drop IP0 interconnects interconnect: qcom: sm8150: Drop IP0 interconnects interconnect: move ignore_list out of of_count_icc_providers() interconnect: qcom: sc7180: drop IP0 remnants ...
2023-02-06Merge branch 'icc-sa8775p' into icc-nextGeorgi Djakov
* icc-sa8775p dt-bindings: interconnect: qcom: document the interconnects for sa8775p interconnect: qcom: add a driver for sa8775p dt-bindings: interconnect: qcom,sa8775p-rpmh: fix a typo Link: https://lore.kernel.org/r/20230118140825.242544-2-brgl@bgdev.pl Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-02-06Merge branch 'icc-sdm670' into icc-nextGeorgi Djakov
* icc-sdm670 dt-bindings: interconnect: add sdm670 interconnects interconnect: qcom: add sdm670 interconnects Link: https://lore.kernel.org/r/20230111005155.50452-1-mailingradian@gmail.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-02-06Merge branch 'icc-ip0-migration' into icc-nextGeorgi Djakov
Commits 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects") and 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects") removed IP0 interconnects (and ipa-virt devices support) in favour of the RPMH clocks. Follow this example for other platforms defining IP0 RPMH resource. While we are at it, remove several leftover from the mentioned patches. * icc-ip0-migration: interconnect: qcom: sdx55: drop IP0 remnants interconnect: qcom: sc7180: drop IP0 remnants interconnect: move ignore_list out of of_count_icc_providers() interconnect: qcom: sm8150: Drop IP0 interconnects interconnect: qcom: sm8250: Drop IP0 interconnects interconnect: qcom: sc8180x: Drop IP0 interconnects interconnect: qcom: sc8280xp: Drop IP0 interconnects dt-bindings: interconnect: qcom: Remove ipa-virt compatibles dt-bindings: interconnect: qcom: drop IPA_CORE related defines Link: https://lore.kernel.org/r/20230109002935.244320-1-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-19interconnect: qcom: add a driver for sa8775pShazad Hussain
Introduce QTI SA8775P-specific interconnect driver. Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com> [Bartosz: made the driver ready for upstream] Co-developed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230118140825.242544-1-brgl@bgdev.pl Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-19interconnect: qcom: add sdm670 interconnectsRichard Acayan
The interconnects for Snapdragon 670 can be controlled via RPMh. Add driver support for this. This driver was generated by the linux-interconnect-driver-generator and the virtual NoC's were merged with their parents. Link: https://git.sr.ht/~z3ntu/linux-interconnect-driver-generator Signed-off-by: Richard Acayan <mailingradian@gmail.com> Link: https://lore.kernel.org/r/20230111005155.50452-3-mailingradian@gmail.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sc8280xp: Drop IP0 interconnectsDmitry Baryshkov
Similar to the sdx55 and sc7180, let's drop the MASTER_IPA_CORE and SLAVE_IPA_CORE interconnects for this platform. There are no actual users of this interconnect. The IP0 resource will be handled by clk-rpmh driver. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-8-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sc8180x: Drop IP0 interconnectsDmitry Baryshkov
Similar to the sdx55 and sc7180, let's drop the MASTER_IPA_CORE and SLAVE_IPA_CORE interconnects for this platofm. There are no actual users of this intercoonect. The IP0 resource will be handled by clk-rpmh driver. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-7-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sm8250: Drop IP0 interconnectsDmitry Baryshkov
Similar to the sdx55 and sc7180, let's drop the MASTER_IPA_CORE and SLAVE_IPA_CORE interconnects for this platform. There are no actual users of this interconnect. The IP0 resource will be handled by clk-rpmh driver. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-6-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sm8150: Drop IP0 interconnectsDmitry Baryshkov
Similar to the sdx55 and sc7180, let's drop the MASTER_IPA_CORE and SLAVE_IPA_CORE interconnects for this platform. There are no actual users of this interconnect. The IP0 resource will be handled by clk-rpmh driver. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-5-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sc7180: drop IP0 remnantsDmitry Baryshkov
Drop two defines leftover from the commit 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects"), which dropped handling of the IP0 resource in favour of handling it in the clk-rpmh driver. Fixes: 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-3-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-18interconnect: qcom: sdx55: drop IP0 remnantsDmitry Baryshkov
Drop two defines leftover from the commit 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects"), which dropped handling of the IP0 resource in favour of handling it in the clk-rpmh driver. Fixes: 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20230109002935.244320-2-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-05interconnect: qcom: rpm: Use _optional func for provider clocksKonrad Dybcio
It turned out that - very unfortunately - msm8996 needs a binding update, adding 2 more clocks to the A2NoC node. Use the _optional variant of devm_clk_get to make sure old DTs will still probe with newer versions of the driver. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> #db820c Link: https://lore.kernel.org/r/20221210200353.418391-5-konrad.dybcio@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-05interconnect: qcom: msm8996: Fix regmap max_register valuesKonrad Dybcio
The device tree reg starts at BUS_BASE + QoS_OFFSET, but the regmap configs in the ICC driver had values suggesting the reg started at BUS_BASE. Shrink them down (where they haven't been already, so for providers where QoS_OFFSET = 0) to make sure they stay within their window. Fixes: 7add937f5222 ("interconnect: qcom: Add MSM8996 interconnect provider driver") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> #db820c Link: https://lore.kernel.org/r/20221210200353.418391-4-konrad.dybcio@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-05interconnect: qcom: msm8996: Provide UFS clocks to A2NoCKonrad Dybcio
On eMMC devices the bootloader has no business enabling UFS clocks. That results in a platform hang and hard reboot when trying to vote on paths including MASTER_UFS and since sync_state guarantees that it's done at boot time, this effectively prevents such devices from booting. Fix that. Fixes: 7add937f5222 ("interconnect: qcom: Add MSM8996 interconnect provider driver") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> #db820c Link: https://lore.kernel.org/r/20221210200353.418391-3-konrad.dybcio@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-05Merge branch 'icc-qdu1000' into icc-nextGeorgi Djakov
Add dt bindings and driver support for the Qualcomm QDU1000 and QRU1000 SoCs. The Qualcomm Technologies, Inc. Distributed Unit 1000 and Radio Unit 1000 are new SoCs meant for enabling Open RAN solutions. See more at https://www.qualcomm.com/content/dam/qcomm-martech/dm-assets/documents/qualcomm_5g_ran_platforms_product_brief.pdf Link: https://lore.kernel.org/r/20221216230914.21771-1-quic_molvera@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-01-05interconnect: qcom: Add QDU1000/QRU1000 interconnect driverMelody Olvera
Add interconnect provider driver for Qualcomm QDU1000 and QRU1000 platforms. Signed-off-by: Melody Olvera <quic_molvera@quicinc.com> Link: https://lore.kernel.org/r/20221216230914.21771-3-quic_molvera@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-12-29interconnect: qcom: Add SM8550 interconnect provider driverAbel Vesa
Add driver for the Qualcomm interconnect buses found in SM8550 based platforms. The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs. Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Link: https://lore.kernel.org/r/20221202232054.2666830-3-abel.vesa@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-17Merge branch 'icc-sc8280xp-l3' into icc-nextGeorgi Djakov
The SC8280XP currently shows depressing results in memory benchmarks. Fix this by introducing support for the platform in the OSM (and EPSS) L3 driver and support for the platform in the bwmon binding. Link: https://lore.kernel.org/r/20221111032515.3460-1-quic_bjorande@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-17interconnect: qcom: sc8180x: constify pointer to qcom_icc_nodeKrzysztof Kozlowski
Pointers to struct qcom_icc_node are const. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221027154848.293523-3-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-17interconnect: qcom: sc7180: drop double spaceKrzysztof Kozlowski
Drop double white-space. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221027154848.293523-2-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-17interconnect: qcom: sc7180: fix dropped const of qcom_icc_bcmKrzysztof Kozlowski
Pointers to struct qcom_icc_bcm are const, but the change was dropped during merge. Fixes: 016fca59f95f ("Merge branch 'icc-const' into icc-next") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221027154848.293523-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-17interconnect: qcom: icc-rpm: Remove redundant dev_err callShang XiaoJing
devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220924015043.25130-1-shangxiaojing@huawei.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-14interconnect: qcom: osm-l3: Simplify osm_l3_set()Bjorn Andersson
The aggregation over votes for all nodes in the provider will always only find the bandwidth votes for the destination side of the path. Further more, the average kBps value will always be 0. Simplify the logic by directly looking at the destination node's peak bandwidth request. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Steev Klimaszewski <steev@kali.org> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Link: https://lore.kernel.org/r/20221111032515.3460-5-quic_bjorande@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-14interconnect: qcom: osm-l3: Add per-core EPSS L3 supportBjorn Andersson
The EPSS instance in e.g. SM8350 and SC8280XP has per-core L3 voting enabled. In this configuration, the "shared" vote is done using the REG_L3_VOTE register instead of PERF_STATE. Rename epss_l3 to clarify that it's affecting the PERF_STATE register and add a new L3_VOTE description. Given platform lineage it's assumed that the L3_VOTE-based case will be the predominant one, so use this for a new generic qcom,epss-l3 compatible. While adding the EPSS generic, also add qcom,osm-l3. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Steev Klimaszewski <steev@kali.org> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Link: https://lore.kernel.org/r/20221111032515.3460-4-quic_bjorande@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-14interconnect: qcom: osm-l3: Squash common descriptorsBjorn Andersson
Each platform defines their own OSM L3 descriptor, but in practice there's only two: one for OSM and one for EPSS. Remove the duplicated definitions. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Steev Klimaszewski <steev@kali.org> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Link: https://lore.kernel.org/r/20221111032515.3460-3-quic_bjorande@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-11-14interconnect: qcom: osm-l3: Use platform-independent node idsBjorn Andersson
The identifiers used for nodes needs to be unique in the running system, but defining them per platform results in a lot of duplicated definitions and prevents us from using generic compatibles. As these identifiers are not exposed outside the kernel, change to use driver-local numbers, picked completely at random. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Steev Klimaszewski <steev@kali.org> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Link: https://lore.kernel.org/r/20221111032515.3460-2-quic_bjorande@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-09-20Merge branch 'icc-ignore-return-val' into icc-nextGeorgi Djakov
Today remove callbacks of platform devices return an int. This is unfortunate because the device core ignores the return value and so the platform code only emits a warning (and still removes the device). The longterm quest is to make these remove callbacks return void instead. This series is a preparation for that, with the goal to make the remove callbacks obviously always return 0. This way when the prototype of these functions is changed to return void, the change is straight forward and easy to review. Link: https://lore.kernel.org/r/20220718121409.171773-1-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-09-20interconnect: qcom: Kconfig: Make INTERCONNECT_QCOM tristateHuang Yiwei
Make INTERCONNECT_QCOM tristate so that icc-common.c can be compiled as a module. Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20220914064122.16222-1-quic_hyiwei@quicinc.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-08-16interconnect: sm8450: Ignore return value of icc_provider_del() in .remove()Uwe Kleine-König
icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220718121409.171773-7-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-08-16interconnect: osm-l3: Ignore return value of icc_provider_del() in .remove()Uwe Kleine-König
icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220718121409.171773-6-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-08-16interconnect: msm8974: Ignore return value of icc_provider_del() in .remove()Uwe Kleine-König
icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220718121409.171773-5-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-08-16interconnect: icc-rpmh: Ignore return value of icc_provider_del() in .remove()Uwe Kleine-König
icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220718121409.171773-4-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-08-16interconnect: icc-rpm: Ignore return value of icc_provider_del() in .remove()Uwe Kleine-König
icc_provider_del() already emits an error message on failure. In this case letting .remove() return the corresponding error code results in another error message and the device is removed anyhow. (See platform_remove().) So ignore the return value of icc_provider_del() and return 0 unconditionally. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220718121409.171773-3-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-07-15Merge branch 'icc-rpm' into icc-nextGeorgi Djakov
This patch set is to support bucket in icc-rpm driver, so it implements the similar mechanism in the icc-rpmh driver. It uses interconnect path tag to indicate the bandwidth voting is for which buckets, and there have three kinds of buckets: AWC, WAKE and SLEEP, finally the wake and sleep bucket values are used to set the corresponding clock (active and sleep clocks). So far, we keep the AWC bucket but doesn't really use it. Link: https://lore.kernel.org/r/20220712015929.2789881-1-leo.yan@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-07-12interconnect: qcom: icc-rpm: Set bandwidth and clock for bucket valuesLeo Yan
This commit uses buckets for support bandwidth and clock rates. It introduces a new function qcom_icc_bus_aggregate() to calculate the aggregate average and peak bandwidths for every bucket, and also it calculates the maximum value of aggregated average bandwidth across all buckets. The maximum aggregated average is used to calculate the final bandwidth requests. And we can set the clock rate per bucket, we use SLEEP bucket as default bucket if a platform doesn't enable the interconnect path tags in DT binding; otherwise, we use WAKE bucket to set active clock and use SLEEP bucket for other clocks. So far we don't use AMC bucket. Signed-off-by: Leo Yan <leo.yan@linaro.org> Link: https://lore.kernel.org/r/20220712015929.2789881-6-leo.yan@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
2022-07-12interconnect: qcom: icc-rpm: Support multiple bucketsLeo Yan
The current interconnect rpm driver uses a single aggregate bandwidth to calculate the clock rates for both active and sleep clocks; therefore, it has no chance to separate bandwidth requests for these two kinds of clocks. This patch studies the implementation from interconnect rpmh driver to support multiple buckets. The rpmh driver provides three buckets for AMC, WAKE, and SLEEP; this driver only needs to use WAKE and SLEEP buckets, but we keep the same way with rpmh driver, this can allow us to reuse the DT binding and avoid to define duplicated data structures. This patch introduces two callbacks: qcom_icc_pre_bw_aggregate() is used to clean up bucket values before aggregate bandwidth requests, and qcom_icc_bw_aggregate() is to aggregate bandwidth for buckets. Signed-off-by: Leo Yan <leo.yan@linaro.org> Link: https://lore.kernel.org/r/20220712015929.2789881-5-leo.yan@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>