Konrad Dybcio
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Konrad Dybcio
11f63efe58
interconnect: qcom: icc-rpm: Control bus rpmcc from icc
...
The sole purpose of bus clocks that were previously registered with
rpmcc was to convey the aggregated bandwidth to RPM. There's no good
reason to keep them outside the interconnect framework, as it only
adds to the plentiful complexity.
Add the required code to handle these clocks from within SMD RPM ICC.
RPM-owned bus clocks are no longer considered a thing, but sadly we
have to allow for the existence of HLOS-owned bus clocks, as some
(mostly older) SoCs (ab)use these for bus scaling (e.g. MSM8998 and
&mmcc AHB_CLK_SRC).
This in turn is trivially solved with a single *clk, which is filled
and used iff qp.bus_clk_desc is absent and we have a "bus" clock-names
entry in the DT node.
This change should(tm) be fully compatible with all sorts of old
Device Trees as far as the interconnect functionality goes (modulo
abusing bus clock handles or wrongly using the qcom,icc.h binding,
but that's a mistake in and of itself).
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-17-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
9d0a282c3e
interconnect: qcom: qcm2290: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-16-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
6424985ede
interconnect: qcom: msm8916: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
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-15-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
258a64f266
interconnect: qcom: msm8939: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
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-14-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
a923b8bbeb
interconnect: qcom: qcs404: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-13-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
9258801ef9
interconnect: qcom: msm8996: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
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-12-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:45 -07:00
Konrad Dybcio
70ab8dee97
interconnect: qcom: sdm660: Hook up RPM bus clk definitions
...
Assign the necessary definitions to migrate to the new bus clock
handling mechanism.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-11-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Konrad Dybcio
918b86042b
interconnect: qcom: Define RPM bus clocks
...
Add the definitions for RPM bus clocks that will be used by many
different platforms.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-10-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Konrad Dybcio
a927eb09d4
interconnect: qcom: smd-rpm: Add rpmcc handling skeleton code
...
Introduce qcom_icc_rpm_set_bus_rate() in preparation for handling RPM
clock resources within the interconnect framework. This lets us greatly
simplify all of the code handling, as setting the rate comes down to:
u32 rate_khz = max(clk.sleep_rate, clk.active_rate, clk_a.active_rate)
write_to_rpm(clock.description, rate_khz);
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-9-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Konrad Dybcio
19ced2aec6
interconnect: qcom: Fold smd-rpm.h into icc-rpm.h
...
smd-rpm.h is not very useful as-is and both files are always included
anyway.. Combine them.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-8-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Konrad Dybcio
40cdeed669
interconnect: qcom: Add missing headers in icc-rpm.h
...
Currently the header does not provide all the required dependencies.
Fix it.
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-7-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Konrad Dybcio
b979049c38
interconnect: qcom: icc-rpm: Introduce keep_alive
...
The downstream kernel employs the concept of "keeping the bus alive"
by voting for the minimum (XO/19.2MHz) rate at all times on certain
(well, most) buses. This is a very important thing to have, as if we
either have a lackluster/wrong DT that doesn't specify a (high enough)
vote on a certain bus, we may lose access to the entire bus altogether.
This is very apparent when we only start introducing interconnect
support on a given platform and haven't yet introduced voting on all
peripherals.
The same can happen if we only have a single driver casting a vote on
a certain bus and that driver exits/crashes/suspends.
The keepalive vote is limited to the ACTIVE bucket, as keeping a
permanent vote on the SLEEP one could prevent the platform from properly
entering low power mode states.
Introduce the very same concept, with a slight twist: the vendor
kernel checks whether the rate is zero before setting the minimum
vote, but that's rather silly, as in doing so we're at the mercy
of CCF. Instead, explicitly clamp the rates to always be >= 19.2 MHz
for providers with keep_alive=true.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
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-6-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-07-15 09:54:44 -07:00
Neil Armstrong
3cb11fe244
interconnect: qcom: sa8775p: add enable_mask for bcm nodes
...
Set the proper enable_mask the ACV node requiring such value
to be used instead of a bandwidth when voting.
The masks was copied from the downstream implementation at [1].
[1] https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/blob/kernel.lnx.5.15.r32-rel/drivers/interconnect/qcom/lemans.c
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-4-709474b151cc@linaro.org
Fixes: 3655a63f96 ("interconnect: qcom: add a driver for sa8775p")
Signed-off-by: Georgi Djakov <djakov@kernel.org >
2023-07-11 15:44:43 +03:00