From patchwork Tue Oct 13 13:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 286792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7122C433E7 for ; Tue, 13 Oct 2020 13:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C0F524799 for ; Tue, 13 Oct 2020 13:59:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T0Lbzn5x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388132AbgJMN7O (ORCPT ); Tue, 13 Oct 2020 09:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387819AbgJMN7O (ORCPT ); Tue, 13 Oct 2020 09:59:14 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C935C0613D2 for ; Tue, 13 Oct 2020 06:59:14 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id a72so23696wme.5 for ; Tue, 13 Oct 2020 06:59:14 -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:mime-version :content-transfer-encoding; bh=xYqWuTW/0Vb6gGlVF7Mqhv2moxO3xlTQ1hwvFz7tpn0=; b=T0Lbzn5xsQq5ohWfhjLZa15Y2tTnWUX4qvT414oZujmvMxJo0+sBsDhdPtjbxgPZ9W wz0JOI3pw+Z3affCaTtFQvUQvEtByaCYO8yuH/nfIGKpioMewNxKLWrQwtokcaUyGC6G 8L2NKfLyN0J8Q5JITaulmvha9GwPTCPqkKizm42ET85yAes2eo3+7/F8XzYcOoSYjqxQ MTa/FQmT9gB0Dn6CNedEDebc6QFPc7nqQcFCSUeQr2OLi8qL391+dlVpOHpqHbulKAWh I6CGA21MWIHW6P31zpAzghqvcjAaqMlFDV4R8F2DdcJUmlXdOLT4wrnxht3qhb2EPSYl NU3w== 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:mime-version :content-transfer-encoding; bh=xYqWuTW/0Vb6gGlVF7Mqhv2moxO3xlTQ1hwvFz7tpn0=; b=bg0kDNBvxhvzD3JKQwREW/IS66i+bChaPLzygXCbw6R6ZsxeLD1zxI2rkgYeXigWW5 q/YN0wRm23NNWGMFsgEjtFC9BjCHJ9Ka6KYGlAccJ7JRE6RAVldC5T5WZ99S6V9a65st QDddP0OM6lIripR1H84KG81S5VfdsAvHsRm3Y6g0NAwcp7v3A8gdZzoCR/hthUVch5/I C1AyTZWV4HDhm9PyzkWxJK4Kq21tGu2scMa1DskebTizI6t9cmGtiwSkpEaLYlA/iOWO EQ+6I2ptT8yIu4UjIno3xEYpA9kMVYhSDghYKTSfiVFJJuH38LASx2SXXvrOg51dAirF 87Mw== X-Gm-Message-State: AOAM5327o0ya0YPwAPzDfXKaMZe/8f0ypYsRCT07CrpJM6Ea2EEbtbgl wEPAN9JNpXsRF5dqWHjvFobIe3tRjBpPVg== X-Google-Smtp-Source: ABdhPJxhjDWYCCReMk52XDj/uJUpC3UL0DI10mjq49N44EKAuYAhZl162evpZLmnK9N44Jw+wXmgwg== X-Received: by 2002:a7b:cc17:: with SMTP id f23mr58713wmh.166.1602597552536; Tue, 13 Oct 2020 06:59:12 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a199sm17785wmd.8.2020.10.13.06.59.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 06:59:11 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: mdtipton@codeaurora.org, okukatla@codeaurora.org, sibis@codeaurora.org, saravanak@google.com, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Georgi Djakov Subject: [PATCH 1/3] interconnect: Aggregate before setting initial bandwidth Date: Tue, 13 Oct 2020 16:59:11 +0300 Message-Id: <20201013135913.29059-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org When setting the initial bandwidth, make sure to call the aggregate() function (if such is implemented for the current provider), to handle cases when data needs to be aggregated first. Fixes: b1d681d8d324 ("interconnect: Add sync state support") Signed-off-by: Georgi Djakov Acked-by: Saravana Kannan --- drivers/interconnect/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index eea47b4c84aa..974a66725d09 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -971,6 +971,9 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider) } node->avg_bw = node->init_avg; node->peak_bw = node->init_peak; + if (provider->aggregate) + provider->aggregate(node, 0, node->init_avg, node->init_peak, + &node->avg_bw, &node->peak_bw); provider->set(node, node); node->avg_bw = 0; node->peak_bw = 0; From patchwork Tue Oct 13 13:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 286791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C4DC433DF for ; Tue, 13 Oct 2020 13:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 414FF2479D for ; Tue, 13 Oct 2020 13:59:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FYwrlQmK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388176AbgJMN7T (ORCPT ); Tue, 13 Oct 2020 09:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388170AbgJMN7R (ORCPT ); Tue, 13 Oct 2020 09:59:17 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45740C0613D2 for ; Tue, 13 Oct 2020 06:59:15 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q5so56234wmq.0 for ; Tue, 13 Oct 2020 06:59:15 -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=8bDJucZgJh5FF2qZq2dSXU5O6ciFzNhYy3NAEbiOW5U=; b=FYwrlQmKtFjItcjW6NkFA6usPpaoxqkvxN79cTvEqLVez2ARTv8noXL+aHKz9UF49Z yVXpMQ89CRyszsM4HeQ8CSiosmbuBKpjt0ILH+VmI+6+Umkf7ONAeQy+u3Xssg3oV9MM GmmHDplpH3S3q3zVshgXn5CD5HFk2UBehaCr8EeMGdI4NlsHu6/AE2j08dIwmK9WgY7v /7u/DY3dMA71zueWe76a1so59dbBTs3ApoT9oIYbcXPxWFzSwCygQcgV7D/V3RlOTI90 VPKw5NxJKEi5cqGslb9JoN6KvpqOWf2TRBZ7x6fed4Ukp+2xey6DZU+MkZVUU5eKBxtM GmHg== 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=8bDJucZgJh5FF2qZq2dSXU5O6ciFzNhYy3NAEbiOW5U=; b=ZK9OE9z/0ItOhNnGmENTwYPmBwo/lrCT4ntpwXrjMJUGl3lmXqReYMCopdpSWsXVR7 j2MpDFFmME2u6nSdDDWEfgZVgOsNXFK+eH0ujGE1KH/NXbb0zLoxcumtTX6vDfW7108K pxQJKM8Gw5df/6gEcuI+vzVNj9jfDmTC21GnkfKwc4f8xj+TsQtrwxhkFfnmtb3xxAfm iYzPVWwKbRCeooXNlNXNEmBm+nTPSV0a25E5yWlnB80+Mj2U5UQ4LvaS/ejsSexKkBjQ f0rMc7Ndkm1WsacdOilv48TQGNVsc0Mok871fh7DaHPmiQ9EvgVZiTety9kTAD+ad2wr lKlA== X-Gm-Message-State: AOAM533uqeNclSdBx2Pmnn6Zdbk9N5z9fk6KwJr+jUMjHCitGBdElah8 O3DJC6qSrRzr7p2Rh3MQrntuZnj/qp58eg== X-Google-Smtp-Source: ABdhPJyTqWE1iekyZsDPD0wv7UkeTZYONKeacFueCiZ9ySbqbFfs8FIbdlS+AoqntIL9/dCNMWdhWg== X-Received: by 2002:a7b:c4cb:: with SMTP id g11mr78968wmk.88.1602597553753; Tue, 13 Oct 2020 06:59:13 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a199sm17785wmd.8.2020.10.13.06.59.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 06:59:13 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: mdtipton@codeaurora.org, okukatla@codeaurora.org, sibis@codeaurora.org, saravanak@google.com, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Georgi Djakov Subject: [PATCH 2/3] interconnect: qcom: sdm845: Init BCMs before creating the nodes Date: Tue, 13 Oct 2020 16:59:12 +0300 Message-Id: <20201013135913.29059-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013135913.29059-1-georgi.djakov@linaro.org> References: <20201013135913.29059-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Currently if we use sync_state, by default the bandwidth is maxed out, but in order to set this in hardware, the BCMs (Bus Clock Managers) need to be initialized first. Move the BCM initialization before creating the nodes to fix this. Fixes: 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state") Signed-off-by: Georgi Djakov Acked-by: Saravana Kannan --- drivers/interconnect/qcom/sdm845.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index d79e3163e2c3..47556dc12ec0 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -489,6 +489,9 @@ static int qnoc_probe(struct platform_device *pdev) return ret; } + for (i = 0; i < qp->num_bcms; i++) + qcom_icc_bcm_init(qp->bcms[i], &pdev->dev); + for (i = 0; i < num_nodes; i++) { size_t j; @@ -512,9 +515,6 @@ static int qnoc_probe(struct platform_device *pdev) } data->num_nodes = num_nodes; - for (i = 0; i < qp->num_bcms; i++) - qcom_icc_bcm_init(qp->bcms[i], &pdev->dev); - platform_set_drvdata(pdev, qp); return 0; From patchwork Tue Oct 13 13:59:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 269746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3C18C43457 for ; Tue, 13 Oct 2020 13:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E4A02479A for ; Tue, 13 Oct 2020 13:59:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UHFX6ogs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388181AbgJMN7S (ORCPT ); Tue, 13 Oct 2020 09:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388176AbgJMN7S (ORCPT ); Tue, 13 Oct 2020 09:59:18 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88821C0613D6 for ; Tue, 13 Oct 2020 06:59:16 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id n15so24206359wrq.2 for ; Tue, 13 Oct 2020 06:59:16 -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=+bxQjF8JFA6Asp2x5Qy6bOVvEknWT2jmgAadI+Foe/4=; b=UHFX6ogsO9YEIpG7gnor6Jqroymz8ZdFMfwBgY/YnjRGDWk0Pegm37VyPl2TgQF5kH vj92LXD9MWFC9LoKlOn7V4+8rkWsBTmKCmznAkmSPV3OUi6bCeSKhnRT9a6QuXnPZeAW 78F/hDYd4oNUQ7IZYHKvywWP0tx0xrtnRkJp3bChNvTbz2ijfnaNWSmK8Y231P90Ya7h Mnh7Y3mkorQ3UZ/KstidY7o0MLC2jaLpT38dGooda1B6XEz00X+NDIJOIH5CpIlJjnku 3mWCTkdgtru9x58w/kJNfIfozrbntdYPaL/PpP14Rj8ACE676wMRiKQMKdJOHX1sPgwb uQBA== 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=+bxQjF8JFA6Asp2x5Qy6bOVvEknWT2jmgAadI+Foe/4=; b=npibwHKE2WmFMCW+NMnho5zWPHrrQzxCsUGPPm020LgscYecqhFrVywHP2vcUxMc0F 9bL3ryH5J3F65ruyasonMAeF5cvgx9zvVN8a8JgG/ad7rtT0nBtSy+5Bjn0Hmwuk42JZ LneLHOjvbQ2U+/q3ToHCAUJXsQtZHU9NKUtFSQ4wrFP+6kQPRrxk/gbICNeh455Eh5+N sfbuT7sI4pyETucsA6/Xf4/44ebEIlZm93IZ68cQccGjKQvyI0/KMOBd3bOFU+NO1Rsx GKlaNMdnn9nH8RTAQ7ACapitK0GBgfE36KkR9UqjU07/ay6LkTKe+2HzMdftFUZfHKCa 8Eug== X-Gm-Message-State: AOAM53391+cv9Nc4gh9w/CsEaCi/Tzk25tt9qAvQXvQ0gpYwn4pyFRFq bZ66dcxFNrYnY2s7E8pnbGvFUhZRQ5duyQ== X-Google-Smtp-Source: ABdhPJySAnjh+044UzGZPOEf9/B71RqNokP2SUMBpwVEdgmbgwgSwLsXYJa+QYU6CxndkNvBNPltTQ== X-Received: by 2002:adf:a31a:: with SMTP id c26mr34581095wrb.378.1602597554919; Tue, 13 Oct 2020 06:59:14 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a199sm17785wmd.8.2020.10.13.06.59.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 06:59:14 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: mdtipton@codeaurora.org, okukatla@codeaurora.org, sibis@codeaurora.org, saravanak@google.com, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Georgi Djakov Subject: [PATCH 3/3] interconnect: qcom: sc7180: Init BCMs before creating the nodes Date: Tue, 13 Oct 2020 16:59:13 +0300 Message-Id: <20201013135913.29059-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013135913.29059-1-georgi.djakov@linaro.org> References: <20201013135913.29059-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Currently if we use sync_state, by default the bandwidth is maxed out, but in order to set this in hardware, the BCMs (Bus Clock Managers) need to be initialized first. Move the BCM initialization before creating the nodes to fix this. Fixes: 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state") Signed-off-by: Georgi Djakov Acked-by: Saravana Kannan --- drivers/interconnect/qcom/sc7180.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/sc7180.c b/drivers/interconnect/qcom/sc7180.c index bf11b82ed55c..8d9044ed18ab 100644 --- a/drivers/interconnect/qcom/sc7180.c +++ b/drivers/interconnect/qcom/sc7180.c @@ -553,6 +553,9 @@ static int qnoc_probe(struct platform_device *pdev) return ret; } + for (i = 0; i < qp->num_bcms; i++) + qcom_icc_bcm_init(qp->bcms[i], &pdev->dev); + for (i = 0; i < num_nodes; i++) { size_t j; @@ -576,9 +579,6 @@ static int qnoc_probe(struct platform_device *pdev) } data->num_nodes = num_nodes; - for (i = 0; i < qp->num_bcms; i++) - qcom_icc_bcm_init(qp->bcms[i], &pdev->dev); - platform_set_drvdata(pdev, qp); return 0;