interconnect changes for 6.4

This pull request contains the interconnect changes for the 6.4-rc1 merge
 window, which this time are mostly cleanups.
 
 Core changes:
   interconnect: Skip call into provider if initial bw is zero
   interconnect: Use of_property_present() for testing DT property presence
   interconnect: drop racy registration API
   interconnect: drop unused icc_link_destroy() interface
 
 Driver changes:
   interconnect: qcom: Drop obsolete dependency on COMPILE_TEST
   interconnect: qcom: drop obsolete OSM_L3/EPSS defines
   interconnect: qcom: osm-l3: drop unuserd header inclusion
   interconnect: qcom: rpm: drop bogus pm domain attach
   interconnect: qcom: rpm: make QoS INVALID default
   interconnect: qcom: rpm: Add support for specifying channel num
   interconnect: qcom: Sort kerneldoc entries
   dt-bindings: interconnect: OSM L3: Add SM6375 CPUCP compatible
   dt-bindings: interconnect: qcom,msm8998-bwmon: Resolve MSM8998 support
 
 Signed-off-by: Georgi Djakov <djakov@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJkPP4dAAoJEIDQzArG2BZjaC8P/A8KlodPtmdjE6fJFsQFsDGR
 fjMXLnMiIafTpZ/LNwqKpmqwjJXMHVqRc+39/st3PzE5Xx3vyAbvoIExyn3LPWPJ
 u8g0uuLZBB24UdXvlOdwLf0y5gi1SGgFMdQr+3d3BMddCgJIL2q/cmBG2oVpsBYD
 jnn6+ghgdj01O6ewr/4ZlcwBnqeA6b7HA7Mfrae/YyNmRi7eaKFsczgZtD7TZCY6
 dWI+1Ee3QPo+XS6wsrZKuqFuJ4f+7ipOSkU7fcke6ab7a5IUFW2979ozvyh6JslK
 j/K3IePjh/cNFBtvuD3mw+M1Kodkmgx4W0jmXCZBRRPvD/1Vk0mGMwpokxpuy6Vi
 dlLw7ciVrogB7EDiij9PiDAsFNYlwBy1m/miwKesr1zd0Hmeyf69QbTpIM3QB4SP
 nAShm8XZwMg6m4QfI3ToBzt5hmU9Or2OL/5vN2k+EQMeT682g9F3RuHkyGhZKcGQ
 wFyHXNHJa2gYPGPF+EhwLXeCmSwrqVUL5a1s4pOD6X+VaEH+GuzxeCEvM3jAosNL
 qB5GD06ka7lIk7vid38dqiw9663vgtbOA8M8GF4tyAsNvnq2L5lwQ+UbrR42mveP
 YCdJwatPC+S0er56p6JjbGuxAEq8MkCurw813QNQmBxsYLq4BajQboM63XHoLHP7
 0YOKlzGhnIaV6V/8hkoS
 =By6c
 -----END PGP SIGNATURE-----

Merge tag 'icc-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next

Georgi writes:

interconnect changes for 6.4

This pull request contains the interconnect changes for the 6.4-rc1 merge
window, which this time are mostly cleanups.

Core changes:
  interconnect: Skip call into provider if initial bw is zero
  interconnect: Use of_property_present() for testing DT property presence
  interconnect: drop racy registration API
  interconnect: drop unused icc_link_destroy() interface

Driver changes:
  interconnect: qcom: Drop obsolete dependency on COMPILE_TEST
  interconnect: qcom: drop obsolete OSM_L3/EPSS defines
  interconnect: qcom: osm-l3: drop unuserd header inclusion
  interconnect: qcom: rpm: drop bogus pm domain attach
  interconnect: qcom: rpm: make QoS INVALID default
  interconnect: qcom: rpm: Add support for specifying channel num
  interconnect: qcom: Sort kerneldoc entries
  dt-bindings: interconnect: OSM L3: Add SM6375 CPUCP compatible
  dt-bindings: interconnect: qcom,msm8998-bwmon: Resolve MSM8998 support

Signed-off-by: Georgi Djakov <djakov@kernel.org>

