Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2204016imm; Thu, 14 Jun 2018 10:18:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLlSsvLCqZ5AMCgv4iz//hj8y52m58693AbAWu5wkY2U8UTxKAhyjKdmDxMVNpV4C6tMd5M X-Received: by 2002:a62:154a:: with SMTP id 71-v6mr10564420pfv.170.1528996736799; Thu, 14 Jun 2018 10:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528996736; cv=none; d=google.com; s=arc-20160816; b=YHDBdqQwzr/9OGuJmn2r0qE8woSwJnfL1decAMJubculQMVeSwlbfueWxvud6PgE4o dYY2syiWE5HU0Mc+DjyfRgk5rMWWNEV7qvShO6Q6N3mtYYrUdM0ynN5LRRPLl8M86S8K 25d6rdld4nhEBJj/tqN0JB3L/CJ4ig56cTCam86H8ZzgLyQlI0bzwxLbxAJ3M/TdSruP wpvPba7HqLLyr7zXA7Jh8ztXT+O3Et7sDOF8lebskrwZ34p9zozxV9gaEtNL61U29Ews sUHtxCiLgYvvCn5ioVyPOY45C6zqvMulrALAou6FG+8RxoGAF+4GBWE8qKDm7ueUaGqR F+eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=qeJpuc/rWI+viwMpxdNGghzhOG97NpZZ13UNoZvRWWQ=; b=R8zWi1EdIVGPszr16n4HvDcfalVn7GnZWKih/eil2sEC9lW9AVxW0NXizdmzsLlXvi hPRLZQkElwHnZmJ6Y3g4744dUkQQ7Rnlb/Jh8k0DjlxOVQRVQCShe4QtjNG+hvxMwFWf SBXEXk3IpTlWxfWvvfhGFVdPbOgQuhfId8+Ih2UJpMJh7aowiBhcESlx8EURuBdPAh0o 2y3Z0mR2b0yM8ICQPEb1BiYyulVjJBBljHxTDnp3Pqx7MNJq/xhVUXGeU8HqqQCxJPtQ Cjb9RYIbAs24j1VnJ/8NdsYMASwVTeEWTzC0vaHDadDGfQnNQmSkwGnLCmSVY1aJgcZD xW/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Bj25A3ep; dkim=pass header.i=@codeaurora.org header.s=default header.b="B/mVQ8v3"; 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 b9-v6si5755495pfh.358.2018.06.14.10.18.42; Thu, 14 Jun 2018 10:18:56 -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=@codeaurora.org header.s=default header.b=Bj25A3ep; dkim=pass header.i=@codeaurora.org header.s=default header.b="B/mVQ8v3"; 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 S1755225AbeFNRSL (ORCPT + 99 others); Thu, 14 Jun 2018 13:18:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45856 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754635AbeFNRSI (ORCPT ); Thu, 14 Jun 2018 13:18:08 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EF86F602B8; Thu, 14 Jun 2018 17:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528996688; bh=SKYHID8KcqtQU3YdWn7T35a3r7SAYBC2Me8gzIpokDU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bj25A3ep5ZAzQNMzBhpCsGrAEEe0+OF6vOh0rH6jLxPj+x5EEpvsC5MmK6Sn65dNY tFO9+AqdQ8EWtPdZbcDCfkv/Qro1a3faQdZvesXTeQUi9wPB5j+ZA7KUNoAqH4MjNI Lmec2U5w39LTYg5IdGj8oRvoOTE+JQkQTgoB34Ic= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 189D1602B8; Thu, 14 Jun 2018 17:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528996687; bh=SKYHID8KcqtQU3YdWn7T35a3r7SAYBC2Me8gzIpokDU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B/mVQ8v3ekVwcrrmKWvgAhYwA2mtIuTyCm8QLLk5rHZSqDePcQc3WftMiyLER3hrb CFSN8tlBo5Azy26rdT+sqIPw3ee7r7x6IHKPBkvnx5NDfbGJEkVcovtyIPA+N2YElJ Q+AUNVTGk31HTx5F88HXljyWE3LGtUF3z0dGjWfQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 189D1602B8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Thu, 14 Jun 2018 11:18:06 -0600 From: Lina Iyer To: Doug Anderson Cc: Raju P L S S S N , 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 Subject: Re: [PATCH v10 10/10] drivers: qcom: rpmh-rsc: allow active requests from wake TCS Message-ID: <20180614171806.GB21724@codeaurora.org> References: <1528737949-17495-1-git-send-email-rplsssn@codeaurora.org> <1528737949-17495-11-git-send-email-rplsssn@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13 2018 at 15:09 -0600, Doug Anderson wrote: >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()? > > Returning an error back to the caller is the right approach here. If the invalidate fails, its mostly because, the TCS is busy or in use by an external entity. Only the caller would be able to resolve the condition and take corrective action. -- Lina