Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4179889imm; Mon, 18 Jun 2018 10:24:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8aUpA+APW1xnczcnyCeRTTntH+ByGRDXPCyknv5ESPJs7tT3vj7cR5dFBen9mKfm5Wo/j X-Received: by 2002:a17:902:b590:: with SMTP id a16-v6mr15421534pls.225.1529342680992; Mon, 18 Jun 2018 10:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529342680; cv=none; d=google.com; s=arc-20160816; b=EJwvwajeS4ENnC0whZQv1uiWh4CdY+Vg02lD1uzA57VNqUf/Ys8JkXNWmKnXBuvk6t MYwuISM8cRoLYgvZopYTt1INNGt9hmemtIjeutYC+7UhV69GNQIMNmLiE20GAsSFjNq0 Th2pWQGnGdb8eYZLZu3EA2qkBY8yIAEOYhcg23XDqSTfN+0T8C/7evIgUYFxmzYfaYmn Eisbd/H18/5Kg5e5+mLrFkxHcqgzVui1oaQL1QaZjsrJ8cjMKxPMuiT5e3x9v4TBQk1O e1YvewZAG8rUwVXEUzKBp+hHRSo7FpD60pXWXANMMF+vhk1W78vaIkEFR6uCbGR7lB2L HJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=zYKY/M5v9IljymNM1No/utpSz2vumnyX/pJFyKFgmOY=; b=BxSB/3Z+WXDC+6oe+y9wfiPRu7kGhjpMUbwEL6Ek2WAUK9seuJqWqw2+pTXpHgh75U 2STf9pRB5zziNoDC6gVjV2heOYWc41EhxMxKWSd9XBVIcs6jpKxvATk9pvweHT3OJGzl 4lskj+oJzXrnEXQjst0iWIm5TsckRSq5mEuneTLoflWyv2Tq2O5MJj9adWj0u2UQN5rb IQhGnFdcj1GvnKA7K7zhuEpK/5mlb0myb0yfKrlZMvzAmRDg/+Aqc/JQF0YEJbOZNSgG uPZDyXxRrAQVWd3wfQfdIDnelH79Lk1+5g0mQ2ywpGhMHj+GbuKow7YVO7KUYbJXmsbP x+Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RYNou3E2; 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=pass (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 w11-v6si12348710pgp.140.2018.06.18.10.24.27; Mon, 18 Jun 2018 10:24:40 -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=@chromium.org header.s=google header.b=RYNou3E2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935350AbeFRRXK (ORCPT + 99 others); Mon, 18 Jun 2018 13:23:10 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:40675 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934963AbeFRRXI (ORCPT ); Mon, 18 Jun 2018 13:23:08 -0400 Received: by mail-pg0-f67.google.com with SMTP id w8-v6so4810505pgp.7 for ; Mon, 18 Jun 2018 10:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=zYKY/M5v9IljymNM1No/utpSz2vumnyX/pJFyKFgmOY=; b=RYNou3E2SigxWaH8gsAmVqn5/wmx8GABr8L5JBh1nAoPVI5xvjZowkYu/dshn1Qe1c H18844maG45H+ybKfk9BKHl2W7cjfX6Hhk/KwVn8dyciky0KCd/ixN5gHe6KJaBa6L4m 3x38vS5cwQF1zdtfHFuWKvNCPArX0XuMaMrDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zYKY/M5v9IljymNM1No/utpSz2vumnyX/pJFyKFgmOY=; b=lMw8EEcAAT+shZq6Z+nP5i5eY6aO8ePI5I3Xi8yyXexFpkrgGzof8g3SqlK7U2bZeK ri8KifasaEPmD/qjRHQm2Owvw6yuYainOTYuVcTMDsmToXUmn0GRpboUvCEeSCT0pSas ZsYcnUEDu7ZSuLPQ7Q1A+c6Jrsf4MxJQMSWQBIsbWjsl0PL2w3TifcoTTnq9gMoNFAB3 Ub/2zRhI/AzxDnQ66xW+Sneg41pjoFneRq6JM9Xlmy1kMmCF7nz5opov2a+0b1DMod79 3rmGI+3af3IDGD29CmkP1U3+Xud3DWHLtrrD86OvzsbSoAQEEoPQSsXGzKaF41tVdiyH X1cw== X-Gm-Message-State: APt69E2MZLV+KoxR857n2D0KgwrvM/bpzR1fg+tTQZqlS5BHqCGWJohu VrzYOnWrfh7q1O06X7R3zSImSw== X-Received: by 2002:a62:4c88:: with SMTP id e8-v6mr9819135pfj.99.1529342588389; Mon, 18 Jun 2018 10:23:08 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:0:1000:1501:38e4:86fe:ec0c:4007]) by smtp.gmail.com with ESMTPSA id z26-v6sm26849091pfd.60.2018.06.18.10.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 10:23:07 -0700 (PDT) From: Douglas Anderson To: andy.gross@linaro.org Cc: tdas@codeaurora.org, collinsd@codeaurora.org, sboyd@kernel.org, ilina@codeaurora.org, broonie@kernel.org, rplsssn@codeaurora.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org Subject: [PATCH] drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children Date: Mon, 18 Jun 2018 10:22:29 -0700 Message-Id: <20180618172230.241960-1-dianders@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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. + */ + 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