* tag 'icc-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
  dt-bindings: interconnect: qcom,msm8998-bwmon: Resolve MSM8998 support
  dt-bindings: interconnect: OSM L3: Add SM6375 CPUCP compatible
  interconnect: qcom: Sort kerneldoc entries
  interconnect: qcom: rpm: Add support for specifying channel num
  interconnect: qcom: rpm: make QoS INVALID default
  interconnect: qcom: rpm: drop bogus pm domain attach
  interconnect: drop unused icc_link_destroy() interface
  interconnect: drop racy registration API
  interconnect: Use of_property_present() for testing DT property presence
  interconnect: qcom: osm-l3: drop unuserd header inclusion
  interconnect: qcom: drop obsolete OSM_L3/EPSS defines
  interconnect: Skip call into provider if initial bw is zero
  interconnect: qcom: Drop obsolete dependency on COMPILE_TEST
This commit is contained in:
Greg Kroah-Hartman 2023-04-19 15:07:09 +02:00
commit 3fcf52b711
15 changed files with 76 additions and 141 deletions

View File

@ -22,14 +22,14 @@ description: |
properties:
compatible:
oneOf:
- const: qcom,msm8998-bwmon # BWMON v4
- items:
- enum:
- qcom,sc7280-cpu-bwmon
- qcom,sc8280xp-cpu-bwmon
- qcom,sdm845-bwmon
- qcom,sdm845-cpu-bwmon
- qcom,sm8550-cpu-bwmon
- const: qcom,msm8998-bwmon
- const: qcom,msm8998-bwmon # BWMON v4
- const: qcom,sdm845-bwmon # BWMON v4, unified register space
- items:
- enum:
- qcom,sc8280xp-llcc-bwmon
@ -49,9 +49,13 @@ properties:
type: object
reg:
# BWMON v4 (currently described) and BWMON v5 use one register address
# space. BWMON v2 uses two register spaces - not yet described.
maxItems: 1
# BWMON v5 uses one register address space, v1-v4 use one or two.
minItems: 1
maxItems: 2
reg-names:
minItems: 1
maxItems: 2
required:
- compatible
@ -63,13 +67,36 @@ required:
additionalProperties: false
allOf:
- if:
properties:
compatible:
const: qcom,msm8998-bwmon
then:
properties:
reg:
minItems: 2
reg-names:
items:
- const: monitor
- const: global
else:
properties:
reg:
maxItems: 1
reg-names:
maxItems: 1
examples:
- |
#include <dt-bindings/interconnect/qcom,sdm845.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
pmu@1436400 {
compatible = "qcom,sdm845-bwmon", "qcom,msm8998-bwmon";
compatible = "qcom,sdm845-cpu-bwmon", "qcom,sdm845-bwmon";
reg = <0x01436400 0x600>;
interrupts = <GIC_SPI 581 IRQ_TYPE_LEVEL_HIGH>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_LLCC 3>;

View File

@ -29,6 +29,7 @@ properties:
- enum:
- qcom,sc7280-epss-l3
- qcom,sc8280xp-epss-l3
- qcom,sm6375-cpucp-l3
- qcom,sm8250-epss-l3
- qcom,sm8350-epss-l3
- const: qcom,epss-l3

View File

@ -451,7 +451,7 @@ struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
* When the consumer DT node do not have "interconnects" property
* return a NULL path to skip setting constraints.
*/
if (!of_find_property(np, "interconnects", NULL))
if (!of_property_present(np, "interconnects"))
return NULL;
/*
@ -544,7 +544,7 @@ struct icc_path *of_icc_get(struct device *dev, const char *name)
* When the consumer DT node do not have "interconnects" property
* return a NULL path to skip setting constraints.
*/
if (!of_find_property(np, "interconnects", NULL))
if (!of_property_present(np, "interconnects"))
return NULL;
/*
@ -910,52 +910,6 @@ int icc_link_create(struct icc_node *node, const int dst_id)
}
EXPORT_SYMBOL_GPL(icc_link_create);
/**
* icc_link_destroy() - destroy a link between two nodes
* @src: pointer to source node
* @dst: pointer to destination node
*
* Return: 0 on success, or an error code otherwise
*/
int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
{
struct icc_node **new;
size_t slot;
int ret = 0;
if (IS_ERR_OR_NULL(src))
return -EINVAL;
if (IS_ERR_OR_NULL(dst))
return -EINVAL;
mutex_lock(&icc_lock);
for (slot = 0; slot < src->num_links; slot++)
if (src->links[slot] == dst)
break;
if (WARN_ON(slot == src->num_links)) {
ret = -ENXIO;
goto out;
}
src->links[slot] = src->links[--src->num_links];
new = krealloc(src->links, src->num_links * sizeof(*src->links),
GFP_KERNEL);
if (new)
src->links = new;
else
ret = -ENOMEM;
out:
mutex_unlock(&icc_lock);
return ret;
}
EXPORT_SYMBOL_GPL(icc_link_destroy);
/**
* icc_node_add() - add interconnect node to interconnect provider
* @node: pointer to the interconnect node
@ -981,14 +935,17 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider)
node->avg_bw = node->init_avg;
node->peak_bw = node->init_peak;
if (provider->pre_aggregate)
provider->pre_aggregate(node);
if (node->avg_bw || node->peak_bw) {
if (provider->pre_aggregate)
provider->pre_aggregate(node);
if (provider->aggregate)
provider->aggregate(node, 0, node->init_avg, node->init_peak,
&node->avg_bw, &node->peak_bw);
if (provider->aggregate)
provider->aggregate(node, 0, node->init_avg, node->init_peak,
&node->avg_bw, &node->peak_bw);
if (provider->set)
provider->set(node, node);
}
provider->set(node, node);
node->avg_bw = 0;
node->peak_bw = 0;
@ -1081,22 +1038,6 @@ void icc_provider_deregister(struct icc_provider *provider)
}
EXPORT_SYMBOL_GPL(icc_provider_deregister);
int icc_provider_add(struct icc_provider *provider)
{
icc_provider_init(provider);
return icc_provider_register(provider);
}
EXPORT_SYMBOL_GPL(icc_provider_add);
void icc_provider_del(struct icc_provider *provider)
{
WARN_ON(!list_empty(&provider->nodes));
icc_provider_deregister(provider);
}
EXPORT_SYMBOL_GPL(icc_provider_del);
static const struct of_device_id __maybe_unused ignore_list[] = {
{ .compatible = "qcom,sc7180-ipa-virt" },
{ .compatible = "qcom,sc8180x-ipa-virt" },

View File

@ -83,7 +83,7 @@ config INTERCONNECT_QCOM_RPMH_POSSIBLE
default INTERCONNECT_QCOM
depends on QCOM_RPMH || (COMPILE_TEST && !QCOM_RPMH)
depends on QCOM_COMMAND_DB || (COMPILE_TEST && !QCOM_COMMAND_DB)
depends on OF || COMPILE_TEST
depends on OF
help
Compile-testing RPMH drivers is possible on other platforms,
but in order to avoid link failures, drivers must not be built-in

View File

@ -11,7 +11,6 @@
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@ -48,6 +47,9 @@
#define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000))
#define NOC_QOS_MODEn_MASK 0x3
#define NOC_QOS_MODE_FIXED_VAL 0x0
#define NOC_QOS_MODE_BYPASS_VAL 0x2
static int qcom_icc_set_qnoc_qos(struct icc_node *src, u64 max_bw)
{
struct icc_provider *provider = src->provider;
@ -153,7 +155,7 @@ static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)
struct qcom_icc_provider *qp;
struct qcom_icc_node *qn;
struct icc_provider *provider;
u32 mode = NOC_QOS_MODE_BYPASS;
u32 mode = NOC_QOS_MODE_BYPASS_VAL;
int rc = 0;
qn = src->data;
@ -167,18 +169,17 @@ static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)
return 0;
}
if (qn->qos.qos_mode != NOC_QOS_MODE_INVALID)
mode = qn->qos.qos_mode;
if (mode == NOC_QOS_MODE_FIXED) {
dev_dbg(src->provider->dev, "NoC QoS: %s: Set Fixed mode\n",
qn->name);
if (qn->qos.qos_mode == NOC_QOS_MODE_FIXED) {
dev_dbg(src->provider->dev, "NoC QoS: %s: Set Fixed mode\n", qn->name);
mode = NOC_QOS_MODE_FIXED_VAL;
rc = qcom_icc_noc_set_qos_priority(qp, &qn->qos);
if (rc)
return rc;
} else if (mode == NOC_QOS_MODE_BYPASS) {
dev_dbg(src->provider->dev, "NoC QoS: %s: Set Bypass mode\n",
qn->name);
} else if (qn->qos.qos_mode == NOC_QOS_MODE_BYPASS) {
dev_dbg(src->provider->dev, "NoC QoS: %s: Set Bypass mode\n", qn->name);
mode = NOC_QOS_MODE_BYPASS_VAL;
} else {
/* How did we get here? */
}
return regmap_update_bits(qp->regmap,
@ -244,7 +245,7 @@ static int __qcom_icc_set(struct icc_node *n, struct qcom_icc_node *qn,
ret = qcom_icc_rpm_set(qn->mas_rpm_id, qn->slv_rpm_id, sum_bw);
if (ret)
return ret;
} else if (qn->qos.qos_mode != -1) {
} else if (qn->qos.qos_mode != NOC_QOS_MODE_INVALID) {
/* set bandwidth directly from the AP */
ret = qcom_icc_qos_set(n, sum_bw);
if (ret)
@ -315,6 +316,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider,
{
struct icc_node *node;
struct qcom_icc_node *qn;
u64 sum_avg[QCOM_ICC_NUM_BUCKETS];
int i;
/* Initialise aggregate values */
@ -332,7 +334,11 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider,
list_for_each_entry(node, &provider->nodes, node_list) {
qn = node->data;
for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) {
agg_avg[i] += qn->sum_avg[i];
if (qn->channels)
sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels);
else
sum_avg[i] = qn->sum_avg[i];
agg_avg[i] += sum_avg[i];
agg_peak[i] = max_t(u64, agg_peak[i], qn->max_peak[i]);
}
}
@ -496,12 +502,6 @@ int qnoc_probe(struct platform_device *pdev)
if (ret)
return ret;
if (desc->has_bus_pd) {
ret = dev_pm_domain_attach(dev, true);
if (ret)
return ret;
}
provider = &qp->provider;
provider->dev = dev;
provider->set = qcom_icc_set;

View File

@ -23,12 +23,12 @@ enum qcom_icc_type {
/**
* struct qcom_icc_provider - Qualcomm specific interconnect provider
* @provider: generic interconnect provider
* @bus_clks: the clk_bulk_data table of bus clocks
* @num_clks: the total number of clk_bulk_data entries
* @type: the ICC provider type
* @qos_offset: offset to QoS registers
* @regmap: regmap for QoS registers read/write access
* @qos_offset: offset to QoS registers
* @bus_clk_rate: bus clock rate in Hz
* @bus_clks: the clk_bulk_data table of bus clocks
*/
struct qcom_icc_provider {
struct icc_provider provider;
@ -66,6 +66,7 @@ struct qcom_icc_qos {
* @id: a unique node identifier
* @links: an array of nodes where we can go next while traversing
* @num_links: the total number of @links
* @channels: number of channels at this node (e.g. DDR channels)
* @buswidth: width of the interconnect between a node and the bus (bytes)
* @sum_avg: current sum aggregate value of all avg bw requests
* @max_peak: current max aggregate value of all peak bw requests
@ -78,6 +79,7 @@ struct qcom_icc_node {
u16 id;
const u16 *links;
u16 num_links;
u16 channels;
u16 buswidth;
u64 sum_avg[QCOM_ICC_NUM_BUCKETS];
u64 max_peak[QCOM_ICC_NUM_BUCKETS];
@ -91,16 +93,17 @@ struct qcom_icc_desc {
size_t num_nodes;
const char * const *clocks;
size_t num_clocks;
bool has_bus_pd;
enum qcom_icc_type type;
const struct regmap_config *regmap_cfg;
unsigned int qos_offset;
};
/* Valid for both NoC and BIMC */
#define NOC_QOS_MODE_INVALID -1
#define NOC_QOS_MODE_FIXED 0x0
#define NOC_QOS_MODE_BYPASS 0x2
/* Valid for all bus types */
enum qos_mode {
NOC_QOS_MODE_INVALID = 0,
NOC_QOS_MODE_FIXED,
NOC_QOS_MODE_BYPASS,
};
int qnoc_probe(struct platform_device *pdev);
int qnoc_remove(struct platform_device *pdev);

View File

@ -1823,7 +1823,6 @@ static const struct qcom_icc_desc msm8996_a0noc = {
.num_nodes = ARRAY_SIZE(a0noc_nodes),
.clocks = bus_a0noc_clocks,
.num_clocks = ARRAY_SIZE(bus_a0noc_clocks),
.has_bus_pd = true,
.regmap_cfg = &msm8996_a0noc_regmap_config
};

View File

@ -14,13 +14,6 @@
#include <dt-bindings/interconnect/qcom,osm-l3.h>
#include "sc7180.h"
#include "sc7280.h"
#include "sc8180x.h"
#include "sdm845.h"
#include "sm8150.h"
#include "sm8250.h"
#define LUT_MAX_ENTRIES 40U
#define LUT_SRC GENMASK(31, 30)
#define LUT_L_VAL GENMASK(7, 0)

View File

@ -145,7 +145,5 @@
#define SC7180_SLAVE_SERVICE_SNOC 134
#define SC7180_SLAVE_QDSS_STM 135
#define SC7180_SLAVE_TCU 136
#define SC7180_MASTER_OSM_L3_APPS 137
#define SC7180_SLAVE_OSM_L3 138
#endif

View File

@ -150,7 +150,5 @@
#define SC7280_SLAVE_PCIE_1 139
#define SC7280_SLAVE_QDSS_STM 140
#define SC7280_SLAVE_TCU 141
#define SC7280_MASTER_EPSS_L3_APPS 142
#define SC7280_SLAVE_EPSS_L3 143
#endif

View File

@ -168,8 +168,6 @@
#define SC8180X_SLAVE_EBI_CH0_DISPLAY 158
#define SC8180X_SLAVE_MNOC_SF_MEM_NOC_DISPLAY 159
#define SC8180X_SLAVE_MNOC_HF_MEM_NOC_DISPLAY 160
#define SC8180X_MASTER_OSM_L3_APPS 161
#define SC8180X_SLAVE_OSM_L3 162
#define SC8180X_MASTER_QUP_CORE_0 163
#define SC8180X_MASTER_QUP_CORE_1 164

View File

@ -136,7 +136,5 @@
#define SDM845_SLAVE_SERVICE_SNOC 128
#define SDM845_SLAVE_QDSS_STM 129
#define SDM845_SLAVE_TCU 130
#define SDM845_MASTER_OSM_L3_APPS 131
#define SDM845_SLAVE_OSM_L3 132
#endif /* __DRIVERS_INTERCONNECT_QCOM_SDM845_H__ */

View File

@ -148,7 +148,5 @@
#define SM8150_SLAVE_VSENSE_CTRL_CFG 137
#define SM8150_SNOC_CNOC_MAS 138
#define SM8150_SNOC_CNOC_SLV 139
#define SM8150_MASTER_OSM_L3_APPS 140
#define SM8150_SLAVE_OSM_L3 141
#endif

View File

@ -158,7 +158,5 @@
#define SM8250_SLAVE_VSENSE_CTRL_CFG 147
#define SM8250_SNOC_CNOC_MAS 148
#define SM8250_SNOC_CNOC_SLV 149
#define SM8250_MASTER_EPSS_L3_APPS 150
#define SM8250_SLAVE_EPSS_L3 151
#endif

View File

@ -118,15 +118,12 @@ int icc_std_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
struct icc_node *icc_node_create(int id);
void icc_node_destroy(int id);
int icc_link_create(struct icc_node *node, const int dst_id);
int icc_link_destroy(struct icc_node *src, struct icc_node *dst);
void icc_node_add(struct icc_node *node, struct icc_provider *provider);
void icc_node_del(struct icc_node *node);
int icc_nodes_remove(struct icc_provider *provider);
void icc_provider_init(struct icc_provider *provider);
int icc_provider_register(struct icc_provider *provider);
void icc_provider_deregister(struct icc_provider *provider);
int icc_provider_add(struct icc_provider *provider);
void icc_provider_del(struct icc_provider *provider);
struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec);
void icc_sync_state(struct device *dev);
@ -152,11 +149,6 @@ static inline int icc_link_create(struct icc_node *node, const int dst_id)
return -ENOTSUPP;
}
static inline int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
{
return -ENOTSUPP;
}
static inline void icc_node_add(struct icc_node *node, struct icc_provider *provider)
{
}
@ -179,15 +171,6 @@ static inline int icc_provider_register(struct icc_provider *provider)
static inline void icc_provider_deregister(struct icc_provider *provider) { }
static inline int icc_provider_add(struct icc_provider *provider)
{
return -ENOTSUPP;
}
static inline void icc_provider_del(struct icc_provider *provider)
{
}
static inline struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec)
{
return ERR_PTR(-ENOTSUPP);