Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp172773ybb; Tue, 7 Apr 2020 19:51:45 -0700 (PDT) X-Google-Smtp-Source: APiQypIy4N7JFeFmrohn1HlEVDNsPng+QtHUX8HFGjJOonkWQk+gwKbKNUQCIcIum7AVQgkmrlaY X-Received: by 2002:aca:fcd8:: with SMTP id a207mr978909oii.56.1586314305831; Tue, 07 Apr 2020 19:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586314305; cv=none; d=google.com; s=arc-20160816; b=u1z1JL9VYaCIw8b5Tfll6EdLOdOFpEuWzSOaQacW3T6pRsHuCaKnrx99g7M6DjPUDA zNSyJm8YJT2jWPmkYWvmo4hi39oSoUmB2q65ZYxcPtpwrTkgTP9wdNAQZcLNxMNIbj3r AGVzBYnZgbqBFOTcxn6Avhp7UvjvI5JEOCzPS316PmYWkzxMNGkRWEZhuP+CdQaebj1S eQRA6UsvIXYU0GPg3hXlmVHppH7flouEeLNo/pxwFZV3Lxt529zK16HuUqmeHPNtL/Ur p/EXdIRpWxe/L2x5sGMLP2xFagdHZKhp1SRa7jxovFf0cgNoFus80qxf1ZfIfNtH2UjR rxdA== 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=JUXF7hM/mccP8YBSv8k1M2FRkWg1QLWdAClD45zoF40=; b=hO6J1ziyUjuxnor1MCvLDxMJJBSX5tSdsXuu4V4wQsrEh3oCgAOI6kVaQTNcdgIh90 VrzN0rcthJNZFE3C2g+uKfq1QRQX5SFzKCTpZgiYRPItBpo/1QSbrYelAJr6XLrF3YcS flaCBR7jXg5FWLu4ycZgKl3/We6OkhdhaBfJMZqBg79sLBgASNo8NHYPUfwQH770L1Un Q0I9vyHY/gMMVRVkp+W6zB1rOA7pj4nde+u3mGc11n4Z9Lbm471ZeiYtDjj3LR9JZiMM u75JmBVsPqEYjwGSi6t4XBW2tjuV0Hfd0kIEFkhN/g+PKb2PEROZuUvsdGax+LNGinQG B5fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KonMvLDA; 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 r3si2044626otc.58.2020.04.07.19.51.31; Tue, 07 Apr 2020 19:51:45 -0700 (PDT) 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=KonMvLDA; 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 S1726469AbgDHCus (ORCPT + 99 others); Tue, 7 Apr 2020 22:50:48 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34929 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgDHCur (ORCPT ); Tue, 7 Apr 2020 22:50:47 -0400 Received: by mail-pf1-f195.google.com with SMTP id a13so1744622pfa.2 for ; Tue, 07 Apr 2020 19:50:46 -0700 (PDT) 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=JUXF7hM/mccP8YBSv8k1M2FRkWg1QLWdAClD45zoF40=; b=KonMvLDAFt3ozAn0+2/wsP0c5xo5b+hNVOzSBOLp/x0CNovDbKsm+UhULuUMmC5D+5 ukMqw7dOF80Xv8Pk/DlQGB/JXqeXCIs/c/5dPHdcia7i2QGyTLJhJK9UofXg2uzPu4H6 VBdyXC/zTpvt0zmf80LLyHx0y/2InrYjIxBJU= 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=JUXF7hM/mccP8YBSv8k1M2FRkWg1QLWdAClD45zoF40=; b=ewMpshCNyrD8fEgab6w/vw5O0TGic80g6kWqSFSmFWgE8jJgnsRMLpkEBkZSJzDqoi muPYc0p4l3nQm3EoWtn8/qg5/3qWVLyhE4HCDFbyaozxkzZCbVAFrf6fXnaYyNOWqGJX 0ioxB7PTvdLihQLoBEYHvqmXlztXOo9y6Dj6AdzX0//8bmI1X3c90IlXGE8fZvRNcRYI Zw7dcsCY+5+B1sVk+m72l8Dyd6RIl9DCIvL8mxhBekOvhvlS/VD9bgKXV4UhTnIH+b3+ u+L8I65I23XNSoQz1E89LazLAN+Sz7JoDntyJDLqj8MIbzdRuh+nJrFMm/nxMfrJZ/pB zxuA== X-Gm-Message-State: AGi0PuaYIH/JzDA2SIbBwLLr5DIyuK26+kdNr5USDzYa2JlfZ9gPGWj+ S1x3Ztv8LlSqqc9AvURbMVvgyGRvFgQ= X-Received: by 2002:a65:67c7:: with SMTP id b7mr5006016pgs.345.1586314245452; Tue, 07 Apr 2020 19:50:45 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id 135sm15636454pfu.207.2020.04.07.19.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 19:50:44 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1586154741-8293-5-git-send-email-mkshah@codeaurora.org> References: <1586154741-8293-1-git-send-email-mkshah@codeaurora.org> <1586154741-8293-5-git-send-email-mkshah@codeaurora.org> Subject: Re: [PATCH v16 4/6] 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, mka@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, Maulik Shah To: Maulik Shah , bjorn.andersson@linaro.org, dianders@chromium.org, evgreen@chromium.org Date: Tue, 07 Apr 2020 19:50:43 -0700 Message-ID: <158631424318.216820.1843109743502322053@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-04-05 23:32:19) > Add changes to invoke rpmh flush() from CPU PM notification. > This is done when the last the cpu is entering power collapse and > controller is not busy. >=20 > Controllers that do have 'HW solver' mode do not need to register Controllers that have 'HW solver' mode don't need to register? The 'do have' is throwing me off. > for CPU PM notification. They may be in autonomous mode executing > low power mode and do not require rpmh_flush() to happen from CPU > PM notification. >=20 > Signed-off-by: Maulik Shah > Reviewed-by: Douglas Anderson > --- > drivers/soc/qcom/rpmh-internal.h | 25 +++++--- > drivers/soc/qcom/rpmh-rsc.c | 123 +++++++++++++++++++++++++++++++++= ++---- > drivers/soc/qcom/rpmh.c | 26 +++------ > 3 files changed, 137 insertions(+), 37 deletions(-) >=20 > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index b718221..fbe1f3e 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -6,6 +6,7 @@ [...] > + > +static int rpmh_rsc_cpu_pm_callback(struct notifier_block *nfb, > + unsigned long action, void *v) > +{ > + struct rsc_drv *drv =3D container_of(nfb, struct rsc_drv, rsc_pm); > + int ret =3D NOTIFY_OK; > + > + spin_lock(&drv->pm_lock); > + > + switch (action) { > + case CPU_PM_ENTER: I thought CPU_PM notifiers weren't supposed to be used anymore? Or at least, the genpd work that has gone on for cpuidle could be used here in place of CPU_PM notifiers? And so this isn't actually any different than what was proposed originally to use genpd for this? > + cpumask_set_cpu(raw_smp_processor_id(), Why do we need to use raw_smp_processor_id()? smp_processor_id() should work just as well? > + &drv->cpus_entered_pm); > + > + if (!cpumask_equal(&drv->cpus_entered_pm, cpu_online_mask= )) > + goto exit; > + break; > + case CPU_PM_ENTER_FAILED: > + case CPU_PM_EXIT: > + cpumask_clear_cpu(raw_smp_processor_id(), > + &drv->cpus_entered_pm); > + goto exit; > + } > + > + ret =3D rpmh_rsc_ctrlr_is_busy(drv); > + if (ret) { > + ret =3D NOTIFY_BAD; > + goto exit; > + } > + > + ret =3D rpmh_flush(&drv->client); > + if (ret) > + ret =3D NOTIFY_BAD; > + else > + ret =3D NOTIFY_OK; > + > +exit: > + spin_unlock(&drv->pm_lock); > + return ret; > +} > +