mbox series

[00/28] interconnect: qcom: icc-rpmh: use NULL-terminated arrays and drop static IDs

Message ID 20250616-rework-icc-v1-0-bc1326294d71@oss.qualcomm.com
Headers show
Series interconnect: qcom: icc-rpmh: use NULL-terminated arrays and drop static IDs | expand

Message

Dmitry Baryshkov June 16, 2025, 12:28 a.m. UTC
Qualcomm interconnect code has been using .num_foo fields together with
the arrays embedded in the structure, which results in hard-to-notice
mistakes if .num_foo gets omitted or incorrect.

Rework RPMh interconnect code to use NULL-terminated arrays for the
dynamic IDs case (as now all the arrays contain only pointers) and,
while we are at it, rework all the drivers to use dynamic IDs and drop
static IDs code.

This series touches only RPMh interconnect drivers. Corresponding series
for RPM drivers will follow up shortly.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Dmitry Baryshkov (28):
      interconnect: qcom: sc8280xp: specify num_links for qnm_a1noc_cfg
      interconnect: qcom: sc8180x: specify num_nodes
      interconnect: qcom: rpmh: make nodes a NULL_terminated array
      interconnect: qcom: rpmh: make link_nodes a NULL_terminated array
      interconnect: qcom: sc7280: convert to dynamic IDs
      interconnect: qcom: sc8180x: convert to dynamic IDs
      interconnect: qcom: sc8280xp: convert to dynamic IDs
      interconnect: qcom: sdm845: convert to dynamic IDs
      interconnect: qcom: sm8250: convert to dynamic IDs
      interconnect: qcom: x1e80100: convert to dynamic IDs
      interconnect: qcom: qcs615: convert to dynamic IDs
      interconnect: qcom: qcs8300: convert to dynamic IDs
      interconnect: qcom: qdu1000: convert to dynamic IDs
      interconnect: qcom: sar2130p: convert to dynamic IDs
      interconnect: qcom: sc7180: convert to dynamic IDs
      interconnect: qcom: sdm670: convert to dynamic IDs
      interconnect: qcom: sdx55: convert to dynamic IDs
      interconnect: qcom: sdx65: convert to dynamic IDs
      interconnect: qcom: sdx75: convert to dynamic IDs
      interconnect: qcom: sm6350: convert to dynamic IDs
      interconnect: qcom: sm7150: convert to dynamic IDs
      interconnect: qcom: sm8150: convert to dynamic IDs
      interconnect: qcom: sm8350: convert to dynamic IDs
      interconnect: qcom: sm8450: convert to dynamic IDs
      interconnect: qcom: sm8550: convert to dynamic IDs
      interconnect: qcom: sm8650: convert to dynamic IDs
      interconnect: qcom: sm8750: convert to dynamic IDs
      interconnect: qcom: icc-rpmh: drop support for non-dynamic IDS

 drivers/interconnect/qcom/bcm-voter.c |    4 +-
 drivers/interconnect/qcom/icc-rpmh.c  |   20 +-
 drivers/interconnect/qcom/icc-rpmh.h  |   13 +-
 drivers/interconnect/qcom/qcs615.c    |  713 ++++++++-----------
 drivers/interconnect/qcom/qcs615.h    |  128 ----
 drivers/interconnect/qcom/qcs8300.c   |  911 +++++++++++-------------
 drivers/interconnect/qcom/qcs8300.h   |  177 -----
 drivers/interconnect/qcom/qdu1000.c   |  470 ++++++------
 drivers/interconnect/qcom/qdu1000.h   |   95 ---
 drivers/interconnect/qcom/sa8775p.c   |  493 ++++++-------
 drivers/interconnect/qcom/sar2130p.c  |  795 ++++++++-------------
 drivers/interconnect/qcom/sc7180.c    |  892 +++++++++++------------
 drivers/interconnect/qcom/sc7180.h    |  149 ----
 drivers/interconnect/qcom/sc7280.c    |  840 ++++++++++------------
 drivers/interconnect/qcom/sc7280.h    |  154 ----
 drivers/interconnect/qcom/sc8180x.c   | 1013 +++++++++++++-------------
 drivers/interconnect/qcom/sc8180x.h   |  179 -----
 drivers/interconnect/qcom/sc8280xp.c  | 1257 ++++++++++++++++-----------------
 drivers/interconnect/qcom/sc8280xp.h  |  209 ------
 drivers/interconnect/qcom/sdm670.c    |  712 +++++++++----------
 drivers/interconnect/qcom/sdm670.h    |  128 ----
 drivers/interconnect/qcom/sdm845.c    |  986 ++++++++++++--------------
 drivers/interconnect/qcom/sdm845.h    |  140 ----
 drivers/interconnect/qcom/sdx55.c     |  611 ++++++++--------
 drivers/interconnect/qcom/sdx55.h     |   70 --
 drivers/interconnect/qcom/sdx65.c     |  577 +++++++--------
 drivers/interconnect/qcom/sdx65.h     |   65 --
 drivers/interconnect/qcom/sdx75.c     |  498 ++++++-------
 drivers/interconnect/qcom/sdx75.h     |   97 ---
 drivers/interconnect/qcom/sm6350.c    |  838 +++++++++++-----------
 drivers/interconnect/qcom/sm6350.h    |  139 ----
 drivers/interconnect/qcom/sm7150.c    |  860 +++++++++++-----------
 drivers/interconnect/qcom/sm7150.h    |  140 ----
 drivers/interconnect/qcom/sm8150.c    |  930 ++++++++++++------------
 drivers/interconnect/qcom/sm8150.h    |  152 ----
 drivers/interconnect/qcom/sm8250.c    |  977 ++++++++++++-------------
 drivers/interconnect/qcom/sm8250.h    |  168 -----
 drivers/interconnect/qcom/sm8350.c    |  901 ++++++++++++-----------
 drivers/interconnect/qcom/sm8350.h    |  158 -----
 drivers/interconnect/qcom/sm8450.c    |  823 ++++++++++-----------
 drivers/interconnect/qcom/sm8450.h    |  169 -----
 drivers/interconnect/qcom/sm8550.c    |  683 ++++++++----------
 drivers/interconnect/qcom/sm8550.h    |  138 ----
 drivers/interconnect/qcom/sm8650.c    |  713 ++++++++-----------
 drivers/interconnect/qcom/sm8650.h    |  144 ----
 drivers/interconnect/qcom/sm8750.c    |  779 ++++++++------------
 drivers/interconnect/qcom/x1e80100.c  |  819 ++++++++++-----------
 drivers/interconnect/qcom/x1e80100.h  |  192 -----
 48 files changed, 8655 insertions(+), 13464 deletions(-)
