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: 10912977 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 C91681390 for ; Tue, 23 Apr 2019 13:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB80128715 for ; Tue, 23 Apr 2019 13:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF4DF2873A; Tue, 23 Apr 2019 13:28:46 +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=unavailable 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 6811A28715 for ; Tue, 23 Apr 2019 13:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727982AbfDWN2j (ORCPT ); Tue, 23 Apr 2019 09:28:39 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33399 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727977AbfDWN2h (ORCPT ); Tue, 23 Apr 2019 09:28:37 -0400 Received: by mail-lj1-f193.google.com with SMTP id f23so13551814ljc.0 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=J3XaQgCC5Zv65xcpriumksskYug4f7A01520ThW69q3IQaFQr7HwkGJbpnSJGWDG50 +AzMeUM2jyR5+Ku3Z0X6e7mSIrfEpLD6fn/+jM7eNj3bTE9aFrx8xuP4i/Ecr456b1ku 3ZJM2Ujwb4tdRFtWzkAklC1zoudYjSvSjn49SJ8rvd9jY7WBmVmjvLWvx5b4I3cciooh Qn2eWjLeyCaP7rlQ0wfjyExTgdj3Eb4FM239M9JZHf5OydZxNmSzoLpZn1sOawjD7+qS H19ZzkSWZpgFkb6SkdX66RgGMzKiyP3ZkMZId2xC4Ey9ceQZe5fnklnRGEZWRK5Zx+YW qerQ== X-Gm-Message-State: APjAAAWQUrGcKw1lES8XJtnPn2KjkrVg0LFgaLRPneGUOZvtTW8YE1v3 HDoq8jhQlc4Nce3V8I3eYQFoEQ== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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);