Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4601676ybl; Mon, 3 Feb 2020 22:15:48 -0800 (PST) X-Google-Smtp-Source: APXvYqy5I/+exRLfrMTUbkXwSubgaMjt5Y8Sb5a6yC9PFi7Bga10AWUq2b79HcV1yIKkSfIYU3TC X-Received: by 2002:a05:6830:607:: with SMTP id w7mr11458997oti.155.1580796948622; Mon, 03 Feb 2020 22:15:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580796948; cv=none; d=google.com; s=arc-20160816; b=KeJLDcO+or7RURhsuUUPnmTx3O839byOtOpTh3PFzxmaajca50SXwPf3au/OQTegAO JPXo4SQ88The9zJVJFPF0/PyEudZJda2dw2DiTUcfLfH3cnwSrfRB+GNkuVDdtrl8ZE9 couV9xczBFdDC0vQBIDbLqib6X8Yyo4ZRbOsMBA0SCFjZE4vDfYI6jIaQwHk1W2jWn/b r3GC39EQ+AOW0e2iad/JeNWeanf/yLaJvTdjWn7gA4BgOJsUb9J/N1gf/nQhv8+9fKyZ QfVLzIgtyNfrnaxrAIUiJdWIUvP4nDY4CjAbx37TUjIS4Ikq64gC6MtU7AmeRMY2U9ZF duVw== 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; bh=yMgpZl6Nc2Mv5jBXj6/kJee030u5wTLMJwTveaYWiWg=; b=NwnRBdxyfv2ARjV+NAx9qJDRWAJbpOahU/kAtQpomxZP/wflcXWMI0549OFThlO8eC lgXtgYUAjoN415PExCRFDudvgaUEUDyR+g3UGCAfeqXZpr7UdaBhfeurVOCs+QKlLlUo XgHnAsO6EHAYsSPF3Rm2arzM9ztHxTXdDCgjDFEAIbSVhvNBv57wpWNa5QxWvuTc3J7E iXBpWJ3OF4GZVzFEKBM+QZhnA8thOW0AniVG/Ej5oseFnaQiPqq/KWE1pHSlOaTnnadr waS9Gvm6ztVV5FYSzv/3N/rBonxCUkjGhZ+sw+Of0PDOIkkJTAMC51JNgeYralr89bGn 7Wfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=NH0ieypG; 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 j20si11325508otp.147.2020.02.03.22.15.36; Mon, 03 Feb 2020 22:15:48 -0800 (PST) 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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=NH0ieypG; 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 S1726726AbgBDGOm (ORCPT + 99 others); Tue, 4 Feb 2020 01:14:42 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:53706 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgBDGOk (ORCPT ); Tue, 4 Feb 2020 01:14:40 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1580796879; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=yMgpZl6Nc2Mv5jBXj6/kJee030u5wTLMJwTveaYWiWg=; b=NH0ieypGj4adkFqBLOLE01W4pCVF4WO4Pv2CGbyydMN43MJe0jHQ7A0WfsDQqZpDELayQSy6 rAgZEKFu+GA27oAeW4eadC1USliWabTw0MeChV/jYBn6MZ16G95vA4d8Lx2f55DS63bsEWCI GYMqgAsxyfhAJSOszSCalOAVK7Q= X-Mailgun-Sending-Ip: 104.130.122.25 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 mxa.mailgun.org with ESMTP id 5e390bcb.7f42eb3398b8-smtp-out-n03; Tue, 04 Feb 2020 06:14:35 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C01DBC433A2; Tue, 4 Feb 2020 06:14:34 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mkshah-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.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 A5EFAC447A1; Tue, 4 Feb 2020 06:14:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A5EFAC447A1 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=none smtp.mailfrom=mkshah@codeaurora.org From: Maulik Shah To: bjorn.andersson@linaro.org, agross@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, swboyd@chromium.org, evgreen@chromium.org, dianders@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, Maulik Shah Subject: [PATCH 1/3] soc: qcom: rpmh: Update dirty flag only when data changes Date: Tue, 4 Feb 2020 11:43:49 +0530 Message-Id: <1580796831-18996-2-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580796831-18996-1-git-send-email-mkshah@codeaurora.org> References: <1580796831-18996-1-git-send-email-mkshah@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently rpmh ctrlr dirty flag is set for all cases regardless of data is really changed or not. Add changes to update it when data is updated to new values. Signed-off-by: Maulik Shah --- drivers/soc/qcom/rpmh.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 035091f..c3d6f00 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -139,20 +139,27 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, existing: switch (state) { case RPMH_ACTIVE_ONLY_STATE: - if (req->sleep_val != UINT_MAX) + if (req->sleep_val != UINT_MAX) { req->wake_val = cmd->data; + ctrlr->dirty = true; + } break; case RPMH_WAKE_ONLY_STATE: - req->wake_val = cmd->data; + if (req->wake_val != cmd->data) { + req->wake_val = cmd->data; + ctrlr->dirty = true; + } break; case RPMH_SLEEP_STATE: - req->sleep_val = cmd->data; + if (req->sleep_val != cmd->data) { + req->sleep_val = cmd->data; + ctrlr->dirty = true; + } break; default: break; } - ctrlr->dirty = true; unlock: spin_unlock_irqrestore(&ctrlr->cache_lock, flags); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation