Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp865481ybf; Thu, 27 Feb 2020 00:57:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwl+h7N6Kqv6N/QBjvml/3qyKKH7Or40YdpD9YYp8Ygc2P5Bdg8IiDAvX0twD4D1Fiunyr3 X-Received: by 2002:a54:4791:: with SMTP id o17mr2363232oic.70.1582793863305; Thu, 27 Feb 2020 00:57:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582793863; cv=none; d=google.com; s=arc-20160816; b=S5PH86jUNjiA3kj0/GDzAw/3idjXGtFL7Yd8YqA8eSmOdutbeRrE7wAhZaP8Okss/u gjyl1vANqgNFO1nzxwgvQRzYrtciGrkw4bVu0sfqz7B14Q6rEbk3G+a6GjBtSBAvluJ5 U0wUxTtvCNcwDXIQ87Ns+qxG5epSKD9R9xhmqfQHEK6x2+kwCO8k9Y9AC1zFQ7jlnPhZ r7r8gQYtmL/yCIz5eidHXZx8sqiyoD3AaeSyTBBV9vTKGg0TgnHctcljpI88DxRhUL9C mXmHKYdViIWwEL/lvhvUmY6StORFgqQYxxQfMlITa0wA1VOvp4Ci4o89ZpEuoJPk1Zsp Wbqw== 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=Me3rgp82AsTmvT6KNwO9BrvbM8fnHBL1m8jXbzftToc=; b=NVHm354Wb0BZGAXKN07ZXTMUtES+S7MKd/ku0xMn0M15slBh0ryed78o812ipBpC3o jjfjwVTTe6bhj0i7SDuL0K6R1VDQpi6rFr0PVyRP2FILOH77AbE6V5KB03UmEWe8qjGf tjqg+I3GxVfvpLupsm62HfQ+8FN+tXaTgnk7XeWXgfxwZTu20shaVofLQqjkOdozlz0P d5oXlwbIxMDIG6D52E/SUGHUymgHdC2XMYxPKk78a6L3LiaIjRQfk6u+36sjKReMFFjr 46vkqa1m/i1n3bamUqqy0vho1MsBj4UPjkm1QVZa2dnrNuCJW+ry1aACGz06DSWGIVS0 M2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=v5mxHbpD; 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 z18si1123095otq.121.2020.02.27.00.57.31; Thu, 27 Feb 2020 00:57:43 -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=v5mxHbpD; 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 S1728672AbgB0I5E (ORCPT + 99 others); Thu, 27 Feb 2020 03:57:04 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:21654 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbgB0I5D (ORCPT ); Thu, 27 Feb 2020 03:57:03 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582793823; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Me3rgp82AsTmvT6KNwO9BrvbM8fnHBL1m8jXbzftToc=; b=v5mxHbpDUTu2DfjYOpBBd4R6naN/dQQuPrK7a6tzWsDrZMadhyt3gXQA/CmZ7mqc9EwlGBHY TKP2qKdnFYY3nR8I7B7p1ADoORFaAPH/Ysq930Evvwx5ymwTXbNXl+zI+tZp2LIdINVvg9Sv O9cQMKeNRhbuKbGgcBomEbcy0e0= 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 5e578453.7fd118621b58-smtp-out-n03; Thu, 27 Feb 2020 08:56:51 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 44F7BC4479F; Thu, 27 Feb 2020 08:56:51 +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, URIBL_BLOCKED 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 32AC4C4479C; Thu, 27 Feb 2020 08:56:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 32AC4C4479C 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 v8 3/3] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches Date: Thu, 27 Feb 2020 14:26:25 +0530 Message-Id: <1582793785-22423-4-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582793785-22423-1-git-send-email-mkshah@codeaurora.org> References: <1582793785-22423-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. Also remove "depends on COMPILE_TEST" for Kconfig option QCOM_RPMH so the driver is only compiled for arm64 which supports psci_has_osi_support() API. Signed-off-by: Maulik Shah Reviewed-by: Srinivas Rao L --- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmh.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index d0a73e7..2e581bc 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -105,7 +105,7 @@ config QCOM_RMTFS_MEM config QCOM_RPMH bool "Qualcomm RPM-Hardened (RPMH) Communication" - depends on ARCH_QCOM && ARM64 || COMPILE_TEST + depends on ARCH_QCOM && ARM64 help Support for communication with the hardened-RPM blocks in Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 3f5d9eb..326c58a 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -160,6 +161,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; } @@ -388,6 +392,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