Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4198263imm; Mon, 18 Jun 2018 10:44:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQOzVonfMHoY0CvmWRYdTcsXUWTkFeNxx7hhwABYjVdIPJ9+GPB9qx7Y43Dp26H0LU4ntY X-Received: by 2002:a62:3b5d:: with SMTP id i90-v6mr14692463pfa.24.1529343843193; Mon, 18 Jun 2018 10:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529343843; cv=none; d=google.com; s=arc-20160816; b=Vn1/yBLC84RbeTP5BQ5hn6dn/KUfoZd8Q98hf503J+Exw3wF7SO0F5pIt6JInbUAU1 JEDFjq8OcGjqbpogXMyxjcSuMeZxencznsy0mc3K9j1dNzY764Ufd797uyoom9ANRl0d fsvpWk/FWe2qqxAYelXSvjwNoxWlzrlu1LNnRpSi3WRlG1Lmgnf5XpeP6uPNpCj1N0ox 8rbxTTMnnvjdL3fCFGRBHqoVm10LUnsAkYFgcPYpr4K+80CrhxVXvRwGGMs2ac+Yw78A fVPKIFpR7GfumCexmy5xo+gsM3V4ia236mR0EPe9jNGNGDvNCadxpKatqGdTXahUgfWT I4nA== 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=jR+3NegY1qS4v0bdnVM8wVGwlDtjhB5R24Kv9VPBjpI=; b=jnZq0I/8vw5EyGFFT9bmD/Snfy1yDh36zUxHSteEud3XA9i37MBd8DqavvE006bvqU iv6qT0hghWkynZqJgSW38DkhCcxadp8PeroqMuuz/EcNolkQWhsULJ3qxAI6cNuyT51R A+N0xkYLfXQCqDeFW/Jj3cqPe7AUUtJXWalyAAdHD2KwsHIgMXuZgD1fm9mfjmPqAlFk BuTUekPayHQIyn/5yVr71rjt9NcDeNkXQJ5r17GQRq6s1k3mFCMfNjMRTmGfSeosJCVP XIzxEu8qETWEuzDIjdA7T9rL+uthDSwRrctzbKPvbqVeO7+8Td5+NmEvXqmUBfFz3fHL 3unQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=f0iXjn5R; dkim=pass header.i=@codeaurora.org header.s=default header.b=f0iXjn5R; 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 g4-v6si17872135plm.181.2018.06.18.10.43.49; Mon, 18 Jun 2018 10:44:03 -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=f0iXjn5R; dkim=pass header.i=@codeaurora.org header.s=default header.b=f0iXjn5R; 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 S935547AbeFRRmL (ORCPT + 99 others); Mon, 18 Jun 2018 13:42:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59838 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934957AbeFRRmJ (ORCPT ); Mon, 18 Jun 2018 13:42:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E74E86071B; Mon, 18 Jun 2018 17:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1529343728; bh=42K5hmfQhLdTMx03WgK4MIq3rsmSPfZx+0/Fj7znTzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f0iXjn5RoBvH69HkqFoVNvVJIa9JSV9oGsPWDBX+K4B0TQ3K0rA6GNg+oiOhu683l exMx5qAZm9W/1ftcICXDRlTFx9iuAfJM5OFdKtREGhruAbPHX1xhz2tMNXKDrFxPb1 sIcIGXozexvR0kfIFHji59LhnKQMq3lr/4ORFG4Q= 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 EBBC5607EB; Mon, 18 Jun 2018 17:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1529343728; bh=42K5hmfQhLdTMx03WgK4MIq3rsmSPfZx+0/Fj7znTzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f0iXjn5RoBvH69HkqFoVNvVJIa9JSV9oGsPWDBX+K4B0TQ3K0rA6GNg+oiOhu683l exMx5qAZm9W/1ftcICXDRlTFx9iuAfJM5OFdKtREGhruAbPHX1xhz2tMNXKDrFxPb1 sIcIGXozexvR0kfIFHji59LhnKQMq3lr/4ORFG4Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EBBC5607EB 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: Mon, 18 Jun 2018 11:42:07 -0600 From: Lina Iyer To: Douglas Anderson Cc: andy.gross@linaro.org, tdas@codeaurora.org, collinsd@codeaurora.org, sboyd@kernel.org, broonie@kernel.org, rplsssn@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children Message-ID: <20180618174207.GF21724@codeaurora.org> References: <20180618172230.241960-1-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180618172230.241960-1-dianders@chromium.org> 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 Mon, Jun 18 2018 at 11:23 -0600, Douglas Anderson wrote: >Children of RPMh will need access to cmd_db. Rather than having each >child have code to check if cmd_db is ready let's add the check to >RPMh. > >Suggested-by: Stephen Boyd >Signed-off-by: Douglas Anderson Acked-by: Lina Iyer >--- >This code is based upon v11 of Lina and Raju's RPMh series. > >With this we'll be able to remove this boilerplate code from >clk-rpmh.c and qcom-rpmh-regulator.c. Neither of these files has >landed upstream yet but patches are pretty far along. > > drivers/soc/qcom/rpmh-rsc.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c >index 144a058407c0..ad85523bdd3b 100644 >--- a/drivers/soc/qcom/rpmh-rsc.c >+++ b/drivers/soc/qcom/rpmh-rsc.c >@@ -18,6 +18,7 @@ > #include > #include > >+#include > #include > #include > >@@ -621,6 +622,18 @@ static int rpmh_rsc_probe(struct platform_device *pdev) > struct rsc_drv *drv; > int ret, irq; > >+ /* >+ * Even though RPMh doesn't directly use cmd-db, all of its children >+ * do. To avoid adding this check to our children we'll do it now. nit: Double space before To >+ */ >+ ret = cmd_db_ready(); >+ if (ret) { >+ if (ret != -EPROBE_DEFER) >+ dev_err(&pdev->dev, "Command DB not available (%d)\n", >+ ret); >+ return ret; >+ } >+ > drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); > if (!drv) > return -ENOMEM; >-- >2.18.0.rc1.244.gcf134e6275-goog >