From patchwork Wed Feb 19 10:40:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Shah X-Patchwork-Id: 11391235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEF1C109A for ; Wed, 19 Feb 2020 10:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B01762467D for ; Wed, 19 Feb 2020 10:41:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="YXfzBWdA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbgBSKlC (ORCPT ); Wed, 19 Feb 2020 05:41:02 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:45260 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbgBSKlB (ORCPT ); Wed, 19 Feb 2020 05:41:01 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582108860; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=emh5A6mkF9IlRNLF9/kdYwlLasTRTZIXQ0xT8fk6B3w=; b=YXfzBWdA2LQxY7gM8NLaPegW/qGlrX8mmRFXppvsSrevdyzRyTVT/s92tT6yygUzaW5hNSO2 uLTNq08DswBmUPg7WOBJq2f5jIDoxP5Ir0FjPn2QC0iV7sQlctNzTCiKPc8swVhwe+mK7YGl pzkeGGIHQOGBNjNXOwareDefjTk= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== 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 5e4d10bc.7f108ad1b490-smtp-out-n02; Wed, 19 Feb 2020 10:41:00 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 36047C4479D; Wed, 19 Feb 2020 10:41:00 +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=ham 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 CA021C447A3; Wed, 19 Feb 2020 10:40:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CA021C447A3 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: swboyd@chromium.org, mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, agross@kernel.org, dianders@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, Maulik Shah Subject: [PATCH v5 7/7] soc: qcom: rpmh: Invoke rpmh_flush for dirty caches Date: Wed, 19 Feb 2020 16:10:10 +0530 Message-Id: <1582108810-21263-8-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582108810-21263-1-git-send-email-mkshah@codeaurora.org> References: <1582108810-21263-1-git-send-email-mkshah@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add changes to invoke rpmh flush when the data in cache is dirty. This is done only if OSI is not supported in PSCI. If OSI is supported rpmh_flush will get invoked by power domain off call when the last cpu in the domain is going to power collapse. Signed-off-by: Maulik Shah --- drivers/soc/qcom/rpmh.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 83ba4e0..839af8d 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +164,9 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, unlock: spin_unlock_irqrestore(&ctrlr->cache_lock, flags); + if (ctrlr->dirty && !psci_has_osi_support()) + return rpmh_flush(ctrlr) ? ERR_PTR(-EINVAL) : req; + return req; } @@ -391,6 +395,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state, if (state != RPMH_ACTIVE_ONLY_STATE) { cache_batch(ctrlr, req); + if (!psci_has_osi_support()) + return rpmh_flush(ctrlr); return 0; }