---
base-commit: 410f15dcfe222c06f0d6379adec630061e88dc72
change-id: 20250613-rework-icc-0d3b7276a798

Best regards,

Comments

Neil Armstrong June 16, 2025, 3:51 p.m. UTC | #1
Hi,

On 16/06/2025 02:28, Dmitry Baryshkov wrote:
> Qualcomm interconnect code has been using .num_foo fields together with
> the arrays embedded in the structure, which results in hard-to-notice
> mistakes if .num_foo gets omitted or incorrect.
> 
> Rework RPMh interconnect code to use NULL-terminated arrays for the
> dynamic IDs case (as now all the arrays contain only pointers) and,
> while we are at it, rework all the drivers to use dynamic IDs and drop
> static IDs code.
> 
> This series touches only RPMh interconnect drivers. Corresponding series
> for RPM drivers will follow up shortly.

Can you specify on which base thie patchset applies ?

I tried v6.15, v6.16-rc1, v6.16-rc2, next-20250613 & next-20250616 and they all fail to
apply on patch 5.

Thanks,
Neil

> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> Dmitry Baryshkov (28):
>        interconnect: qcom: sc8280xp: specify num_links for qnm_a1noc_cfg
>        interconnect: qcom: sc8180x: specify num_nodes
>        interconnect: qcom: rpmh: make nodes a NULL_terminated array
>        interconnect: qcom: rpmh: make link_nodes a NULL_terminated array
>        interconnect: qcom: sc7280: convert to dynamic IDs
>        interconnect: qcom: sc8180x: convert to dynamic IDs
>        interconnect: qcom: sc8280xp: convert to dynamic IDs
>        interconnect: qcom: sdm845: convert to dynamic IDs
>        interconnect: qcom: sm8250: convert to dynamic IDs
>        interconnect: qcom: x1e80100: convert to dynamic IDs
>        interconnect: qcom: qcs615: convert to dynamic IDs
>        interconnect: qcom: qcs8300: convert to dynamic IDs
>        interconnect: qcom: qdu1000: convert to dynamic IDs
>        interconnect: qcom: sar2130p: convert to dynamic IDs
>        interconnect: qcom: sc7180: convert to dynamic IDs
>        interconnect: qcom: sdm670: convert to dynamic IDs
>        interconnect: qcom: sdx55: convert to dynamic IDs
>        interconnect: qcom: sdx65: convert to dynamic IDs
>        interconnect: qcom: sdx75: convert to dynamic IDs
>        interconnect: qcom: sm6350: convert to dynamic IDs
>        interconnect: qcom: sm7150: convert to dynamic IDs
>        interconnect: qcom: sm8150: convert to dynamic IDs
>        interconnect: qcom: sm8350: convert to dynamic IDs
>        interconnect: qcom: sm8450: convert to dynamic IDs
>        interconnect: qcom: sm8550: convert to dynamic IDs
>        interconnect: qcom: sm8650: convert to dynamic IDs
>        interconnect: qcom: sm8750: convert to dynamic IDs
>        interconnect: qcom: icc-rpmh: drop support for non-dynamic IDS
> 
>   drivers/interconnect/qcom/bcm-voter.c |    4 +-
>   drivers/interconnect/qcom/icc-rpmh.c  |   20 +-
>   drivers/interconnect/qcom/icc-rpmh.h  |   13 +-
>   drivers/interconnect/qcom/qcs615.c    |  713 ++++++++-----------
>   drivers/interconnect/qcom/qcs615.h    |  128 ----
>   drivers/interconnect/qcom/qcs8300.c   |  911 +++++++++++-------------
>   drivers/interconnect/qcom/qcs8300.h   |  177 -----
>   drivers/interconnect/qcom/qdu1000.c   |  470 ++++++------
>   drivers/interconnect/qcom/qdu1000.h   |   95 ---
>   drivers/interconnect/qcom/sa8775p.c   |  493 ++++++-------
>   drivers/interconnect/qcom/sar2130p.c  |  795 ++++++++-------------
>   drivers/interconnect/qcom/sc7180.c    |  892 +++++++++++------------
>   drivers/interconnect/qcom/sc7180.h    |  149 ----
>   drivers/interconnect/qcom/sc7280.c    |  840 ++++++++++------------
>   drivers/interconnect/qcom/sc7280.h    |  154 ----
>   drivers/interconnect/qcom/sc8180x.c   | 1013 +++++++++++++-------------
>   drivers/interconnect/qcom/sc8180x.h   |  179 -----
>   drivers/interconnect/qcom/sc8280xp.c  | 1257 ++++++++++++++++-----------------
>   drivers/interconnect/qcom/sc8280xp.h  |  209 ------
>   drivers/interconnect/qcom/sdm670.c    |  712 +++++++++----------
>   drivers/interconnect/qcom/sdm670.h    |  128 ----
>   drivers/interconnect/qcom/sdm845.c    |  986 ++++++++++++--------------
>   drivers/interconnect/qcom/sdm845.h    |  140 ----
>   drivers/interconnect/qcom/sdx55.c     |  611 ++++++++--------
>   drivers/interconnect/qcom/sdx55.h     |   70 --
>   drivers/interconnect/qcom/sdx65.c     |  577 +++++++--------
>   drivers/interconnect/qcom/sdx65.h     |   65 --
>   drivers/interconnect/qcom/sdx75.c     |  498 ++++++-------
>   drivers/interconnect/qcom/sdx75.h     |   97 ---
>   drivers/interconnect/qcom/sm6350.c    |  838 +++++++++++-----------
>   drivers/interconnect/qcom/sm6350.h    |  139 ----
>   drivers/interconnect/qcom/sm7150.c    |  860 +++++++++++-----------
>   drivers/interconnect/qcom/sm7150.h    |  140 ----
>   drivers/interconnect/qcom/sm8150.c    |  930 ++++++++++++------------
>   drivers/interconnect/qcom/sm8150.h    |  152 ----
>   drivers/interconnect/qcom/sm8250.c    |  977 ++++++++++++-------------
>   drivers/interconnect/qcom/sm8250.h    |  168 -----
>   drivers/interconnect/qcom/sm8350.c    |  901 ++++++++++++-----------
>   drivers/interconnect/qcom/sm8350.h    |  158 -----
>   drivers/interconnect/qcom/sm8450.c    |  823 ++++++++++-----------
>   drivers/interconnect/qcom/sm8450.h    |  169 -----
>   drivers/interconnect/qcom/sm8550.c    |  683 ++++++++----------
>   drivers/interconnect/qcom/sm8550.h    |  138 ----
>   drivers/interconnect/qcom/sm8650.c    |  713 ++++++++-----------
>   drivers/interconnect/qcom/sm8650.h    |  144 ----
>   drivers/interconnect/qcom/sm8750.c    |  779 ++++++++------------
>   drivers/interconnect/qcom/x1e80100.c  |  819 ++++++++++-----------
>   drivers/interconnect/qcom/x1e80100.h  |  192 -----
>   48 files changed, 8655 insertions(+), 13464 deletions(-)
> ---
> base-commit: 410f15dcfe222c06f0d6379adec630061e88dc72
> change-id: 20250613-rework-icc-0d3b7276a798
> 
> Best regards,
Neil Armstrong June 16, 2025, 4:13 p.m. UTC | #2
On 16/06/2025 02:28, Dmitry Baryshkov wrote:
> Stop using fixed and IDs and covert the platform to use dynamic IDs for
> the interconnect. This gives more flexibility and also allows us to drop
> the .num_links member, saving from possible errors related to it being
> not set or set incorrectly.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
>   drivers/interconnect/qcom/sm8650.c | 676 +++++++++++++++++--------------------
>   drivers/interconnect/qcom/sm8650.h | 144 --------
>   2 files changed, 309 insertions(+), 511 deletions(-)
> 

Runtime tested by comparing the interconnect graph before and after, the
ids are now dynamic and the labels have the node name, apart that the graph
is the same on both runs!

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on QRD8650
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on HDK8650

Thanks,
Neil