Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4493853ybv; Tue, 25 Feb 2020 21:29:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwGe9BVH9WVC2OfmUYNsIQQ71JLaNZipoGjbNd/bX3gxIBbUEu9cWjTvURx+T8uYtzlfYbh X-Received: by 2002:a05:6830:140f:: with SMTP id v15mr1641638otp.218.1582694978171; Tue, 25 Feb 2020 21:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582694978; cv=none; d=google.com; s=arc-20160816; b=KwYGJ1QUFNntpNcMrpWhyXTVZH+bXvuEEwojxUk2qC8Rq75N5gG3qaYIWkhpuvy5Zp zP/KUNjvfkxJ5GN41HIqlyr/QWpDtcyY4H6vkiQ/BoinQcBzcKaVJqRAB0ZU8yfLRdEK X8B1jQK4dykFoLpSSxt7xurR8ObVbjFOYZN8udsfivlFt09hsM3my/fnC1mr9UaR+OvT SHbblcRyvHHbjGKRvHHHkV9OshPeLjgAVuoT4H9xwPeUFLSoYXB0darVbuqJ+FFgYxQx uEzaA2CDkyK1wkkPkuVuvdwNgKyNwxR2tDWXNdEbVUZAgfODgodctjhYXnhWTivKEEJV yWxw== 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=Y68tsXGzPZ8q14LHS1TLD6kADG3Oa9mJKTf+M/UdsM4=; b=Of/eDQsSZk8FaW973+Zrvymz9tBMdejS665SsVPCZD8mz5ChEDmetW9liMY4pyISxK B5QZT23SmI/wmtwlmbSTJxZdvhk37GUQqMQakLmF5NMad/TRhCvbKIcMv6ERIx/NF0aM e6gkIpQvKv6G5MTwEVAqxEZl/iZoxfqxv+lBpl8eFm8WAChd6kw6rH0cMpuMzucrK1NE vsUE5HM9Ui0xyWbJfQPwLauO1HqQHsAfoanAxUGBpGn+aZ11m9VsHqOGZFRVjBag/KQl MzSK0meKRCUuaoXNFT2+858WAWXYVn4rVNmzjJjPpvwU8Hnu+kB/wq2JOQD9JtflX+d/ I/0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=SU2+aO10; 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 9si575119oiq.104.2020.02.25.21.29.25; Tue, 25 Feb 2020 21:29:38 -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=SU2+aO10; 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 S1727072AbgBZF1q (ORCPT + 99 others); Wed, 26 Feb 2020 00:27:46 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:13704 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbgBZF1q (ORCPT ); Wed, 26 Feb 2020 00:27:46 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582694865; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Y68tsXGzPZ8q14LHS1TLD6kADG3Oa9mJKTf+M/UdsM4=; b=SU2+aO10w3w9nNQYV9oGTDomTVUTAgtoKHyP30Vx7xs+ktCNKiXCYsInaMrVsXf5lM49VTM8 g2+FIgR0oD6YuyFbjLVJ0K3a4V7/8ZJ2DroNtrRih33bkBn4C5GjZfQgYRiLHnlW4jSuFMcy rGtV6/G053RVu4Eu5XiCZDIYxHs= X-Mailgun-Sending-Ip: 104.130.122.26 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 5e5601c8.7f45e52cba40-smtp-out-n02; Wed, 26 Feb 2020 05:27:36 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2794CC43383; Wed, 26 Feb 2020 05:27:35 +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 BABE6C4479D; Wed, 26 Feb 2020 05:27:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BABE6C4479D 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 v7 3/3] soc: qcom: rpmh: Invoke rpmh_flush for dirty caches Date: Wed, 26 Feb 2020 10:57:13 +0530 Message-Id: <1582694833-9407-4-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582694833-9407-1-git-send-email-mkshah@codeaurora.org> References: <1582694833-9407-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 can get invoked when the last cpu going to power collapse deepest low power mode. Signed-off-by: Maulik Shah Reviewed-by: Srinivas Rao L --- 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