Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1245784imm; Fri, 11 May 2018 13:19:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZphikg0pv9RQgwnEef78N4UuFu3Su2yrae5sBNY3EpScjX0LO6DjkZCspnl2MUiyR1Lgcch X-Received: by 2002:a63:79cc:: with SMTP id u195-v6mr359808pgc.197.1526069953293; Fri, 11 May 2018 13:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526069953; cv=none; d=google.com; s=arc-20160816; b=tqVheVIOoIQ5GlzBBAGTavrFKkbUGuN80GSHdhnYfGFLjttMxsvzsi/sDeXp/v5LNZ Gk3TJtbf8OpGM2PAMchYrZhBTYjBgWB7DNSZRVJsFW5wMzpWJoQRggnji5qyY4jgTNc1 8gjvP7FL6lJ6VWtqAzKcWtv9vAp2KXrNaJEtK8Hbyx0M6+IWeUdRg7l3/NTKQkBTZ84G uf5VbcQGdlCvptOX2+/K1kPj3YBOR6cwFWeObCYCeTvwdtQQFsJEvAQEn2UTL89gp3jp 0zv/qQNSYuRC9NrriGYfkVOAQpqkiDvcKpqMQ6P3yMQTIEYmIR1AVSoO7xI8h7PVNWf2 B/SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=ssXdsCKR9iy+7M/zZIT7BVZzrGtWqvHngIvlRMxOnX8=; b=fnpiEh+p3IRjZ2bcIxpeoaf8WB37GjxDHg0Gs6KAT9HT26sCvsSsMQSK217d9FcYBS KoRd7Ok9h6SbYKqnfwz92umRPRgVifRevZ65fqU8Il6hiHirGe9DWGYJvwTmUZY/l/bV 5rToLP91/30Z0wWSRDjrAyeG+RHorACwlRhCN9cxfXOqHV2RkD46i237lDl9ASew3SQf 3hgPXpyNRoeR5H6tFOd3LIv9omZOtDrtYOFCDiHuEfKgYPZzzyRieNW+3WPagoy8v5iZ bzC1tOYiPrLx4c3gW3awybSOGZ2VZaI/aeloe0Y5kUXETdpEzhp18MT1423EyADEm5B5 ieMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=etXPbu3w; dkim=fail header.i=@chromium.org header.s=google header.b=e7zYyP2p; 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=fail (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 b12-v6si3942206plr.42.2018.05.11.13.18.58; Fri, 11 May 2018 13:19:13 -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=fail header.i=@google.com header.s=20161025 header.b=etXPbu3w; dkim=fail header.i=@chromium.org header.s=google header.b=e7zYyP2p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751366AbeEKURj (ORCPT + 99 others); Fri, 11 May 2018 16:17:39 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:41302 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeEKURg (ORCPT ); Fri, 11 May 2018 16:17:36 -0400 Received: by mail-vk0-f65.google.com with SMTP id 131-v6so3993043vkf.8 for ; Fri, 11 May 2018 13:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ssXdsCKR9iy+7M/zZIT7BVZzrGtWqvHngIvlRMxOnX8=; b=etXPbu3w+Z+Be4odKOZKlOVrFJn/ZOTYwYtuV7fdTF4t3vAaKFgpEBzcme2VAVgXue lMm1/3e85e7vGKHEmOwjon3J87kONloE+kUz2n+5w9VdfQThM3ly4vqtbNF/4fPRsV9X EYKGBCNhyq4leecFncdnE+FqZwOS9jkGQTKoGozcEFeffeZi44QaWR5nXhO6fhYtXePt vT/A8NcRHPiOdQ0nL4iG1VdHi/OCzjbBgYvcIe3sGyH+JSGtBNPo+lwfiSmIkGXzSI2m i4MBX6JwUWddz7oUGduGv/idcmXoHAT3pjvqFljPRu8d2/iWRcLNpHlZ8VZBU8OT10nK vuFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ssXdsCKR9iy+7M/zZIT7BVZzrGtWqvHngIvlRMxOnX8=; b=e7zYyP2pmjYjciLwWTtpKPQOTyOQlmsPzNIHx1Qdfg7sRDKrb/dTZi6SpFKQIu4HKu bMT6DHHB4vcI0yid2EnFRNKax98l9D6L2ijxVh+/N1YBUKcltiPPu3MWn7ZkggF3vdl4 Co4cByCw3Nilm3WJGXLPVEvJJsXycLz9caOMk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ssXdsCKR9iy+7M/zZIT7BVZzrGtWqvHngIvlRMxOnX8=; b=begfErNCwQcfB6Ke8GJAlHUzuByhFzdCx/biF6+CvBHWDlDizjAPqYhgpXPSfTIOvt XnlkSF2yuK6ffqrhTnfvZExrJl81mLt68fiSf/FEz1xnpAVykNdxjaE1rFYYj/nEU1kk mjRaIO905PW9rsDw735uMYh7p8Pl8/2FygmpuGEMU3GQEWLlUVSX1DbtIUl4986VWh9B 6evo8pPfu95AfDdmq8Wodfxz5BV2LeITOVV43nheVuIIglFqD+5I/t+xyf1jlQYHsREm sfqfMGzOYMky8mJBYpZWEO3QBLtvC/zUC/HEGgHtJ3aYqeBse5sT3e1fe7zPx0C1o56r jc2A== X-Gm-Message-State: ALKqPwfXjyXFLCGJrOLuDEAEYOLpjx19GDOhuulR4S6dhtfyHWkmVVA6 Wqbk2bjEd6Mz8JjdSx4RG0BTHpOs2J8d0wZsmOeQjA== X-Received: by 2002:a1f:fc4a:: with SMTP id a71-v6mr2394351vki.141.1526069855468; Fri, 11 May 2018 13:17:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.48.82 with HTTP; Fri, 11 May 2018 13:17:34 -0700 (PDT) In-Reply-To: <20180509170159.29682-11-ilina@codeaurora.org> References: <20180509170159.29682-1-ilina@codeaurora.org> <20180509170159.29682-11-ilina@codeaurora.org> From: Doug Anderson Date: Fri, 11 May 2018 13:17:34 -0700 X-Google-Sender-Auth: Qo48ERbEwA0Ge_VMgOo9l2nIgqo Message-ID: Subject: Re: [PATCH v8 10/10] drivers: qcom: rpmh-rsc: allow active requests from wake TCS To: Lina Iyer Cc: Andy Gross , David Brown , linux-arm-msm@vger.kernel.org, "open list:ARM/QUALCOMM SUPPORT" , Rajendra Nayak , Bjorn Andersson , LKML , Stephen Boyd , Evan Green , Matthias Kaehlcke , rplsssn@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, May 9, 2018 at 10:01 AM, Lina Iyer wrote: > Some RSCs may only have sleep and wake TCS, i.e, there is no dedicated > TCS for active mode request, but drivers may still want to make active > requests from these RSCs. In such cases re-purpose the wake TCS to send > active state requests. > > The requirement for this is that the driver is aware that the wake TCS > is being repurposed to send active request, hence the sleep and wake > TCSes be invalidated before the active request is sent. > > Signed-off-by: Lina Iyer > Reviewed-by: Matthias Kaehlcke > --- > drivers/soc/qcom/rpmh-rsc.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index 68c25ebbbe09..369b9b3eedc5 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -153,6 +153,7 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, > const struct tcs_request *msg) > { > int type; > + struct tcs_group *tcs; > > switch (msg->state) { > case RPMH_ACTIVE_ONLY_STATE: > @@ -168,7 +169,22 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, > return ERR_PTR(-EINVAL); > } > > - return get_tcs_of_type(drv, type); > + /* > + * If we are making an active request on a RSC that does not have a > + * dedicated TCS for active state use, then re-purpose a wake TCS to > + * send active votes. > + * NOTE: The driver must be aware that this RSC does not have a > + * dedicated AMC, and therefore would invalidate the sleep and wake > + * TCSes before making an active state request. > + */ > + tcs = get_tcs_of_type(drv, type); > + if (msg->state == RPMH_ACTIVE_ONLY_STATE && IS_ERR(tcs)) { > + tcs = get_tcs_of_type(drv, WAKE_TCS); > + if (!IS_ERR(tcs)) > + rpmh_rsc_invalidate(drv); I noticed that rpmh_rsc_invalidate() can return -EAGAIN. Do you need to deal with that here? -Doug