Yang Yingliang and Greg Kroah-Hartman
0967f1d9f1
interconnect: fix error handling in qnoc_probe()
...
[ Upstream commit 273f74a2e7 ]
Add missing clk_disable_unprepare() and clk_bulk_disable_unprepare()
in the error path in qnoc_probe(). And when qcom_icc_qos_set() fails,
it needs remove nodes and disable clks.
Fixes: 2e2113c8a6 ("interconnect: qcom: rpm: Handle interface clocks")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Link: https://lore.kernel.org/r/20230803130521.959487-1-yangyingliang@huawei.com
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Andy Shevchenko and Greg Kroah-Hartman
c39ab57032
interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS()
...
[ Upstream commit 577a3c5af1 ]
Replace custom and non-portable implementation of COUNT_ARGS().
Fixes: 5bc9900add ("interconnect: qcom: Add OSM L3 interconnect provider support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20230920154927.2090732-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
620cebaf87
interconnect: qcom: sm8350: Set ACV enable_mask
...
[ Upstream commit df1b8356a8 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: d26a566744 ("interconnect: qcom: Add SM8350 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-11-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
c2857e1757
interconnect: qcom: sm8250: Set ACV enable_mask
...
[ Upstream commit 9434c68961 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 6df5b34949 ("interconnect: qcom: Add SM8250 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-10-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
c164f5cad6
interconnect: qcom: sm8150: Set ACV enable_mask
...
[ Upstream commit 7ed4217640 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: a09b817c8b ("interconnect: qcom: Add SM8150 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-9-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
aa6f3ce1d9
interconnect: qcom: sm6350: Set ACV enable_mask
...
[ Upstream commit fe7a3abf41 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 6a6eff73a9 ("interconnect: qcom: Add SM6350 driver support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-8-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
a6fe66653f
interconnect: qcom: sdm845: Set ACV enable_mask
...
[ Upstream commit f8fe97a9fd ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: b5d2f74107 ("interconnect: qcom: Add sdm845 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-7-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
435b718301
interconnect: qcom: sdm670: Set ACV enable_mask
...
[ Upstream commit 7b85ea8b93 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 7e438e1887 ("interconnect: qcom: add sdm670 interconnects")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-6-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
263bde32bf
interconnect: qcom: sc8280xp: Set ACV enable_mask
...
[ Upstream commit 688ffb3dcf ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: f29dabda79 ("interconnect: qcom: Add SC8280XP interconnect provider")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-5-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
ddab041e39
interconnect: qcom: sc8180x: Set ACV enable_mask
...
[ Upstream commit 0fcaaed3ff ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 9c8c6bac1a ("interconnect: qcom: Add SC8180x providers")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-4-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
40d019b823
interconnect: qcom: sc7280: Set ACV enable_mask
...
[ Upstream commit 437b8e7fcd ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 46bdcac533 ("interconnect: qcom: Add SC7280 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-3-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:27 +01:00
Konrad Dybcio and Greg Kroah-Hartman
5eb5d9c43c
interconnect: qcom: sc7180: Set ACV enable_mask
...
[ Upstream commit 1ad83c4792 ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 2d1f95ab9f ("interconnect: qcom: Add SC7180 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-2-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:26 +01:00
Konrad Dybcio and Greg Kroah-Hartman
41936ddd14
interconnect: qcom: qdu1000: Set ACV enable_mask
...
[ Upstream commit 8517824f0e ]
ACV expects an enable_mask corresponding to the APPS RSC, fill it in.
Fixes: 1f51339f7d ("interconnect: qcom: Add QDU1000/QRU1000 interconnect driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-acv-v2-1-765ad70e539a@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:59:26 +01:00
Konrad Dybcio and Georgi Djakov
a18e26a58b
interconnect: qcom: icc-rpmh: Retire DEFINE_QBCM
...
This helper has no users anymore. Kill it with heavy fire.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-20-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:33 +03:00
Konrad Dybcio and Georgi Djakov
edd13c04ff
interconnect: qcom: sm8350: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-19-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:30 +03:00
Konrad Dybcio and Georgi Djakov
8e509d66df
interconnect: qcom: sm8250: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-18-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:28 +03:00
Konrad Dybcio and Georgi Djakov
670699a422
interconnect: qcom: sm8150: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-17-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:25 +03:00
Konrad Dybcio and Georgi Djakov
ab2c1cb574
interconnect: qcom: sm6350: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-16-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:23 +03:00
Konrad Dybcio and Georgi Djakov
de2ae887d3
interconnect: qcom: sdx65: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-15-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:20 +03:00
Konrad Dybcio and Georgi Djakov
37474b02d2
interconnect: qcom: sdx55: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-14-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:16 +03:00
Konrad Dybcio and Georgi Djakov
35f490c5e4
interconnect: qcom: sdm845: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-13-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:14 +03:00
Konrad Dybcio and Georgi Djakov
46cd2018c5
interconnect: qcom: sdm670: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-12-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:11 +03:00
Konrad Dybcio and Georgi Djakov
e451b2ea5a
interconnect: qcom: sc7180: Retire DEFINE_QBCM
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-11-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:08 +03:00
Konrad Dybcio and Georgi Djakov
b32968a84c
interconnect: qcom: icc-rpmh: Retire DEFINE_QNODE
...
This helper has no users anymore. Kill it with heavy fire.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-10-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:06 +03:00
Konrad Dybcio and Georgi Djakov
9e62ccde36
interconnect: qcom: sm8350: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-9-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:03 +03:00
Konrad Dybcio and Georgi Djakov
aaf7d02ff8
interconnect: qcom: sm8250: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-8-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:07:01 +03:00
Konrad Dybcio and Georgi Djakov
9533964b7b
interconnect: qcom: sm8150: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-7-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:57 +03:00
Konrad Dybcio and Georgi Djakov
5affec83c4
interconnect: qcom: sm6350: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-6-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:53 +03:00
Konrad Dybcio and Georgi Djakov
a5403ec675
interconnect: qcom: sdx65: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-5-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:50 +03:00
Konrad Dybcio and Georgi Djakov
55ac6a6867
interconnect: qcom: sdx55: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-4-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:48 +03:00
Konrad Dybcio and Georgi Djakov
664e80879d
interconnect: qcom: sdm845: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-3-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:44 +03:00
Konrad Dybcio and Georgi Djakov
99cb3e8098
interconnect: qcom: sdm670: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-2-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:06:41 +03:00
Konrad Dybcio and Georgi Djakov
ea168170cd
interconnect: qcom: sc7180: Retire DEFINE_QNODE
...
The struct definition macros are hard to read and compare, expand them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Link: https://lore.kernel.org/r/20230811-topic-icc_retire_macrosd-v1-1-c03aaeffc769@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 15:04:38 +03:00
Georgi Djakov
e0d855b576
Merge branch 'icc-enable-mask' into icc-next
...
As pointed out by Bjorn and Mike in [1], we can simplify the handling
of enable_mask-based BCMs. This series attempts to do so and fixes a bug
that snuck in.
Gave a quick spin on 8450, doesn't seem to have exploded.
[1] https://lore.kernel.org/linux-arm-msm/113b50f8-35f6-73fc-4fc9-302262927c5e@quicinc.com/
Link: https://lore.kernel.org/r/20230811-topic-icc_fix_1he-v2-0-0620af8ac133@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:49:38 +03:00
Konrad Dybcio and Georgi Djakov
1a70ca7154
interconnect: qcom: bcm-voter: Use enable_maks for keepalive voting
...
BCMs with an enable_mask expect to only have that specific value written
to them. The current implementation only works by miracle for BCMs with
enable mask == BIT(0), as the minimal vote we've been using so far just
so happens to be equal to that.
Use the correct value with keepalive voting.
Fixes: d8630f050d ("interconnect: qcom: Add support for mask-based BCMs")
Reported-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-icc_fix_1he-v2-2-0620af8ac133@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:43:56 +03:00
Konrad Dybcio and Georgi Djakov
a1f4170dec
interconnect: qcom: bcm-voter: Improve enable_mask handling
...
We don't need all the complex arithmetic for BCMs utilizing enable_mask,
as all we need to do is to determine whether there's any user (or
keepalive) asking for it to be on.
Separate the logic for such BCMs for a small speed boost.
Suggested-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230811-topic-icc_fix_1he-v2-1-0620af8ac133@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:39:24 +03:00
Konrad Dybcio and Georgi Djakov
16862f1b21
interconnect: qcom: sm8450: Enable sync_state
...
Enable sync_state on sm8450 so that the interconnect votes actually mean
anything and aren't just pinned to INT_MAX.
Fixes: fafc114a46 ("interconnect: qcom: Add SM8450 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Vinod Koul <vkoul@kernel.org >
Link: https://lore.kernel.org/r/20230811-topic-8450_syncstate-v1-1-69ae5552a18b@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:18:45 +03:00
Kees Cook and Georgi Djakov
dd4904f3b9
interconnect: qcom: Annotate struct icc_onecell_data with __counted_by
...
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct icc_onecell_data.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.
[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
Cc: Andy Gross <agross@kernel.org >
Cc: Bjorn Andersson <andersson@kernel.org >
Cc: Konrad Dybcio <konrad.dybcio@linaro.org >
Cc: Georgi Djakov <djakov@kernel.org >
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230817204215.never.916-kees@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:11:32 +03:00
Georgi Djakov
7bae882e00
Merge branch 'icc-qcm2290' into icc-next
...
This series contains fixes necessary for icc to behave correctly
on QCM2290.
* icc-qcm2290
interconnect: qcom: qcm2290: Enable keep_alive on all buses
interconnect: qcom: qcm2290: Enable sync state
Link: https://lore.kernel.org/r/20230720-topic-qcm2290_icc-v2-0-a2ceb9d3e713@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:02:15 +03:00
Georgi Djakov
a3dd14c0d0
Merge tag 'v6.5-rc6' into icc-next
...
The fixes that got merged into v6.5-rc6 are needed here.
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-22 01:00:45 +03:00
Konrad Dybcio and Georgi Djakov
4e048e9b7a
interconnect: qcom: qcm2290: Enable sync state
...
Enable the generic .sync_state callback to ensure there are no
outstanding votes that would waste power.
Generally one would need a bunch of interface clocks to access the QoS
registers when trying to go over all possible nodes during sync_state,
but QCM2290 surprisingly does not seem to require any such handling.
Fixes: 1a14b1ac39 ("interconnect: qcom: Add QCM2290 driver support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230720-topic-qcm2290_icc-v2-2-a2ceb9d3e713@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-04 13:44:57 +03:00
Konrad Dybcio and Georgi Djakov
ba86de8acc
interconnect: qcom: qcm2290: Enable keep_alive on all buses
...
QCM2290 expects all buses to be up at all times when the CPU is
active. Enable keep_alive on all of them to achieve that.
Fixes: 1a14b1ac39 ("interconnect: qcom: Add QCM2290 driver support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230720-topic-qcm2290_icc-v2-1-a2ceb9d3e713@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-08-04 13:44:05 +03:00
Georgi Djakov
10cb3abb99
Merge branch 'icc-sm8250-qup' into icc-next
...
SM8250 (like SM8150 but unlike all other QUP-equipped SoCs) doesn't
provide a qup-core path. Adjust the bindings and drivers as necessary,
and then describe the icc paths in the device tree. This makes it possible
for interconnect sync_state succeed so long as you don't use UFS.
* icc-sm8250-qup
dt-bindings: interconnect: qcom,rpmh: Add SM8250 QUP virt
dt-bindings: interconnect: qcom,sm8250: Add QUP virt
interconnect: qcom: sm8250: Fix QUP0 nodes
Link: https://lore.kernel.org/r/20230703-topic-8250_qup_icc-v2-0-9ba0a9460be2@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-07-18 11:18:53 +03:00
Konrad Dybcio and Georgi Djakov
cde2f928ae
interconnect: qcom: sm8250: Fix QUP0 nodes
...
The QUP0 BCM relates to some internal property of the QUPs, and should
be configured independently of the path to the QUP. In line with other
platforms expose QUP_CORE endpoints in order allow this configuration.
Fixes: 6df5b34949 ("interconnect: qcom: Add SM8250 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20230703-topic-8250_qup_icc-v2-3-9ba0a9460be2@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-07-18 11:16:48 +03:00
Georgi Djakov
c73e60e071
interconnect: qcom: icc-rpm: Explicitly return 0 at the end of the function
...
Fix the following smatch error:
drivers/interconnect/qcom/icc-rpm.c:243 qcom_icc_rpm_set() error: uninitialized symbol 'ret'.
Fixes: 32846c4a8f ("interconnect: qcom: icc-rpm: Set bandwidth on both contexts")
Reviewed-by: Stephan Gerhold <stephan@gerhold.net >
Link: https://lore.kernel.org/r/20230717125534.2455745-1-djakov@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-07-17 16:21:33 +03:00
Rob Herring and Georgi Djakov
cff66ace51
interconnect: Explicitly include correct DT includes
...
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.
Signed-off-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20230714174638.4058268-1-robh@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-07-16 18:27:27 +03:00
Konrad Dybcio and Bjorn Andersson
17fc623e0f
interconnect: qcom: icc-rpm: Fix bandwidth calculations
...
Up until now, we've been aggregating the bandwidth values and only
dividing them by the bus width of the source node. This was completely
wrong, as different nodes on a given path may (and usually do) have
varying bus widths. That in turn, resulted in the calculated clock rates
being completely bogus - usually they ended up being much higher, as
NoC_A<->NoC_B links are very wide.
Since we're not using the aggregate bandwidth value for anything other
than clock rate calculations, remodel qcom_icc_bus_aggregate() to
calculate the per-context clock rate for a given provider, taking into
account the bus width of every individual node.
Fixes: 30c8fa3ec6 ("interconnect: qcom: Add MSM8916 interconnect provider driver")
Reported-by: Stephan Gerhold <stephan@gerhold.net >
Reviewed-by: Stephan Gerhold <stephan@gerhold.net >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Acked-by: Georgi Djakov <djakov@kernel.org >
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-22-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio and Bjorn Andersson
3b7480106b
interconnect: qcom: icc-rpm: Set correct bandwidth through RPM bw req
...
Currently, we're setting the aggregated-on-provider bandwidth on each
node, individually. That is of course incorrect and results in far too
high votes. Use the correct values to ensure we're not wasting power.
Fixes: 30c8fa3ec6 ("interconnect: qcom: Add MSM8916 interconnect provider driver")
Reported-by: Stephan Gerhold <stephan@gerhold.net >
Reviewed-by: Stephan Gerhold <stephan@gerhold.net >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Acked-by: Georgi Djakov <djakov@kernel.org >
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-21-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio and Bjorn Andersson
32846c4a8f
interconnect: qcom: icc-rpm: Set bandwidth on both contexts
...
Up until now, for some reason we've only been setting bandwidth values
on the active-only context. That pretty much meant that RPM could lift
all votes when entering sleep mode. Or never sleep at all.
That in turn could potentially break things like USB wakeup, as the
connection between APSS and SNoC/PNoC would simply be dead.
Set the values appropriately.
Fixes: 30c8fa3ec6 ("interconnect: qcom: Add MSM8916 interconnect provider driver")
Reviewed-by: Stephan Gerhold <stephan@gerhold.net >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Acked-by: Georgi Djakov <djakov@kernel.org >
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-20-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio and Bjorn Andersson
6ed0e5e60e
interconnect: qcom: icc-rpm: Fix bucket number
...
SMD RPM only provides two buckets, one each for the active-only and
active-sleep RPM contexts. Use the correct constant to allocate and
operate on them.
This will make the qcom,icc.h header no longer work with this driver,
mostly because.. it was never meant to! The commit that introduced
bucket support to SMD RPM was trying to shove a square into a round
hole and it did not work out very well. That said, there are no
active users of SMD RPM ICC + qcom,icc.h, so that doesn't hurt.
Fixes: dcbce7b0a7 ("interconnect: qcom: icc-rpm: Support multiple buckets")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Stephan Gerhold <stephan@gerhold.net >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Acked-by: Georgi Djakov <djakov@kernel.org >
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-19-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00