Commit 54918b8e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'icc-5.9-rc1' of https://git.linaro.org/people/georgi.djakov/linux into char-misc-next



Georgi writes:

interconnect changes for 5.9

Here are the interconnect changes for the 5.9-rc1 merge window
consisting mostly of changes that give the core more flexibility
in order to support some new provider drivers.

Core changes:
- Export of_icc_get_from_provider()
- Relax requirement in of_icc_get_from_provider()
- Allow inter-provider pairs to be configured
- Mark all dummy functions as static inline

Signed-off-by: default avatarGeorgi Djakov <georgi.djakov@linaro.org>

* tag 'icc-5.9-rc1' of https://git.linaro.org/people/georgi.djakov/linux:
  interconnect: Mark all dummy functions as static inline
  interconnect: Allow inter-provider pairs to be configured
  interconnect: Relax requirement in of_icc_get_from_provider()
  interconnect: Export of_icc_get_from_provider()
parents 4c0d7782 12a400b0
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -263,23 +263,22 @@ static int aggregate_requests(struct icc_node *node)
static int apply_constraints(struct icc_path *path)
{
	struct icc_node *next, *prev = NULL;
	struct icc_provider *p;
	int ret = -EINVAL;
	int i;

	for (i = 0; i < path->num_nodes; i++) {
		next = path->reqs[i].node;
		p = next->provider;

		/*
		 * Both endpoints should be valid master-slave pairs of the
		 * same interconnect provider that will be configured.
		 */
		if (!prev || next->provider != prev->provider) {
		/* both endpoints should be valid master-slave pairs */
		if (!prev || (p != prev->provider && !p->inter_set)) {
			prev = next;
			continue;
		}

		/* set the constraints */
		ret = next->provider->set(prev, next);
		ret = p->set(prev, next);
		if (ret)
			goto out;

@@ -334,12 +333,12 @@ EXPORT_SYMBOL_GPL(of_icc_xlate_onecell);
 * Returns a valid pointer to struct icc_node on success or ERR_PTR()
 * on failure.
 */
static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)
struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)
{
	struct icc_node *node = ERR_PTR(-EPROBE_DEFER);
	struct icc_provider *provider;

	if (!spec || spec->args_count != 1)
	if (!spec)
		return ERR_PTR(-EINVAL);

	mutex_lock(&icc_lock);
@@ -353,6 +352,7 @@ static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)

	return node;
}
EXPORT_SYMBOL_GPL(of_icc_get_from_provider);

static void devm_icc_release(struct device *dev, void *res)
{
+12 −4
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
 * @xlate: provider-specific callback for mapping nodes from phandle arguments
 * @dev: the device this interconnect provider belongs to
 * @users: count of active users
 * @inter_set: whether inter-provider pairs will be configured with @set
 * @data: pointer to private data
 */
struct icc_provider {
@@ -53,6 +54,7 @@ struct icc_provider {
	struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
	struct device		*dev;
	int			users;
	bool			inter_set;
	void			*data;
};

@@ -103,6 +105,7 @@ void icc_node_del(struct icc_node *node);
int icc_nodes_remove(struct icc_provider *provider);
int icc_provider_add(struct icc_provider *provider);
int icc_provider_del(struct icc_provider *provider);
struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec);

#else

@@ -117,7 +120,7 @@ static inline struct icc_node *icc_node_create(int id)
	return ERR_PTR(-ENOTSUPP);
}

void icc_node_destroy(int id)
static inline void icc_node_destroy(int id)
{
}

@@ -126,16 +129,16 @@ static inline int icc_link_create(struct icc_node *node, const int dst_id)
	return -ENOTSUPP;
}

int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
static inline int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
{
	return -ENOTSUPP;
}

void icc_node_add(struct icc_node *node, struct icc_provider *provider)
static inline void icc_node_add(struct icc_node *node, struct icc_provider *provider)
{
}

void icc_node_del(struct icc_node *node)
static inline void icc_node_del(struct icc_node *node)
{
}

@@ -154,6 +157,11 @@ static inline int icc_provider_del(struct icc_provider *provider)
	return -ENOTSUPP;
}

static inline struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)
{
	return ERR_PTR(-ENOTSUPP);
}

#endif /* CONFIG_INTERCONNECT */

#endif /* __LINUX_INTERCONNECT_PROVIDER_H */