Received: by 10.223.185.116 with SMTP id b49csp55964wrg; Thu, 8 Mar 2018 12:48:24 -0800 (PST) X-Google-Smtp-Source: AG47ELvuTRvsZJwWhWK3nV23J9iBgAvnVQIj4kAbGWIahiLh77ARUBxQXibZs6Z9gi/dXfTcloXi X-Received: by 2002:a17:902:76c4:: with SMTP id j4-v6mr25820342plt.410.1520542104378; Thu, 08 Mar 2018 12:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520542104; cv=none; d=google.com; s=arc-20160816; b=vLBT7fMQCdMPbO79/IDdXSZ8Vijmuvydl3mqr7xuzGxLirpvz64UQq0g4VzZRfn16M VhhsttUwkVkBPd7R1lvOH/2U6sePzCevtal7qr4MnRpFPcnLGxvfbEir1zILnSKnYJmz q66xmvWeb4ePm8Ie8Z3EQIGAYF3Wr0UDqwII/uQvbs8Gql7krKRCvp1ovmujnJOM1kGr /Ky24k/UwFCvDd4c+bfWAUiPoASUZnc20b+u/fGZ4h0mqLO1TZvBs6NXCSDCGH+R4f30 TYxTBylkY1RRrAp5NSFuvhWL/JeU7MX27rMlshJSQ1YAA8cCpmJXlKOM3uqppOaTg2AQ CGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dmarc-filter:arc-authentication-results; bh=q0qc4zRGrMBllu/ddspCK8pt/X3C3jrXWKv84wMfN0o=; b=xdNgtWOMga+XdxREPJgSFrmd7V+FbNwdiymQhGPJiSf4qgkpcT6XyUMirxWQr1G8bI B+tDgt9cbLpiVocNnYBXc/1HCFcMh5sJq86qeZro5zJZlVm8geIrn3nSnJ1zfUYGpYvY s1qV/6/OA5i8jVfTzWqK4c4X3hbhgIf1dd3729/C0USxreWN1x+5q7QWfZhNM08jix77 D33+QB9DmSbGOE8h3ill0ctNxro7otVlFvanKO86yjQ+k5eSKfFhXieensYm8+6qPEMi 3fSNOsavEq848Zjn+YE381ycdpVi9zfxdltVqMGrg3AgcqOEPzC66+euVDwzj/EFzjKr 5XAg== ARC-Authentication-Results: i=1; mx.google.com; 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 62-v6si15361228ple.491.2018.03.08.12.48.09; Thu, 08 Mar 2018 12:48:24 -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; 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 S1751072AbeCHUrL convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Mar 2018 15:47:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:37328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbeCHUrK (ORCPT ); Thu, 8 Mar 2018 15:47:10 -0500 Received: from localhost (unknown [104.132.1.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53C5E205F4; Thu, 8 Mar 2018 20:47:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53C5E205F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sboyd@kernel.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Lina Iyer , andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org From: Stephen Boyd In-Reply-To: <20180302164317.10554-11-ilina@codeaurora.org> Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Lina Iyer References: <20180302164317.10554-1-ilina@codeaurora.org> <20180302164317.10554-11-ilina@codeaurora.org> Message-ID: <152054202832.219802.7852347243050168190@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v3 10/10] drivers: qcom: rpmh-rsc: allow active requests from wake TCS Date: Thu, 08 Mar 2018 12:47:08 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Lina Iyer (2018-03-02 08:43:17) > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index e9f5a1f387fd..d9cfa7aaf49c 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -220,6 +220,7 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, > struct tcs_request *msg) > { > int type; > + struct tcs_group *tcs; const? > > switch (msg->state) { > case RPMH_ACTIVE_ONLY_STATE: > @@ -235,7 +236,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); > + } > + > + return tcs;