Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp3673974pjo; Wed, 26 Feb 2020 14:50:34 -0800 (PST) X-Google-Smtp-Source: APXvYqy9ACv23lz0sxHeHWIxuyMCbq1fm+xfsFJTtJd5YrYtORuGGod5dSI5YuNVed5nkIMZsZgv X-Received: by 2002:aca:33d5:: with SMTP id z204mr1045890oiz.120.1582757433999; Wed, 26 Feb 2020 14:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582757433; cv=none; d=google.com; s=arc-20160816; b=TZAoVG5W4om4x4U0ZvliQVA1ZylF/iuRpQGBXxJ2SI/n6syE20C10tKMaV0FkBnEkp LzrL99vHopl5rrUR6Y4gm/SNci6XLUjFPndFM8TPHNJsBcjySSh+Eox0X3PjoNKGNXvf vTSd51oGRNec1zQmecpYssxtDcj069UkH+C3P/OBQ+IbDKcrNEztCROuoXX/12syTt7A cvOr4F0Br1Kv0EP+zI9ukWepHzFhGvrsrG3wZc/vCzW8vOIGTmcJI5FFsUbs9mA3d1kP xr+av5FhXnIK+eA+AE9wLJLvct8FhiR0DW8NaymeLwAwSblOyyI013yZCxD0s0f3airt 6ZDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=zrxYK5T4ryzAQ2/Coj4xWlYlr/YB5hTtCncd5uUc0tg=; b=wNNmD9C2fxjYmESjJu0VviNs4gAq7I9VuIyAMWnvgTPfzHZtRu+ouHE93jpC1lK+uS RnI7vCvEVNjljXHHsvVfmH3RqD6498kMKhs6BZIx/t0E8USReqd0n0G/cw7vi8Qr0MkF tPo6+Ff0m2EWx1pSFtKVjfNx2tBjK830KvvUlKuWcCM5is/gxFHeDYw9895zS8BgvZSh +0T0V+kK/8ze1NfFbxbgJ5wpqnGIJH/RsUSADJZWIP10wbxRpRRhrj7ZsSuH261vf1F1 AR+ZvU2Oh4lD6MNMICGrjua11jy4EaLfUCwllJL3HuGG4LGDxSaQq/AYL6bKMIrinAa5 6VsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BoAb9F5e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si445940otq.146.2020.02.26.14.50.22; Wed, 26 Feb 2020 14:50:33 -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=pass header.i=@chromium.org header.s=google header.b=BoAb9F5e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727920AbgBZWtq (ORCPT + 99 others); Wed, 26 Feb 2020 17:49:46 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42021 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbgBZWtp (ORCPT ); Wed, 26 Feb 2020 17:49:45 -0500 Received: by mail-pg1-f195.google.com with SMTP id h8so369769pgs.9 for ; Wed, 26 Feb 2020 14:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=zrxYK5T4ryzAQ2/Coj4xWlYlr/YB5hTtCncd5uUc0tg=; b=BoAb9F5e0xcUz/99univTBiDlbKMXwAMGASi71CgsY4GoUj7vPWfV8OCv9eQS5qo98 roRqj/8sbWDJNq8uFWg6paTRdw/Qf93w3hbv7lQckpl9Fr8DBSwKdUWsRt5x8nVvz66h Kd6cFfvvC8u+EQh0vP0RB7rIXsQ473CE2lHok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=zrxYK5T4ryzAQ2/Coj4xWlYlr/YB5hTtCncd5uUc0tg=; b=rP0j7kdmbVDCUPa8kplaxIQPz3n0IeR/v4gKKgJ3o6WjaBSjAuRG13sRVL5DTnnUPt rR7XWh48dr369ovvKAdsLe71SUs3N4F9nIJTZCt8o2j6c9b4j38f3nXCRFmwS3zO/LRu S75tKNZaRhKgr/3iK5Qh/kVoexsSHHNqySr/pvwY/fkCRosjKHMRViqhUtVUZwKyMPB2 E78ERhnOFZkwBBS9gsfluNHt+7JrBMQFxrNcrzzCzWW2V+1RvAN3mENsauQGHK+fCr2d RRIzktQ0SRhwn6LYu9SB5j/QUHCO1kn9EsVXRg4pEotXt4tWCNgNlnAvYj6JwGzYVc6V JDTw== X-Gm-Message-State: APjAAAUGz6RG0seeq4ofeX2Jj5w3/YHAv4GVDjvRn5MsFF5qv2DaR5C2 gXK0IV2QKTaSlbwh6lo/h7FnQLsImdg= X-Received: by 2002:a63:8f5c:: with SMTP id r28mr1021763pgn.351.1582757384609; Wed, 26 Feb 2020 14:49:44 -0800 (PST) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id k1sm2325744pgt.70.2020.02.26.14.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 14:49:44 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1582694833-9407-4-git-send-email-mkshah@codeaurora.org> References: <1582694833-9407-1-git-send-email-mkshah@codeaurora.org> <1582694833-9407-4-git-send-email-mkshah@codeaurora.org> Subject: Re: [PATCH v7 3/3] soc: qcom: rpmh: Invoke rpmh_flush for dirty caches From: Stephen Boyd 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 To: Maulik Shah , bjorn.andersson@linaro.org, evgreen@chromium.org, mka@chromium.org Date: Wed, 26 Feb 2020 14:49:43 -0800 Message-ID: <158275738312.177367.16582562675135073777@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Maulik Shah (2020-02-25 21:27:13) > Add changes to invoke rpmh flush when the data in cache is dirty. >=20 > 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 Please write rpmh_flush() so we know it's a function and not a variable. > deepest low power mode. >=20 > Signed-off-by: Maulik Shah > Reviewed-by: Srinivas Rao L > --- > drivers/soc/qcom/rpmh.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > 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 rpm= h_ctrlr *ctrlr, > unlock: > spin_unlock_irqrestore(&ctrlr->cache_lock, flags); > =20 > + if (ctrlr->dirty && !psci_has_osi_support()) Can we introduce a stub function for psci_has_osi_support() when CONFIG_ARM_PSCI_FW=3Dn? This driver currently has: config QCOM_RPMH bool "Qualcomm RPM-Hardened (RPMH) Communication" depends on ARCH_QCOM && ARM64 || COMPILE_TEST which implies that this will break build testing once built on something that isn't arm64. > + return rpmh_flush(ctrlr) ? ERR_PTR(-EINVAL) : req; > + > return req; > } > =20 > @@ -391,6 +395,8 @@ int rpmh_write_batch(const struct device *dev, enum r= pmh_state state, > =20 > if (state !=3D RPMH_ACTIVE_ONLY_STATE) { > cache_batch(ctrlr, req); > + if (!psci_has_osi_support()) > + return rpmh_flush(ctrlr); While the diff is small it is also sad that we turn around after adding it to a list and immediately take it off the list and send it. Can't we do this without having to do the list add/remove dance? > return 0; > } >