Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3589212yba; Tue, 23 Apr 2019 06:30:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhbcIu83JqeIZje4KDL5yKGl2Gr1nwrnHJsHRLh8j+IoT7Ii6RBiLORDlI3oVBxTb5U6hh X-Received: by 2002:a63:d84a:: with SMTP id k10mr24384159pgj.441.1556026201441; Tue, 23 Apr 2019 06:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556026201; cv=none; d=google.com; s=arc-20160816; b=YJxpxHUSBsFIrvrGJ8kn+i0mYIpC+kn+kYc/2Uz6+gwoXzDBaU5ZTSt2JClKcpslPG 7S0TLrqMIoRv0zIOLTqw925+SbPl1n1Y7Nm6dTt/pabp1nJ+uZmJv7XpjpH6GUxWeNlc 95rfiPl5vyUWxLKsslflXjF2zuHMQqmHFiUDT8TFdmgAbpOFhYQr8pUAPsXPBq7a6vQN /v+DT7vmDW1lgt2Il+ZH9szkHcFVSURZA4Dsq2ULV76KXE7BFmwwxqz0yrrfZKI07puz 33sgDUodr34fXdoBr2Doosvl4dgtJO49A3b1bhGkcztrZHb5qD9OiaLkcwo9OcijzhGe llww== 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=tPf6o+4Fx6BNBg9gjLd55OiV879tfPNqQcVlMqs6y0g=; b=JW8USF6zS0FkPHwYptPoqwDvTPNnrWYG42BVLIBByoxC2hcrgYw86BhJGbh2dm3uh4 9ITD/3Kt8VrdA6M2g4oTuawrwS+zWthvPolpzRpNHYK1A/EBsZZpOVz5gZ8LRfw37W+W oS/MIfShXENk5KKYPUWXNzP0fLlCIPBJynOciUazhVlhjoDWUBJF5HT5q8RrP9HVyI0b 8KQdUEu/1b2ltGNu7bfW7m2P+elC+rShl/qP/9muMgGb+o8nT5jKcfJCkyVyPxl6cIGF YA1Hb76b/YAx56Qyb2asHjFVIjmROscIkylLeNNSz8v3TSt9ANaET9hJrFECL8FP7nEL SO9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jHmFr0Ji; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id t3si14546186pgv.447.2019.04.23.06.29.45; Tue, 23 Apr 2019 06:30:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jHmFr0Ji; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1727994AbfDWN2k (ORCPT + 99 others); Tue, 23 Apr 2019 09:28:40 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39685 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727956AbfDWN2h (ORCPT ); Tue, 23 Apr 2019 09:28:37 -0400 Received: by mail-lj1-f195.google.com with SMTP id l7so13518769ljg.6 for ; Tue, 23 Apr 2019 06:28:36 -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=tPf6o+4Fx6BNBg9gjLd55OiV879tfPNqQcVlMqs6y0g=; b=jHmFr0Ji3NPCs6KScyG5QEgqkd/ZNlX5zGr23YkTpGO2to5XJsMw+hLNB1ZuPWG0g8 wiShsf0tLLH/TtyfTemrRboVDLC56NOsDUPkb5xH3oufJ4oNE64DyhfI/BW3RHF2jz7a yuoIcNqZrrcVzG/ulGq+Lx3VilqGfm2VLptYSwEiCbmVqiuXJCeQ8T25URw4xMo1D0gv ErRGrCLMoMJ2qD9B8QPBJh1IBMfijYAGqSAJqWTEyDfDVDr1PL2RnT7EwEhRb5nM89YM DWJ9gWe6C1ZRe5cB+GCy/GJniYisxNZifkud7+fxxQ2ZNwNH/f3s415udFVd9qqjieBC wwig== 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=tPf6o+4Fx6BNBg9gjLd55OiV879tfPNqQcVlMqs6y0g=; b=GVNtVgeve1f/mgcBIDEczDwNpmX0KrNCeAFLYlLx/5L29aKJygmyIsn87iNzW4AqcH VuMT7Kfe9/eDBpSpLUxvRn0rjaMhNqdjGdx6PkywVdmJkdeo3nXU+Rzl5xkPccQs1eGn Y5cf4NfPTLoU3+qPKtA2oTnZ6zYMj9SU+P6G620SdIUjAWfzEouC9DUdJ39pmh65kMRF eCw0NSgJobCJbjTqxqGBfDTTNV53EJDwcfsYnhWge9Yo/s2nmGJdcyYGiOp2gVaAqXfo bp8PWW7Kl0wj0CrQfdV7R6SipgW9Hz9credB48jhvzDKF5+yKQtpktTh3/lmKBN88hlc M9ew== X-Gm-Message-State: APjAAAWm4+zFPB/NFggETuIE0TvXe+zxDfGQ+lwUfOTULXwsr2f6sGhV rphZJrMTt1SCjglBOckOQnd9BQ== X-Received: by 2002:a2e:998d:: with SMTP id w13mr13886812lji.110.1556026115286; Tue, 23 Apr 2019 06:28:35 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y206sm4617107lfc.72.2019.04.23.06.28.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 06:28:34 -0700 (PDT) From: Georgi Djakov To: vireshk@kernel.org, sboyd@kernel.org, nm@ti.com, robh+dt@kernel.org, mark.rutland@arm.com, rjw@rjwysocki.net Cc: jcrouse@codeaurora.org, vincent.guittot@linaro.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, sibis@codeaurora.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v2 4/5] OPP: Update the bandwidth on OPP frequency changes Date: Tue, 23 Apr 2019 16:28:22 +0300 Message-Id: <20190423132823.7915-5-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190423132823.7915-1-georgi.djakov@linaro.org> References: <20190423132823.7915-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the OPP bandwidth values are populated, we want to switch also the interconnect bandwidth in addition to frequency and voltage. Signed-off-by: Georgi Djakov --- drivers/opp/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 97ee39ecdebd..91d1c2abfb3e 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -707,7 +707,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) unsigned long freq, old_freq; struct dev_pm_opp *old_opp, *opp; struct clk *clk; - int ret; + int ret, i; if (unlikely(!target_freq)) { dev_err(dev, "%s: Invalid target frequency %lu\n", __func__, @@ -780,6 +780,13 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) ret = _generic_set_opp_clk_only(dev, clk, freq); } + if (!ret && !IS_ERR_OR_NULL(opp_table->paths)) { + for (i = 0; i < opp_table->path_count; i++) { + icc_set_bw(opp_table->paths[i], opp->bandwidth[i].avg, + opp->bandwidth[i].peak); + } + } + /* Scaling down? Configure required OPPs after frequency */ if (!ret && freq < old_freq) { ret = _set_required_opps(dev, opp_table, opp);