Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4875060imm; Mon, 11 Jun 2018 21:42:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLCewlLVam+GwhJlwX5fK9lbu5PlF0WlENZA5JGiy2ZysAHLzBBfKVlBGTEkqe7pIUW/F46 X-Received: by 2002:a62:190d:: with SMTP id 13-v6mr2114920pfz.103.1528778561297; Mon, 11 Jun 2018 21:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528778561; cv=none; d=google.com; s=arc-20160816; b=d7NKnEes4RO0o/9DIrubuhWmi4mRaZt4CXKbr9oxiGpyvIcCIKRtaFdX1b9tfXvFpJ TNGsRyJc6ph2fgXAh6aAXxT5c3Z1/gKbLg9C36visl1nLVT78o4/JhFkKjXka8Pgg4Dy W88o5nqV/SVhtKjN0hUYLeNaV/kw8fN44cHYLvMPVlvpV6lnjSfsg5/bnsavNirpufhQ UDSbamqR4UGjhhWanhBmA3Cjd0tMVsmJI6svpU57drONyD9dd2FcZdpyMVFreTGRMzDs O4Wy2LIxr8izkkQp1p/ThurzFe/+XNFMTWTQFERgB/ftD5wAlSp5StJWw1UiaLciKWzr V+eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=z60OTIc1MIK54F0Q3MYOBINlc94nJhEhOSmZicgV5A0=; b=l6UZowVpaZJRJ4mtpYfrE5uql6kTeI4+oAEp0pcPnyGyWs5dfIX4TuCBSwe5lAls4U VlMrFxCz2NYq5QRxqVl9QN8cccuE2Mw8WVMRjdWfBcdW/dG7fuO9tu/W+4CGWYadUpaH g2n1mpvBe3VwmKsZmYdJ0ni/vuKJBoO8Q6znhJHjwo0Tiyh0+WW2yFWKKp2ypmN5zu2f d8InlnGNaBuZiHAFyHKNRiVGz2GcqANBQHLCZkcMBTCrXuShbeDLQFjPzLg05uPZJXnk QgQRjQQdPGxvjnQObAuwOSPfPEkvNgX8ISrMdnWKmCC/paxDcIj16jtw2eFGhxJlBvPa O4QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Dn3yzmNS; dkim=pass header.i=@codeaurora.org header.s=default header.b=IOdPoKrh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12-v6si27045942plk.48.2018.06.11.21.42.27; Mon, 11 Jun 2018 21:42:41 -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=@codeaurora.org header.s=default header.b=Dn3yzmNS; dkim=pass header.i=@codeaurora.org header.s=default header.b=IOdPoKrh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932996AbeFLEls (ORCPT + 99 others); Tue, 12 Jun 2018 00:41:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35868 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932905AbeFLEla (ORCPT ); Tue, 12 Jun 2018 00:41:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2BD62607A4; Tue, 12 Jun 2018 04:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528778490; bh=M0b6QQWRYiOc3VejHCeclEEhrzEt2uFxjWyPFgLdGCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dn3yzmNS0zb9CzoWyslFYckjizvW9UCYXGFVqHrsTMAFitLKTYhwA+o/PaYSZqFCK cSvmH1sBbHg4L+ur5H6PZxHNyRBIDmzYatADwjU3rnzQhpjjFqhRkbI1Fgb+KCTaXP f9cDQaE9pSvsIOu5ICGoq09n4JWwSpDUOAXR2Xwk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A6F44602BD; Tue, 12 Jun 2018 04:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528778489; bh=M0b6QQWRYiOc3VejHCeclEEhrzEt2uFxjWyPFgLdGCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOdPoKrhlhkYRR1E8DAaqv37k6mjosYmr4XdX7Mm7pyT5TvXG437SuM29A/prNBkO 4ZLDgKABeVqqpvdcVPdaeXRf7BuN0++tR/XApeu/9454tV8/2cGBwzG//6ZXZFi6By wEukGm64HkSW6g1lYp9xdM41F7GjnklCrBAI98xs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A6F44602BD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: viresh.kumar@linaro.org, sboyd@kernel.org, andy.gross@linaro.org, ulf.hansson@linaro.org, collinsd@codeaurora.org Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Rajendra Nayak Subject: [PATCH v3 7/7] soc: qcom: rpmpd/rpmhpd: Add a max vote on all corners at init Date: Tue, 12 Jun 2018 10:10:52 +0530 Message-Id: <20180612044052.4402-8-rnayak@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180612044052.4402-1-rnayak@codeaurora.org> References: <20180612044052.4402-1-rnayak@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we move from no clients/consumers in kernel voting on corners, to *some* voting and some not voting, we might end up in a situation where the clients which remove votes can adversly impact others who still don't have a way to vote. To avoid this situation, have a max vote on all corners at init. This should/can be removed once we have all clients moved to be able to vote/unvote for themselves. Signed-off-by: Rajendra Nayak Acked-by: Viresh Kumar --- drivers/soc/qcom/rpmhpd.c | 12 +++++++++++- drivers/soc/qcom/rpmpd.c | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 7083ec1590ff..3c753d33aeee 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -329,7 +329,7 @@ static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd) static int rpmhpd_probe(struct platform_device *pdev) { - int i, ret; + int i, ret, max_level; size_t num; struct genpd_onecell_data *data; struct rpmhpd **rpmhpds; @@ -390,6 +390,16 @@ static int rpmhpd_probe(struct platform_device *pdev) pm_genpd_init(&rpmhpds[i]->pd, NULL, true); data->domains[i] = &rpmhpds[i]->pd; + + /* + * Until we have all consumers voting on corners + * just vote the max corner on all PDs + * This should ideally be *removed* once we have + * all (most) consumers being able to vote + */ + max_level = rpmhpds[i]->level_count - 1; + rpmhpd_set_performance(&rpmhpds[i]->pd, rpmhpds[i]->level[max_level]); + rpmhpd_power_on(&rpmhpds[i]->pd); } return of_genpd_add_provider_onecell(pdev->dev.of_node, data); diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 53209454c1f3..6440163305e3 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -310,6 +310,15 @@ static int rpmpd_probe(struct platform_device *pdev) pm_genpd_init(&rpmpds[i]->pd, NULL, true); data->domains[i] = &rpmpds[i]->pd; + + /* + * Until we have all consumers voting on corners + * just vote the max corner on all PDs + * This should ideally be *removed* once we have + * all (most) consumers being able to vote + */ + rpmpd_set_performance(&rpmpds[i]->pd, MAX_RPMPD_STATE); + rpmpd_power_on(&rpmpds[i]->pd); } return of_genpd_add_provider_onecell(pdev->dev.of_node, data); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation