Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp532973ybb; Wed, 8 Apr 2020 05:02:48 -0700 (PDT) X-Google-Smtp-Source: APiQypIslpVOk8BjUNHe60fQ2OYj+9N35rOeUA6ucqcWsJLRl0ExToSXwzKlGGE3V6csDS8xo5/Q X-Received: by 2002:aca:dd55:: with SMTP id u82mr2123744oig.27.1586347368825; Wed, 08 Apr 2020 05:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347368; cv=none; d=google.com; s=arc-20160816; b=kOP6TnPU1XPsqnUlQlxADjP+H3WBwUS2h+YntY+zmUrH244y1zBGSlEyOucxDlVSRE enlTX/cY78bFsTpwQ+r230HGdQbZQFerm4RgcF52gavzIJME9MS/vZbRSt8plTbSy50J qee/zTdz5DUbjEbMTpBqVCfoWvENAkeI6BWLbftxbSJblk2Nv99j5sBJ3Pzg4srBEAaH WIFebpNL12rA/6wTpcNH/cxbEeqdsczis0fYRYwVQ9NWvGxnQdsvXR9spDrtwkB5DV+0 4uZUS3BxGX0FGwnsvyOHgpvCXEX/f1/waiWv/imZdswiXsnaVvBKRD5+vDY8cw/Usras eFJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=vwPWwjoq+ay7kRuzGle4KUDYQbqavT9sOm3xpLYcaTQ=; b=kY57xYGjhgYU6x6UqWM+ofFKsiVhpiYYzxK+ChcvWC4ihlJHpkApJAw+4GW4COD7Vo sbJjRLWzx0yifOgl9ALtXsF8JFZQ+huEXQG7p3pN8ypPY07IOamRD4Srdyms5tBgK3SZ /JDnhePKr0YVma2DCmlepaGVWbTYxJ/fAjILV/YNiwqgYnSQP6EKoysDgsGz4d2vg8eY L3mIVvdTBLTmhpUzdXJRC+WMsR6nwREThlzBS5nG4WBwkbpV0zEHh115+WASAb2YCGXz IBJItsyeDY1cEwLg5tNfdPnHZblOFv9f3APGsqh/FpJrqhT4WpaBo4ZIna3XcXtI1Ioj 93zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=CAUMWe5R; 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 r184si1825720oie.79.2020.04.08.05.02.27; Wed, 08 Apr 2020 05:02:48 -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=@mg.codeaurora.org header.s=smtp header.b=CAUMWe5R; 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 S1728464AbgDHL0F (ORCPT + 99 others); Wed, 8 Apr 2020 07:26:05 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:56277 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728205AbgDHL0F (ORCPT ); Wed, 8 Apr 2020 07:26:05 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586345164; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=vwPWwjoq+ay7kRuzGle4KUDYQbqavT9sOm3xpLYcaTQ=; b=CAUMWe5RuEhQZtL48IiSXb9F1W9VztaHu+jQxGj1VBAM099L+9OsMcFtR44heMjYqG0dHNSG zEoTYW44EFKtRAcIbEMGfM7JRM39IClkxAHCc2R16hosFOzrXmRD83neoW0N+ntelWVBonZp 33oDdIj9Vy1oTF4UIk6Pa8KVl10= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e8db4cc.7ff1de38c960-smtp-out-n05; Wed, 08 Apr 2020 11:26:04 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6119DC433F2; Wed, 8 Apr 2020 11:26:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.43.137] (unknown [106.213.202.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3F5AEC433D2; Wed, 8 Apr 2020 11:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3F5AEC433D2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkshah@codeaurora.org Subject: Re: [PATCH v3 07/10] drivers: qcom: rpmh-rsc: tcs_is_free() can just check tcs_in_use To: Douglas Anderson , Andy Gross , Bjorn Andersson Cc: mka@chromium.org, Lina Iyer , Rajendra Nayak , swboyd@chromium.org, evgreen@chromium.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200407235024.260460-1-dianders@chromium.org> <20200407164915.v3.7.Icf2213131ea652087f100129359052c83601f8b0@changeid> From: Maulik Shah Message-ID: Date: Wed, 8 Apr 2020 16:55:56 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200407164915.v3.7.Icf2213131ea652087f100129359052c83601f8b0@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Reviewed-by: Maulik Shah Tested-by: Maulik Shah Thanks, Maulik On 4/8/2020 5:20 AM, Douglas Anderson wrote: > tcs_is_free() had two checks in it: does the software think that the > TCS is free and does the hardware think that the TCS is free. I > couldn't figure out in which case the hardware could think that a TCS > was in-use but software thought it was free. Apparently there is no > case and the extra check can be removed. This apparently has already > been done in a downstream patch. > > Suggested-by: Maulik Shah > Signed-off-by: Douglas Anderson > --- > > Changes in v3: > - Replace ("...warn if state mismatch") w/ ("...just check tcs_in_use") > > Changes in v2: > - Comment tcs_is_free() new for v2; replaces old patch 6. > > drivers/soc/qcom/rpmh-rsc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c > index 84ae3e514eee..9502e7ea96be 100644 > --- a/drivers/soc/qcom/rpmh-rsc.c > +++ b/drivers/soc/qcom/rpmh-rsc.c > @@ -177,7 +177,6 @@ static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int tcs_id, > * @tcs_id: The global ID of this TCS. > * > * Returns true if nobody has claimed this TCS (by setting tcs_in_use). > - * If the TCS looks free, checks that the hardware agrees. > * > * Must be called with the drv->lock held or the tcs_lock for the TCS being > * tested. If only the tcs_lock is held then it is possible that this > @@ -188,8 +187,7 @@ static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int tcs_id, > */ > static bool tcs_is_free(struct rsc_drv *drv, int tcs_id) > { > - return !test_bit(tcs_id, drv->tcs_in_use) && > - read_tcs_reg(drv, RSC_DRV_STATUS, tcs_id); > + return !test_bit(tcs_id, drv->tcs_in_use); > } > > /** -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation