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: 10912975 X-Patchwork-Delegate: viresh.linux@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7EFA1390 for ; Tue, 23 Apr 2019 13:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8751286F2 for ; Tue, 23 Apr 2019 13:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC86A28706; Tue, 23 Apr 2019 13:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6284C28715 for ; Tue, 23 Apr 2019 13:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbfDWN2i (ORCPT ); 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-Google-Smtp-Source: APXvYqxJBaGcY+Di1m9z+nyzZSyjRVq/y3HxdVMb8Y8nJx9/QbBtvSZgIZcPmYZ+R+o4V12dtvM85Q== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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);