From patchwork Tue Apr 23 13:28:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 162698 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3790224jan; Tue, 23 Apr 2019 06:28:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzf/RS3oUHS3Vp9cSAagTu9zafznbjUEh/ccfA4URr6AA+/3Kohv1Fl9mIgOr3/mzQkqonI X-Received: by 2002:aa7:8092:: with SMTP id v18mr26454875pff.35.1556026120453; Tue, 23 Apr 2019 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556026120; cv=none; d=google.com; s=arc-20160816; b=LezMsr4hDvtgxF6hLtLxdwQcgDXufXNit8rL1N+wG0EQRsfHYHeIUYOIT9XSI2kFAy TV++3qDPd5fy5C1MIoSpHT4J37D/NpNT1X1tF2XRvJwDLFCIepX5X2qHyc39kYsRGEH6 j2/9mxE6H2yp7OiGkObsQ/lROtgR6CfX2kRq6cjH78qmgcB1u1AdcuryfG28aLK6ZkXg U4z5GeJjbMPzq4x54YnkokDNCZCEEZ5RKX4GUSeJQDMD2138wdo+ahNps0gwhmET7lnK TMp6EePr7QrB13AarvLjeD3SknkJZEthMIBAan71wJ9IoLuvrzKBDXgq8FFG1Ixj4TmE tfeg== 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=ym1O7VAagg2nE2WubBygg3tKUMDTbqoNk0c8bHCF2gctxpkOEOFXD81fRV5ZDdFo6g ezHdLaAE9SKy7xANfROaUJ2OO5HzPm9J/OagnpHaV0byd1/U5M1BqT0wF6tvdY/v15/P krwtZrDj/lX/U9UR3WmRhuIejs33YU+ptMM50cFM5LbPC8kAZbviWE58JR0SCbNeY9ss GyY/QEoGbecY12lUvhhWUqOQnPJP0ecRMmvuYMTl++HuP/lU8JaauqOxxb+ui8GPLLMB dhO+46RZb2FK3UNHciq3hxp73SKNKPvlF8uRLdK26snjmm6dJQAPM+abjLO269hrEHwi MGug== 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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 j9si15727083plk.125.2019.04.23.06.28.39; Tue, 23 Apr 2019 06:28:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1727953AbfDWN2i (ORCPT + 11 others); Tue, 23 Apr 2019 09:28:38 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36678 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbfDWN2h (ORCPT ); Tue, 23 Apr 2019 09:28:37 -0400 Received: by mail-lj1-f193.google.com with SMTP id l23so2931900lja.3 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=suzuJR3LqP2NZnO+VvHn29DyCFJBLGDqfGPgT//POi9kR3cOKyGTEm8NwVANGSjYNv 9JnBbwmj2Fsiddo/C3oWumIvuz3YzkOEPLuHxUoPBkOewVCnRph212SC/Hrou1GHJ4UK 1QwFfboMM/i4OUw4LucLZ20lXyYoo0FepHjOCE/dHsJvRxpvZZJYT5cU7Kx3dBcfC1AH IXm38NWjZo6sZDUNq4a5so06X4zvlSx/Drrwx0QPB+vwJOfjpWFkZVCe7UNO1GB9ViLF fOGeNqX6+PxFNDZNtUpgAr6DJQeRXRwHFCa1YLskPxWoO6d6RUyeOuQsRlgofVaBM4Zc Q+ZQ== X-Gm-Message-State: APjAAAUB7HsW5u+zvaJiRNWxNiSgENl2mNywAgXUfPrB9vZSOiRuQW9d zBzMZQH/8lcHZAXjzSwPHGjWig== 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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);