Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5607353ybf; Thu, 5 Mar 2020 03:50:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vu/xD/qD0KycsZbDaQIbf2hXNgg1JpU9nwZYGMobfUQS9FkgXwJyItL+mTnB79AiQQOPw7m X-Received: by 2002:aca:3189:: with SMTP id x131mr5441618oix.33.1583409028008; Thu, 05 Mar 2020 03:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583409028; cv=none; d=google.com; s=arc-20160816; b=xkQG8jYJAUR8Ig5/cO0U/dRr254Kt19I7e3DLNd/PUn3nW9K68V0R97KwhWFfHhOze wR2tK3b4AlutgSO9f4Jnw2o2zMfWBc3eWWap+ScEmvspHlWNrGLDXJ1O3nsrUzB+Rzql vFCxSW27Ec2a9XSZsk/vKDUqHNrtIxi7vfqH+bt8jQZPj5zmN+bNvDTt7UiJCbFStnVo 8Mwxr4TWMR8uu0WeqmFUnvLtaDwrqKC7Gspb6iBnV+Uo7wyN3JJaMnMmloV4tW6aoRMI gOiDNT1x/cGDOY9t7cXDzgVwLGKXsoZ3WqDam0i08bs+jNgO1EFXJ6q6QHtTwicCo1aM e45w== 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=pRNvHxX80n8wBj2lKTDP98u1doAk5pcKRHB2R9qvWTg=; b=n3CjCStjBXHh3p6jKYi+Ayl2PLXDqzLDXGOe/efS4effOHogBwMq0IR3q8UeEiDHf8 9rSGqMgsAhSKk0USIoqIfUMJUzXTlERyeLTdzhs4CLiF8ByA9Mom1JwvCU+WhS+qd5zn QInMXVDRkNVm3yk9qoeOzzusDXlJGP7myuvzS9WckGxnVtzyCfQq6AdeWXttJihaUQOO 6TxC/uhwukIspJhQCbUofQrEyNn6F7x69UXEk00AE3xQT+I/3G2IXVy9Dj8t4rV19xo8 gsyCp/bD2LWIKeqnmkWXn/LrSZbUeDaTA6G8IL+rQzg6zXXiop0ZYvteh8Y4I8I5b1Bl OgEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=wlIYARPp; 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 p10si3409369oti.275.2020.03.05.03.50.15; Thu, 05 Mar 2020 03:50:27 -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=wlIYARPp; 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 S1727459AbgCELsX (ORCPT + 99 others); Thu, 5 Mar 2020 06:48:23 -0500 Received: from mail27.static.mailgun.info ([104.130.122.27]:55351 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727112AbgCELsX (ORCPT ); Thu, 5 Mar 2020 06:48:23 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1583408902; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=pRNvHxX80n8wBj2lKTDP98u1doAk5pcKRHB2R9qvWTg=; b=wlIYARPpNNjZkNifScbbF88gdV9yBDVMZ1MwYCoypNHUlEOdICQwJrzVqcZOZfZmpW8rMuHb WBzT8Xgu2yX0Xgvu5IE1HV6hMBQRo6mhCgL4ZAW2k+qDDI2oQRoHvmB5rW0UXOSOOEX2kn9k n410W/h4KAe9TGUmIiN8rd3ZNvE= 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 5e60e6fe.7fd756479ca8-smtp-out-n01; Thu, 05 Mar 2020 11:48:14 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B2064C447A5; Thu, 5 Mar 2020 11:48:13 +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 2EE5CC433A2; Thu, 5 Mar 2020 11:48:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2EE5CC433A2 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 v11 4/4] soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data Date: Thu, 5 Mar 2020 17:17:36 +0530 Message-Id: <1583408856-1120-5-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583408856-1120-1-git-send-email-mkshah@codeaurora.org> References: <1583408856-1120-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. Fixes: 600513dfeef3 ("drivers: qcom: rpmh: cache sleep/wake state requests") Signed-off-by: Maulik Shah --- drivers/soc/qcom/rpmh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 1951f6a..63364ce 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -472,6 +472,11 @@ int rpmh_flush(struct rpmh_ctrlr *ctrlr) return 0; } + /* Invalidate the TCSes first to avoid stale data */ + 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