Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp478844pxu; Thu, 26 Nov 2020 03:47:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzd2ZNuW6l1QFeG5ikE2yNnftCuy0tnp2fzNEQWKSK77E2cuk8raVteBmMYaUX6xN4rIk2f X-Received: by 2002:a17:906:c006:: with SMTP id e6mr2299150ejz.374.1606391220398; Thu, 26 Nov 2020 03:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606391220; cv=none; d=google.com; s=arc-20160816; b=uaYS63ZBZRAYZFq978dnMLYlvM2aF9dcXdObCgR2PX2N18QD6cChdWbsWcrx7Yo5/h tZIP1IVrQPDi6zhGHp7LM4Khiu2EgSTaskZNDl9r6PbrXVBhZI2X7pukASloJlwypwe0 9YcmsT++fCEgeehXIh018hfYOQjuYFLi8FlpXZeKlIYc75kov22fGtw/+WM8ekkx6kPj ko9Z5OWxNGIyFFn77H/8EQGPqAcos0ZEq2g1CfhepQ67DE4AwzTpDvPjTqROwd5xWjpO W+qIOC3PT4HLUGhEiofOJE4SYD/wFZBPkxPJk/VcGYA9RBuqTLq3F0rcSDQxHEPLVclg AThA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=V1pjUYJW5o8iIm9Ve8s/Y7L11LB0RM+Xdzju+6hP3Tc=; b=0N/aZYT5lIHJA0tlD0kmBrMSYbsRsTD8h9TyssR+iWO6n60H/IshyuvQvk6nJT8h1M Dnd0fm+Y7OjN/jFTXeQubKfU7alkhTq9YGyDx6zR00J05A6DNQIWCIwtBuzBeN5Y7v0K nq+7j7exvFmUsOfHFvSD2zVfBn6AAt9DXq8EI9nyvf/81lIceiHZBQ37DHlysU8cWiak O8P1m5w5P/kNz7vz101ayJJ3ulV+pgToNwI1Ed/o7cf3fI3WWzB6M1zcKnJGd69xGC7x 6OiAPrXEN/iwlJRcIIFoqtjJcLso/sfTWeZtsEEnfUyGiKWZe4jKDCQk9uKmFnSdfxuL 9xcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=K2ON84O7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw3si2881229edb.444.2020.11.26.03.46.38; Thu, 26 Nov 2020 03:47:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=K2ON84O7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387837AbgKZKSz (ORCPT + 99 others); Thu, 26 Nov 2020 05:18:55 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:23180 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387747AbgKZKSz (ORCPT ); Thu, 26 Nov 2020 05:18:55 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606385934; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=V1pjUYJW5o8iIm9Ve8s/Y7L11LB0RM+Xdzju+6hP3Tc=; b=K2ON84O7WHZ2JankteR+3yQpS/WNW/q7Y1yxw8lStJVyuwqlmE6IuipjuxzYNfyZ8csebg3T TWX9TSRbIDhUy6tR4O8gBKBHxrbut9t5qcGvdTbTHoiExR5YEn7gRgWnRdaVN6vcBrvs7Etr 0WhE9+FWBMVgOr195X7d6o0QK4M= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 5fbf810ac6fdb18c635f41e3 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 26 Nov 2020 10:18:50 GMT Sender: mkshah=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3EBECC43460; Thu, 26 Nov 2020 10:18:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from mkshah-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id E864DC43463; Thu, 26 Nov 2020 10:18:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E864DC43463 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=mkshah@codeaurora.org From: Maulik Shah To: bjorn.andersson@linaro.org, andy.gross@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, tkjos@google.com, dianders@chromium.org, ilina@codeaurora.org, lsrao@codeaurora.org, Maulik Shah Subject: [PATCH 2/3] soc: qcom: rpmh: Add rpmh_write_sleep_and_wake() function Date: Thu, 26 Nov 2020 15:48:17 +0530 Message-Id: <1606385898-8609-3-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606385898-8609-1-git-send-email-mkshah@codeaurora.org> References: <1606385898-8609-1-git-send-email-mkshah@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let RPMH clients call rpmh_write_sleep_and_wake() to immediately write cached sleep and wake data to the TCSes. Signed-off-by: Maulik Shah --- drivers/soc/qcom/rpmh.c | 16 ++++++++++++++++ include/soc/qcom/rpmh.h | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index cbe6b96..725b8f0 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -515,6 +515,22 @@ int rpmh_flush(struct rpmh_ctrlr *ctrlr) } /** + * rpmh_write_sleep_and_wake() - Writes the buffered wake and sleep sets + * to TCSes + * + * @dev: The device making the request + * + * Return: + * * 0 - Success + * * Error code - Otherwise + */ +int rpmh_write_sleep_and_wake(const struct device *dev) +{ + return rpmh_flush(get_rpmh_ctrlr(dev)); +} +EXPORT_SYMBOL(rpmh_write_sleep_and_wake); + +/** * rpmh_invalidate: Invalidate sleep and wake sets in batch_cache * * @dev: The device making the request diff --git a/include/soc/qcom/rpmh.h b/include/soc/qcom/rpmh.h index fa8bb53..59b68f8 100644 --- a/include/soc/qcom/rpmh.h +++ b/include/soc/qcom/rpmh.h @@ -22,6 +22,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state, int rpmh_mode_solver_set(const struct device *dev, bool enable); +int rpmh_write_sleep_and_wake(const struct device *dev); + void rpmh_invalidate(const struct device *dev); #else @@ -43,6 +45,9 @@ static inline int rpmh_write_batch(const struct device *dev, static int rpmh_mode_solver_set(const struct device *dev, bool enable) { return -ENODEV; } +static int rpmh_write_sleep_and_wake(const struct device *dev) +{ return -ENODEV; } + static inline void rpmh_invalidate(const struct device *dev) { } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation