Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2439351ybh; Fri, 24 Jul 2020 12:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmuyFVhsIpuXYEwP6+DcPs9i9kgoWfx8opzylTVfdnSWwoASKiCO3yUqAHDZ1NJf4gcarL X-Received: by 2002:a05:6402:22f0:: with SMTP id dn16mr10503579edb.83.1595620373313; Fri, 24 Jul 2020 12:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595620373; cv=none; d=google.com; s=arc-20160816; b=D6N+wzy1r46c8TaxlhQfetdaNINyf8DEWduo4va8oyJGzMpiErnL6KgVD0FHP0Uxmz JU+SnSsn9d/klO3HhrWWxXavMB8NxxP8uIgh5pmhGXbBoUuK+RcZcrKmf+3f/JPA57PQ sX6z2bO4yf/VRcHok/sE3izj/+rKk817AAkxROrA9GufNUVHEoDJhrhm6OeDXRaESXzN 2AQojOjPIIZv1TwIJdzLbhLrWXowI0j9Z/ftq78CzLdbci6nDR+3VONFDv1FUW0P1+o4 cY6xzGKumayvUf8TnS01XJ9JO8OtYfM/bzVxQZma54JqAFYz2Uavw7saELD8i/ZBnhXe Jf4Q== 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 :in-reply-to:references:mime-version:dkim-signature; bh=TI0f9ZG0XZavxVCgci5KzYO+fu3sbeQ813eMYl4khUs=; b=j93YPWW+yaNrnn/FDivewEXgH9YIU/EXK7AkOxgdMJEaDvCgb+t/B1MOfNV2hgyMw7 jxTuWae6xTpzddTDqOprKVv3dZgghV0aicngOZnjiC8k57FygtZ7dZ69h6wdrzl2Ul+7 hfX1LGfWQAv1NMsiM65vifHpsyIAzkiGYiOoVBc6vJUMqBpgi4pXabG6l66VlkAern43 dxGdHmYpITBBs9gpH9W+LewPXkg/ekXOHC1O+bkDFjDdSOdqsZ9/y9fy5Y+jqrBVuVsO bRBzqAtqqMCi6NjuN/u10/ssnsQPDpCeLcEHhTIW0pATKZhGsRmlWoublR5gXEYF/JIw zvnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Rt0AQ2x7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si1116195ejx.619.2020.07.24.12.52.30; Fri, 24 Jul 2020 12:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Rt0AQ2x7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbgGXTuK (ORCPT + 99 others); Fri, 24 Jul 2020 15:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726411AbgGXTuJ (ORCPT ); Fri, 24 Jul 2020 15:50:09 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9F7EC0619D3 for ; Fri, 24 Jul 2020 12:50:09 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id 1so863831vsl.1 for ; Fri, 24 Jul 2020 12:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TI0f9ZG0XZavxVCgci5KzYO+fu3sbeQ813eMYl4khUs=; b=Rt0AQ2x73oWij0mw9oc1EtbPqzzscl3mgAmVCzhc40j76TnbYno0SLKddCJrZeMn/h Mn5rqXRcFD2iBaGVWy3gExG+DGlbd3PDqJ20BBRwWFP/we3eoua7c8D2tuDCfRjDzeHg 4WnP9Pb9X3Nkqi9YsXSEr+/aIgzac9zApPWvY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TI0f9ZG0XZavxVCgci5KzYO+fu3sbeQ813eMYl4khUs=; b=g6Mq7drIYsx/bjbU3Ty/3+bawOpGdBU4v58qfJQ+4EPfTe8rnwELUqDSDsPlkz3CwY AuWwSbQqOUcXx/R/5l62lqtemcrtA+Kp0mqscOVCjY5//LEMHe92+u4B+d8+ZRMNjNz0 KnUMjtjgCQ0HLzPH7FhM6jZcfVE3HcmN8zR/0SEpY9WtUJ/tg1nFOGyPmkmw+ZBZXwjQ RA5zBhiJZuWbsk2mzUXzxKEQ/uUa4OVEEN+wZn0HtowC/f3i1gpzLC3u0cbPWt8IHOmC /PkTIGRixF6avkRFPu6+aSRyI4CaKzyAbSc04d4+SQPOdlyJgc2BcJ4aAfpJ3Jy5TtxI pnkw== X-Gm-Message-State: AOAM531A0TW9LgtkKualV9JbA1r/o1+qkQeIIot1S7t3aTfeRUIZNEW1 yGy7DisQEdEKZl9OQ/dtzA7AaxPEi4g= X-Received: by 2002:a67:5cc6:: with SMTP id q189mr9307667vsb.3.1595620208676; Fri, 24 Jul 2020 12:50:08 -0700 (PDT) Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com. [209.85.217.54]) by smtp.gmail.com with ESMTPSA id j15sm166746vki.8.2020.07.24.12.50.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2020 12:50:08 -0700 (PDT) Received: by mail-vs1-f54.google.com with SMTP id o184so5538426vsc.0 for ; Fri, 24 Jul 2020 12:50:08 -0700 (PDT) X-Received: by 2002:a67:69c1:: with SMTP id e184mr9797505vsc.119.1595620207670; Fri, 24 Jul 2020 12:50:07 -0700 (PDT) MIME-Version: 1.0 References: <20200723010137.3127584-1-swboyd@chromium.org> <159561988523.3847286.14763422711224252201@swboyd.mtv.corp.google.com> In-Reply-To: <159561988523.3847286.14763422711224252201@swboyd.mtv.corp.google.com> From: Doug Anderson Date: Fri, 24 Jul 2020 12:49:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Sleep waiting for tcs slots to be free To: Stephen Boyd Cc: Andy Gross , Bjorn Andersson , LKML , linux-arm-msm , Maulik Shah , 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 Fri, Jul 24, 2020 at 12:44 PM Stephen Boyd wrote: > > > > - if (ret) > > > - goto unlock; > > > > > > - ret = find_free_tcs(tcs); > > > - if (ret < 0) > > > - goto unlock; > > > - tcs_id = ret; > > > + wait_event_lock_irq(drv->tcs_wait, > > > + (tcs_id = claim_tcs_for_req(drv, tcs, msg)) >= 0, > > > > Even though claim_tcs_for_req() only returns 0 or -EBUSY today (IOW it > > never returns error codes other than -EBUSY), should we handle it? If > > we don't, claim_tcs_for_req() should be very clear that it shouldn't > > return any errors other than -EBUSY. > > Do you mean you want to change it to be > > (tcs_id = claim_tcs_for_req(drv, tcs, msg)) != -EBUSY > > instead of >= 0? It should return the tcs_id that was claimed, not just > 0 or -EBUSY. Ah, right. Yes, you got it right. Of course then we have to add a "if (tcd_id < 0) goto unlock", too. If you think it's not worth adding this then we just need to make sure it's super obvious in claim_tcs_for_req() that it's not allowed to return other errors. -Doug