Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1143274imm; Wed, 13 Jun 2018 14:10:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLENwU+v+FCwMNe+w1l2z2vRWNoI4kHLkT0qxFxETSTjdo2CpK7YfooJPnguIwpPbCsQKgI X-Received: by 2002:a17:902:23:: with SMTP id 32-v6mr6858082pla.252.1528924259744; Wed, 13 Jun 2018 14:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528924259; cv=none; d=google.com; s=arc-20160816; b=sqAEx2SaLQaS32r9sfUy/X8FuBGCKfw7USjcZ/Vur8l4AwuwEAozMil3LBeh7Nz9mj 2wAJHpySWTDv13ejRkkSp6/5xy+KTiIOy6E3uaAI8yjCOWZbSoy33rIYPaixBmNloR3K 3W65OJNhWn8sFf7TbVGE8XLMASWgIOfjE7XgUNI2kuwfh0GqCZ+VlBIl6q5q59DhBgy2 W3J4RtwN+knEkd45WDAZ/WJz6p+B+u4wOq7wMOX/1/JtujluijXbu6Csy/1RJ1iOFieG wCAmpGdvUxOguzRTl0J21EVPpEnjAaRTMZPrahHikqNYJy0roCA3udn8oALsyFFnW3P+ uSUg== 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=9ldRJ8sRd73u+QInRbQ/mMV8cTDVP9jju/8yssxbQvE=; b=ny1OehFwVVWQXMO5i5S89I/Hs4r9Y1TFJiz+I+kcASg0SdvhtmG084gMJQzH4Ewrhk 8Y256OnmMUHScMzdleuXIp7BIi6bosCWgKlFLAthbrcFQ4YzeRqU9KsCassb5hF9a7xp tLkCGkzpOXL56P99+b0ZN79Re5l4HhruIIdk+4S8nF9mW00GDEnz8rVMp6ZA6IhczvBW rscfuU8nkmFtej/0B1S0gvgjUF6I71qWGj5q0KWNZ8Zwg/cUeTSXVnHPc2TatxACn1Dn xsgVnIb01jIWGPZez+ihQkJEdVRUOusdS7QBivOaHbaLdSIM+Vw8yCOvGoAyA8UELfXE aUWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=YSLxmO1b; dkim=fail header.i=@chromium.org header.s=google header.b=PElfmOpB; 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 c21-v6si3022657pgw.50.2018.06.13.14.10.45; Wed, 13 Jun 2018 14:10:59 -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=YSLxmO1b; dkim=fail header.i=@chromium.org header.s=google header.b=PElfmOpB; 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 S964838AbeFMVJ6 (ORCPT + 99 others); Wed, 13 Jun 2018 17:09:58 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:40413 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964828AbeFMVJy (ORCPT ); Wed, 13 Jun 2018 17:09:54 -0400 Received: by mail-vk0-f67.google.com with SMTP id o71-v6so2400350vke.7 for ; Wed, 13 Jun 2018 14:09:54 -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=9ldRJ8sRd73u+QInRbQ/mMV8cTDVP9jju/8yssxbQvE=; b=YSLxmO1bFn1zTiH4tCrOLvq2zPTyO+pL8cKRmzONAABK5FHFyAMpXMGNU1j9DQOdu7 yR2cHsWR138VanlSgLtnQi3i4Mnm8s9X3jxvDLF4yfcYtVSm/uUp1uukViRtM6gwUu/8 fxtjKscd05NxJ9PkqYUs3G4/dapfJ+0Le1h09lk6i/+ER7cDAJSDpr01FEobrWF+9G7D KTdpOjEShhj17OOm+hAL5tMiIhWgdCUdQZLC8wjMCfa2Id2Pn2yURuWRO6C/01dR8iEO LSl7DJUhMPDoLwXPSKrbYhrZrU6UAXNuaV+ZmKaqRL0ADMgBzhuv4kwVY8q8MyFrFvs9 UHRA== 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=9ldRJ8sRd73u+QInRbQ/mMV8cTDVP9jju/8yssxbQvE=; b=PElfmOpBGqW7s05h1LKULDP7HoSP1MkWdFNSyuXQ/B5imKRfn++r6MbbJJiYaflK/c QMGzfVp0623Oo2WnLtNpb8Hqm08t2Cuy285Hi4NGcD1OTiDClp5oDEI/IKoHP6g2nbWl TUK5BS8l+e7x2JCJJBKdtnJVvrPgvpiHPv84k= 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=9ldRJ8sRd73u+QInRbQ/mMV8cTDVP9jju/8yssxbQvE=; b=OgLvhG4ShtY/fgMXD1BDYJY61TFg72prM+mTpfFY57mLoMfKkiagmInQHJnsdRsREP riKN0XmlxsglUOIt1q4jxdKlfrUGdLQ2+cW0VfNhfQev8u+t9WXlLL50fFQLFTd2AsBV Jlso4MzqwcdM6VvgU52OA8hjzVdoMdQdrNXgED1BhrxJgqF4BPO/2lb0QLyk+Hk7Msid nZrx0kfntr56ylF2vgwdTnsK6zgK9W/cnEx+Z+bqdH9tS8hGMfcZZX2BTL8aM0DO+8YI nDxA2hw07nveBY3xflMjXY17aqt6/155jdjaqcsobfglrumvRz5ZlEjC2CaUpaMef7kg 16Cw== X-Gm-Message-State: APt69E01jwVwqIhrVfEwW56BzLaoHS086T6rvzFiJYUFTS6XWBG6fVD0 /9yWRXNlp9gqDw7baj6TVKA6MPzrJihx8NJbVZlQAQ== X-Received: by 2002:a1f:7c4:: with SMTP id 187-v6mr4058280vkh.60.1528924193311; Wed, 13 Jun 2018 14:09:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1f:9495:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 14:09:52 -0700 (PDT) In-Reply-To: <1528737949-17495-11-git-send-email-rplsssn@codeaurora.org> References: <1528737949-17495-1-git-send-email-rplsssn@codeaurora.org> <1528737949-17495-11-git-send-email-rplsssn@codeaurora.org> From: Doug Anderson Date: Wed, 13 Jun 2018 14:09:52 -0700 X-Google-Sender-Auth: Bc9CoCMPZOpVwBpP08LeDw_FUwU Message-ID: Subject: Re: [PATCH v10 10/10] drivers: qcom: rpmh-rsc: allow active requests from wake TCS To: Raju P L S S S N 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 , Lina Iyer 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 Mon, Jun 11, 2018 at 10:25 AM, Raju P L S S S N wrote: > @@ -148,7 +148,8 @@ int rpmh_rsc_invalidate(struct rsc_drv *drv) > static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, > const struct tcs_request *msg) > { > - int type; > + int type, ret; > + struct tcs_group *tcs; > > switch (msg->state) { > case RPMH_ACTIVE_ONLY_STATE: > @@ -164,7 +165,25 @@ 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)) { > + ret = rpmh_rsc_invalidate(drv); > + if (ret) > + return ERR_PTR(ret); In v9 you looped as long as the "ret" was -EAGAIN. Now you're not. Are all the callers setup to handle -EAGAIN or should you keep the loop in for -EAGAIN? I don't think callers handle this well. ...or is there some reason that EAGAIN can't happen in this call to rpmh_rsc_invalidate()? -Doug