Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4602771ybl; Mon, 3 Feb 2020 22:17:06 -0800 (PST) X-Google-Smtp-Source: APXvYqy9UCrLKJiC1POjbQAZ29v92WsHyR5rUK/XW6Nvj8MC8yG/q9wyTgDe3dIUuf6nWIggHHvy X-Received: by 2002:a9d:6f07:: with SMTP id n7mr20299384otq.112.1580797025972; Mon, 03 Feb 2020 22:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580797025; cv=none; d=google.com; s=arc-20160816; b=plHrX9jqm+RDQhFechu1vgUKajzZaFIzvAWkwCH7SSpf0xkQKvLGKCUdPGHKyLPw+N Kjq+9hLJLpR8Ujurm3ZPZIA9hL++exOgjkEP4jtFiLrAk7FlhkuouUfsSQuJ9JuC0Q0/ wnnuOR7tx8kD3iV7PvoqO/D9MACyI+aRD12+DMjJ72LazXYOrulFBQqC2VSIRqxuNdQi pHIobgxCFfb2APFR8uUUPY0TrbIGcUEdafXUIuhLaAu1PUV/1nLV7NSEkAXAKUcUMQxq MnR1TzoOneFCYmpjePonOi4INl/PM7RRvRqFJ3xR5hdopbdg6xoD3KJOvifIZHDCZ0WJ 9IIg== 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=lNM+zgIvhfpI499FSDfrS0zI/QLrGsHmRXdvT8JZSSM=; b=p7QGtptWmyqlWuVED7JWu/uEG+0iDdlHPL9An3WRBxGiQW1M6l+/bPSFj7kV9PfGa+ yNDxBwVi8tkNDhkawFAhNAs52r8YqelNTm4maKG4uXTVQ/O0++PXMDVpzo1xlu0zpJIO hhCdyAMG9yeqICr9uUvIybUjyEPNxiAZ8tSfVU8OsskDQrzff+N3I+41Gy4ZgKFgrRHG 8ISbrJmcJjLSQ/7KMJ/vOH2WVYzTP3P99OtExFS+H3O4HY1OOPQ6PPMSOXMNan3yiK70 KLEzJXdDeyc3CeXtKuD01m6JXHORyhufVB9avfo9Pat7eV1a32FfFVjdNDWjYJ95EgdL oLwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=EVI7zBWp; 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 5si10347831oiy.102.2020.02.03.22.16.54; Mon, 03 Feb 2020 22:17:05 -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=EVI7zBWp; 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 S1726965AbgBDGOr (ORCPT + 99 others); Tue, 4 Feb 2020 01:14:47 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:19211 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgBDGOq (ORCPT ); Tue, 4 Feb 2020 01:14:46 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1580796885; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=lNM+zgIvhfpI499FSDfrS0zI/QLrGsHmRXdvT8JZSSM=; b=EVI7zBWpOkP1y97SdfTtQKb/ssPuc96ZQcX2SYVwo9o2jl97+7zSqmG8/tkQPNRFr+jf8pXM 7VU8pL54VJPcgaIi7B6TUZdTVNbi/AJcynuRU8LvFEFT3wdi75L2flwelrMvG+3EYN/E5lW5 oWEECtbBe24TXsGduHsK6l4PX1Q= 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 5e390bd4.7f592b9f2810-smtp-out-n03; Tue, 04 Feb 2020 06:14:44 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 454EDC447A3; Tue, 4 Feb 2020 06:14:43 +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 232CDC447A1; Tue, 4 Feb 2020 06:14:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 232CDC447A1 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 3/3] soc: qcom: rpmh: Invalidate sleep and wake TCS before flushing new data Date: Tue, 4 Feb 2020 11:43:51 +0530 Message-Id: <1580796831-18996-4-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 TCSes have previously programmed data when rpmh_flush is called. This can cause old data to trigger along with newly flushed. Fix this by cleaning sleep and wake TCSes before new data is flushed. Signed-off-by: Maulik Shah --- drivers/soc/qcom/rpmh.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 04c7805..5ae1b91 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -475,6 +475,10 @@ int rpmh_flush(const struct device *dev) return 0; } + do { + ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr)); + } while (ret == -EAGAIN); + /* First flush the cached batch requests */ ret = flush_batch(ctrlr); if (ret) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation