From patchwork Wed Sep 30 19:30:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105335 Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp155028lbq; Wed, 30 Sep 2015 12:31:13 -0700 (PDT) X-Received: by 10.68.131.68 with SMTP id ok4mr5190958pbb.149.1443641473055; Wed, 30 Sep 2015 12:31:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl7si2859649pab.220.2015.09.30.12.31.12; Wed, 30 Sep 2015 12:31:13 -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; 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 S932667AbbI3TbK (ORCPT + 30 others); Wed, 30 Sep 2015 15:31:10 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:59605 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753567AbbI3TbH (ORCPT ); Wed, 30 Sep 2015 15:31:07 -0400 Received: from [2a01:348:6:8808:7e7a:91ff:fede:4a45] (helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZhN5f-0002rH-RL; Wed, 30 Sep 2015 19:31:01 +0000 Received: from broonie by finisterre with local (Exim 4.86) (envelope-from ) id 1ZhN5c-0005hB-DK; Wed, 30 Sep 2015 20:30:56 +0100 From: Mark Brown To: Sascha Hauer , Liam Girdwood Cc: linux-kernel@vger.kernel.org, Mark Brown Date: Wed, 30 Sep 2015 20:30:52 +0100 Message-Id: <1443641452-21824-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.5.0 X-SA-Exim-Connect-IP: 2a01:348:6:8808:7e7a:91ff:fede:4a45 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] regulator: core: Handle probe deferral from DT when resolving supplies X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When resolving regulator-regulator supplies we ignore probe deferral returns from regulator_dev_lookup() (such as are generated for DT when we can see a supply is registered) and just fall back to the dummy regulator if there are full constraints (as is the case for DT). This means that probe deferral is broken for DT systems, fix that by paying attention to -EPROBE_DEFER return codes like we do -ENODEV. A further patch will simplify this further, this is a minimal fix for the specific issue. Reported-by: Sascha Hauer Signed-off-by: Mark Brown --- Tested with my famous "I need to leave the house right now so haven't even tried building this yet" test plan - please let me know how this works for you. drivers/regulator/core.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index af045e5..e9b94d7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1448,6 +1448,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) return 0; } + /* Did the lookup explicitly defer for us? */ + if (ret == -EPROBE_DEFER) + return ret; + if (have_full_constraints()) { r = dummy_regulator_rdev; get_device(&r->dev);