Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp439596ybv; Wed, 19 Feb 2020 02:41:54 -0800 (PST) X-Google-Smtp-Source: APXvYqznKA4MfwtRvx8fjEgEbaW7CRWKKuST2vyTY2uereWihxgwaQiekAXoSCUWisdMNj+UYuIc X-Received: by 2002:a9d:760d:: with SMTP id k13mr18288999otl.42.1582108914406; Wed, 19 Feb 2020 02:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582108914; cv=none; d=google.com; s=arc-20160816; b=hlmfMbh4q5/DI1iHLybgC+fMOx9v5WjKFML6GcDiXnjGOwSwxMv3Ss8/DFmpXLz/z0 SDV1pXBFZaiyWLpw77AO2VwOaMpNThj7ATAoPXe8Jde4+Fd5G9Y6q2du7GOV9JNFcHzq XDgAv5V21Zrbxa6ZQvjHBnvULoPJj1MYvCpu/MEc0HiyuM9BGyl5OH9lBf9jB0FvUL36 YONw4MwElL9ZskFYzzDrhUJ/Q0FcoPH6CPwKf14TvqwNEUbn6Z6+TaKrqP9pojs03iG/ FSGdJITJbLsPS2dXFy0XIWlbuEX/nLX/gguCHfR6xaOy5MqCu8Dw4+bzcnP6wHQj0+Bu 0y2Q== 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=emh5A6mkF9IlRNLF9/kdYwlLasTRTZIXQ0xT8fk6B3w=; b=dGVxkdy+yxr8QyqLQnyu+eMhbNdMCo5y9X6PDsTIdzlcSb7vsL+KTjUxnGkeh97DUd zzf+cx7rDCncFV3T4zIbsshpNoVN+EWpXahzzEzRQ9TaW6tIuAZ9/P8qdyHAYi9x/ODV TPqg4sw8xiSNg4odTFwj6ykc6+tAazh/8toFMSoUrOC9ipqwhNysorvkyG/rmKuHlVBE BPIR/bc1Eo7CKkz3GYAI+d6OMamzrP4pOaoY5C1sQ+XMXKEnEdioUQb6crlpzu0/BzWG a2uQuElacxYgAu1QvqeNByaojUSauEn2ntjDn/BzrEatZ5DYpHeg75vWK8s5x8nbx4mr c7mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=YXfzBWdA; 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 k125si8468282oib.212.2020.02.19.02.41.42; Wed, 19 Feb 2020 02:41:54 -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=YXfzBWdA; 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 S1727099AbgBSKlC (ORCPT + 99 others); Wed, 19 Feb 2020 05:41:02 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:43621 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbgBSKlB (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: 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 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation