core.c (05309830e1f869f939e283576dd3684313390062) core.c (c46ab9db64979b0875fff79e1b00013343ca8286)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Interconnect framework core driver
4 *
5 * Copyright (c) 2017-2019, Linaro Ltd.
6 * Author: Georgi Djakov <georgi.djakov@linaro.org>
7 */
8

--- 7 unchanged lines hidden (view full) ---

16#include <linux/module.h>
17#include <linux/mutex.h>
18#include <linux/slab.h>
19#include <linux/of.h>
20#include <linux/overflow.h>
21
22#include "internal.h"
23
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Interconnect framework core driver
4 *
5 * Copyright (c) 2017-2019, Linaro Ltd.
6 * Author: Georgi Djakov <georgi.djakov@linaro.org>
7 */
8

--- 7 unchanged lines hidden (view full) ---

16#include <linux/module.h>
17#include <linux/mutex.h>
18#include <linux/slab.h>
19#include <linux/of.h>
20#include <linux/overflow.h>
21
22#include "internal.h"
23
24#define CREATE_TRACE_POINTS
25#include "trace.h"
26
24static DEFINE_IDR(icc_idr);
25static LIST_HEAD(icc_providers);
26static DEFINE_MUTEX(icc_lock);
27static struct dentry *icc_debugfs_dir;
28
29static void icc_summary_show_one(struct seq_file *s, struct icc_node *n)
30{
31 if (!n)

--- 398 unchanged lines hidden (view full) ---

430 node = path->reqs[i].node;
431
432 /* update the consumer request for this path */
433 path->reqs[i].avg_bw = avg_bw;
434 path->reqs[i].peak_bw = peak_bw;
435
436 /* aggregate requests for this node */
437 aggregate_requests(node);
27static DEFINE_IDR(icc_idr);
28static LIST_HEAD(icc_providers);
29static DEFINE_MUTEX(icc_lock);
30static struct dentry *icc_debugfs_dir;
31
32static void icc_summary_show_one(struct seq_file *s, struct icc_node *n)
33{
34 if (!n)

--- 398 unchanged lines hidden (view full) ---

433 node = path->reqs[i].node;
434
435 /* update the consumer request for this path */
436 path->reqs[i].avg_bw = avg_bw;
437 path->reqs[i].peak_bw = peak_bw;
438
439 /* aggregate requests for this node */
440 aggregate_requests(node);
441
442 trace_icc_set_bw(path, node, i, avg_bw, peak_bw);
438 }
439
440 ret = apply_constraints(path);
441 if (ret) {
442 pr_debug("interconnect: error applying constraints (%d)\n",
443 ret);
444
445 for (i = 0; i < path->num_nodes; i++) {
446 node = path->reqs[i].node;
447 path->reqs[i].avg_bw = old_avg;
448 path->reqs[i].peak_bw = old_peak;
449 aggregate_requests(node);
450 }
451 apply_constraints(path);
452 }
453
454 mutex_unlock(&icc_lock);
455
443 }
444
445 ret = apply_constraints(path);
446 if (ret) {
447 pr_debug("interconnect: error applying constraints (%d)\n",
448 ret);
449
450 for (i = 0; i < path->num_nodes; i++) {
451 node = path->reqs[i].node;
452 path->reqs[i].avg_bw = old_avg;
453 path->reqs[i].peak_bw = old_peak;
454 aggregate_requests(node);
455 }
456 apply_constraints(path);
457 }
458
459 mutex_unlock(&icc_lock);
460
461 trace_icc_set_bw_end(path, ret);
462
456 return ret;
457}
458EXPORT_SYMBOL_GPL(icc_set_bw);
459
460/**
461 * icc_get() - return a handle for path between two endpoints
462 * @dev: the device requesting the path
463 * @src_id: source device port id

--- 362 unchanged lines hidden ---
463 return ret;
464}
465EXPORT_SYMBOL_GPL(icc_set_bw);
466
467/**
468 * icc_get() - return a handle for path between two endpoints
469 * @dev: the device requesting the path
470 * @src_id: source device port id

--- 362 unchanged lines hidden ---