From patchwork Tue Aug 25 17:01:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 248258 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3604833ils; Tue, 25 Aug 2020 10:02:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySXei7BSfdFDFRkyp83P19+dEqd22nHzbuNFBUEjUIPiGOhcw/llC0y2Hv2QH5z+CRwCDu X-Received: by 2002:a17:907:2105:: with SMTP id qn5mr11171148ejb.219.1598374952610; Tue, 25 Aug 2020 10:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598374952; cv=none; d=google.com; s=arc-20160816; b=duM4DlQBCuvm8sqRUNinNsy8nv+GKYP4uX4W9Q2vvskVqRWeQkbadiTEuqkAcoDuQF SUtKhOHX/a8T7tXqxg39jvUswiviOvNd/i/ovNWF/pqj77owV1t20krkux1lEyBR8HI4 3pg8UxM3VJNIoYqIKVuUzj1OzypfPm17zyQ0yY2IirjIMO33Uj3PqU6p9T8VPelOZJCA nSufJVFbp0YUW0Ud6JqUVMDrYh//IiXuzyeI73JYgM2N1s7dJHajkgPARvh4COgkPRd6 oIMldlaqqaMZ+3uhsdT7KRYnTIgZIcwUbw/zk1hqBIrtKiaIwsJp35Ow+iJbJIvXDGHl zlXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QNXnwR9p0uhARPXD5IdPdhRimuwkBpCRHZXkkYzIxeQ=; b=lCd+ea6uPqXIin2Ih4HEOIMz+N2DJl6SMf3Sw+mWYu/SqM2KuQGQqjRlkZdH8TR+/8 2HwkbvGFv9H+xxcvEuRp+CSxmblnm5jIx7mIxTW8uK+00zAPnKdVgeT6DbR8twS5dxt7 Rj3thzjBfYdPSiFY7IT34fcmxT72k1GR2Pj5IjIWmY/gzxrHS7fgq0DBKbn3gbYgq4Ec uh9nj3GO3tWsR5wov+LrDztBkmsu4hHdKbTOk6fJSFeyMHgbYJ6ZS5lsS9+LNtv+EdJw 6kr0gQxAguL/iQDMJKABWIsqT+aI8sKea04N+8LsJoSUbu9vud2uGiOpCNRllFI/ygUo wE3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=meuU0Zkw; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si9921283ejy.383.2020.08.25.10.02.32; Tue, 25 Aug 2020 10:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=meuU0Zkw; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726257AbgHYRB7 (ORCPT + 15 others); Tue, 25 Aug 2020 13:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbgHYRB5 (ORCPT ); Tue, 25 Aug 2020 13:01:57 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82990C061757 for ; Tue, 25 Aug 2020 10:01:56 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id c15so13465886wrs.11 for ; Tue, 25 Aug 2020 10:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QNXnwR9p0uhARPXD5IdPdhRimuwkBpCRHZXkkYzIxeQ=; b=meuU0Zkwwy7TRrTbdm6LUcRa5e3YU5RgQBubXJ47ZT+Lsi5779G+F1X6eYeme2O5ZK p2YXUVA6EPBOQJ8xCp+iAq2xzLrx7ZKTIVrya5CPfG16nKyhpqBoYZgvIxvm/5K6Z2r+ 78/DCncRswMvj1HScNrlpYXIKlojHDrvV4lbdROLjNgQmsOqTzU7CCGF1OeJzpJauMJw dyqSZ/VXsQS0r5Nd4I+aB01EtTbUVdKSOe9ikHjB4+c1fu583F6SwzIn8WMgR0rZ95Hl QJdygPc1CUeEDPE9zxO72ecB2l+o4UkJTKXeXJT1vAMzMMn/x/zn5KC51P70XrXvFdPP r45Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QNXnwR9p0uhARPXD5IdPdhRimuwkBpCRHZXkkYzIxeQ=; b=Hm24nFNP2z+HEIGKG75mFWazvjYZYVW9lyvKRIoRhA8Z8K4k3qMaIfu0ZNictdomBO jBGOsT4n1PqWDgh/uU5ak3WqKqvcS4R4EZ5CPJOF22whLuyVc0SHFMEph/GC4YFc3C47 UchOQ3BZCbRzguctFEG7rS/WIwyQFgOF1eg9G9WhSxM26NDFCCRFJBYcherrYKHW2rrT DHMisjITvbUl+fTUsFgXnqmXONB+Z42ow1nRlipU/zuk01LM+WTPSi3xVCC2yhJS5DS5 HrZog5Ll6dDq6vQSXvswad9OhpCMrQfswfZq/TNV3tfM6jkiZE590FF6OpqWJj6ou8Lo zwzA== X-Gm-Message-State: AOAM533AO07D+SJRMqv2EPPz0chG7tBy8czzwU06v6KN/0CUzaS3aZda srYGhfyPDD6ZIPsZ3pArnWuRog== X-Received: by 2002:adf:e78e:: with SMTP id n14mr10900629wrm.357.1598374915151; Tue, 25 Aug 2020 10:01:55 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y17sm6669008wma.17.2020.08.25.10.01.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2020 10:01:54 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: saravanak@google.com, mdtipton@codeaurora.org, okukatla@codeaurora.org, bjorn.andersson@linaro.org, vincent.guittot@linaro.org, akashast@codeaurora.org, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] interconnect: Add get_bw() callback Date: Tue, 25 Aug 2020 20:01:50 +0300 Message-Id: <20200825170152.6434-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200825170152.6434-1-georgi.djakov@linaro.org> References: <20200825170152.6434-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The interconnect controller hardware may support querying the current bandwidth settings, so add a callback for providers to implement this functionality if supported. Signed-off-by: Georgi Djakov --- include/linux/interconnect-provider.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index 4735518de515..520f70fe5a31 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -38,6 +38,7 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec, * @aggregate: pointer to device specific aggregate operation function * @pre_aggregate: pointer to device specific function that is called * before the aggregation begins (optional) + * @get_bw: pointer to device specific function to get current bandwidth * @xlate: provider-specific callback for mapping nodes from phandle arguments * @dev: the device this interconnect provider belongs to * @users: count of active users @@ -51,6 +52,7 @@ struct icc_provider { int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw, u32 peak_bw, u32 *agg_avg, u32 *agg_peak); void (*pre_aggregate)(struct icc_node *node); + int (*get_bw)(struct icc_node *node, u32 *avg, u32 *peak); struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data); struct device *dev; int users;