Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4466563imb; Wed, 6 Mar 2019 14:13:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyPthbCvh8wg039sxuezqeF6W7DEW6bMnfLOWvmZ4Yy+E+GNtRYQJg9iQrYR8ywF6JmhqM1 X-Received: by 2002:a63:6605:: with SMTP id a5mr8367971pgc.372.1551910420134; Wed, 06 Mar 2019 14:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551910420; cv=none; d=google.com; s=arc-20160816; b=FaSFf3NwdwnvdB9aKdqwnriuX3U/R/fmDeITMymVB58MQXW8SNxWnm7x3G1Ydq4XMP oKk+PlOCvbds4OPvd/+so+qmp6CUcBLVaNYbV9W2T+4q5oMKaav+yrUzrm41ctBugaYj pbWrKeavSe9hd9Ph0iJQNRZ/X4wvqxNBsukTjRYSmhrTOwMxoyB6CrLwE5iIdsr76RsN bIblr8u4pqct6VRkJNOb69/m2TneB3UKVshy/nezRqE8NpzsxkaEfBJk9ZkENSFpDrlc I4tbmujzmnABItklcZm2cUzTDhh9qxUg05SNfEOreVtvXtfhhgxQBpzGQr/3IFHkTXWO GgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:cc:subject :from:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=4WiXplkSOqcHAkHALHgT+HxYhesWO1hQ7GJbig7RVyk=; b=0lcbG3gy8y43pxgdj7DaEOYGLTFGCSlpMUMmU/74PHHNpj9zLWekxZlGb/yYYAlk6s gLLHoL6utlwRg9hAqNmo81IROP0UPKvMUMf0U2PjSY3h8sMgQentqqxqJkfog9HH2qD9 Ie5PyMZtUZqZTavrRFCEZnHRDBPrndyPI4xoLE9tEmLiOJTVcqNvkpljAugAY+LcTHD6 0Htl3QGvaLl/nkB3HOUY4q1GJvudEiCwPN/YMe6f/g3rwgv5LkPVCuP7M4vvehfQhU6I 0+ZsnI8mSj7elMeMvuHeIOlCQF9lA8zo4CSwPKNcKf3zNpQjz4GhMaLAg0ucLa/gdjaG jbgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EZHL5jkX; 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 x5si2274703pgr.149.2019.03.06.14.13.24; Wed, 06 Mar 2019 14:13:40 -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=EZHL5jkX; 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 S1726720AbfCFWMp (ORCPT + 99 others); Wed, 6 Mar 2019 17:12:45 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33140 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCFWMo (ORCPT ); Wed, 6 Mar 2019 17:12:44 -0500 Received: by mail-pg1-f195.google.com with SMTP id h11so9529656pgl.0 for ; Wed, 06 Mar 2019 14:12:44 -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:from :subject:cc:to:message-id:user-agent:date; bh=4WiXplkSOqcHAkHALHgT+HxYhesWO1hQ7GJbig7RVyk=; b=EZHL5jkX5qbGfxl8nHlpemRyDYPtRUUF8BqR7R+LyYl09emsiMaMjpb8at5njzSWSa 5TUM39b3EIrl+bPvY1qKOfF/pL+HbeQ+gR3U8XfXJyOesdbQV+grAIGhgsPGCL9zRLGu /gQZ2Xz6jIPuHJeSpOKcOELifPCjIa/OLhDqw= 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:from:subject:cc:to:message-id:user-agent :date; bh=4WiXplkSOqcHAkHALHgT+HxYhesWO1hQ7GJbig7RVyk=; b=IWIiAXvqzTbV585GX+ZWVPSELGnDrHeQTwK9rgBGGUvhfv2snPm2rCX5ik2HD4hBQr StqHjcatm8363p4ZLEowP3DmmIJAvxtUImjTe+jmhkdR8x01jw8TK3Mkur1S6aZQaVO0 NiTm8f5LqLUP9DhwwT5yC9+gWPexuT+IiIp9YNhAKdNvNagZbmOapK8s3cm3p0yd2STp JiuCavVxnrcAooDeJZrelvoQlBQri9axfcM6PVTWdr2NFi3ZOR+3jt7GQD+zM+dmrslo 8irVyeu2kzoSnfxENjwqnmLLSW+JvOTrg7ZvtUHIQLsUiEyk5gkk1GDb1ZInBuClFQnT zR6A== X-Gm-Message-State: APjAAAVfd3slGcnr/kNe62VNY5F1BrlGROpmRDIPXMCkj+dfRDKNLhDX JW4Wma4n84KlafPa4Yibw3hYEw== X-Received: by 2002:a63:591f:: with SMTP id n31mr8218228pgb.304.1551910363808; Wed, 06 Mar 2019 14:12:43 -0800 (PST) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id e184sm6121172pfc.143.2019.03.06.14.12.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2019 14:12:42 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190304171450.GB10971@codeaurora.org> References: <20190221121827.32427-1-rplsssn@codeaurora.org> <20190221121827.32427-3-rplsssn@codeaurora.org> <155122856693.260864.16771523196413005158@swboyd.mtv.corp.google.com> <20190227222913.GA10971@codeaurora.org> <155146312862.16805.13188707704058408931@swboyd.mtv.corp.google.com> <20190304171450.GB10971@codeaurora.org> From: Stephen Boyd Subject: Re: [PATCH RESEND v3 2/3] drivers: qcom: rpmh-rsc: return if the controller is idle Cc: "Raju P.L.S.S.S.N" , andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, evgreen@chromium.org, dianders@chromium.org, mka@chromium.org To: Lina Iyer Message-ID: <155191036168.20095.16985811185745151630@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Wed, 06 Mar 2019 14:12:41 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Lina Iyer (2019-03-04 09:14:50) > On Fri, Mar 01 2019 at 10:58 -0700, Stephen Boyd wrote: > >Quoting Lina Iyer (2019-02-27 14:29:13) > >> Hi Stephen, > >> > >> On Tue, Feb 26 2019 at 17:49 -0700, Stephen Boyd wrote: > > > >Ok, can you explain why it's even a problem for the TCSes to be active > >during suspend? I would hope that for suspend/resume, if this is > >actually a problem, the RPMh driver itself can block suspend with a > >driver suspend callback that checks for idleness. > The RSC can transmit TCS executed from Linux and when all the CPUs have > powered down, could execute a firmware in the RSC to deliver the sleep > state requests. The firmware cannot run when there are active requests > being processed. To ensure that case, we bail out of sleep or suspend, > when the last CPU is powering down, if there are active requests. Ok, do we actually bail out or just pick a shallower idle state that wouldn't trigger the firmware to run something that may conflict with the active requests (i.e. some light CPU sleep mode)? The commit text seems to imply we block certain idle states. >=20 > >But I suspect that in > >the system wide suspend/resume case, any callers that could make TCS > >requests are child devices of the RPMh controller and therefore they > >would already be suspended if they didn't have anything pending they're > >waiting for a response on or they would be blocking suspend themselves > >if they're waiting for the response. So why are we even checking the > >TCSes in system suspend path at all? Assume that callers know what > >they're doing and will block suspend if they care? > > > In suspend, they probably would do what you mention above. All CPUs > might conincidentally be idle at the same idle, when a request is being > processed. >=20 > >Following that same logic, is this more of an API that is planned for > >use by CPU idle? Where the case is much more of a runtime PM design. > >Even then, I don't get it. A device that's runtime active and making > >RPMh requests might need to block some forms of CPU idle states because > >a request hasn't been processed yet that may change the decision for > >certain deep idle states? > > > A process waiting on a RPMH request, may let the CPU go to sleep and > therefore this is a possibility. >=20 Ok thanks for the info. Can these details be included in the commit text so we don't lose sight of the bigger picture? And can this patch series be combined with a larger cpuidle/suspend patch series so we don't have to review this in isolation? I don't understand the need to add more APIs that aren't used yet.