From patchwork Mon Jul 9 15:41:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 141440 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2813489ljj; Mon, 9 Jul 2018 08:42:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcwyqKrIBrL1ZZeG6JfSHVToDanuT3MzRm3iXWAMyvZDrZEEgBTYsNs1W9SvzK3ypgsrCjm X-Received: by 2002:a62:d24a:: with SMTP id c71-v6mr21891593pfg.242.1531150930495; Mon, 09 Jul 2018 08:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531150930; cv=none; d=google.com; s=arc-20160816; b=i5CSBuFgqhkH6yWO+Kb7tgiHCgjLT8LEUpBEGN1vaFrzAiLN453lg8YzBqcwP7/n0R N27vPVr/F7TN6d6JwcKwACHz1YEdvv78gbfSzF6Wl35gkSpwe/Tsvpva3+oUW6f9O1a6 nUAqUMN7wE04VfStYabuUM1/86yg//EgLc3twK7nVvn59H5L+74jCJFrP8WMzr7h+Xyx moJ6KDnQfLAFZzM16ADtPvbmkuaMxzJxh0C/6eUJjpHRlyie0FPHKegOpGsb0O8hq89A aPsqqX3+bHQcCRjUyRF0FLvWhvRQBq5QIv8OsU2ptRzE3+buoAso3Dngh9xMgD4yRAb1 Ty/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OGMIUtlDqT+EObEIlXTge4ecUvufNaOQ7TCKBj9GFsc=; b=xQRywcRhvd2UAMyz6FJUgBrOD9sFF6FHY+1p6vuFQfxFrc3X8OBid62IsBV1xg+sd7 NsgVdeWG+1fwKTB4dubcKrTEKzbWuLmZkwJkcYqSKCc4PYabIjpqRxNd1TElPeO8rSVF pqX3BAJPsIoyJFd1XFBVm7boCsNuMZvKicwFJY5Hnwxw8hlMeveD024RWtb7P7GIITb7 soqU+aTg0hykQsEN+fdRuRN1tJNTqBvpD6MFvPliuE6v9rLS3luSegEogjVYoR0BGM1V E9sOIq3fpfk6ZLj6d1LjX1SOXOxs076Q5FzONsaCi46EWFzmhWvoWbW+NXqmCPidluul uVyA== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x62-v6si16608749pfd.124.2018.07.09.08.42.10; Mon, 09 Jul 2018 08:42:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933674AbeGIPmH (ORCPT + 30 others); Mon, 9 Jul 2018 11:42:07 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:38170 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933650AbeGIPmE (ORCPT ); Mon, 9 Jul 2018 11:42:04 -0400 Received: by mail-oi0-f66.google.com with SMTP id v8-v6so36733126oie.5; Mon, 09 Jul 2018 08:42:04 -0700 (PDT) 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:in-reply-to :references; bh=OGMIUtlDqT+EObEIlXTge4ecUvufNaOQ7TCKBj9GFsc=; b=IRvcRFe14+g7/HU2uW4Rp9WaFCF4FKKI8R8VNcfGxdbJi32YHQzBT19OXeJaPQTrwa BtLxttOHMFV7eiLiyvDNLJu9yY+kxYCuXb6THElOb25dRMO0MstKiNi9mI4/V/zMg5+V 25e0Ifht9qC7Vhs+RmlnqPcQ7a1OboSgL4wV/TX+iXHWy64w3E5uHkktiy9J+9/vY3uL J3X2BoRO1mCFG4icvLjC1pdUQY1zcRjzINZeEpmqXLBh7YsqfFm54NwUovDZPc6tekKP 7pIPTLUu41Ap89bzkCuvjToIPM+o//NXabF9LBUPpNWTdZGgqyaUin03JYLqpKj71fTO 538g== X-Gm-Message-State: APt69E2QSyqaMO1NCltd8huUHu6Nvh+Av3AQ39qnQyMc1lwjqDgtF+x9 S0pEQo9eDY1LdojAUeS3Bg== X-Received: by 2002:aca:f401:: with SMTP id s1-v6mr25350751oih.269.1531150924010; Mon, 09 Jul 2018 08:42:04 -0700 (PDT) Received: from localhost.localdomain (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.googlemail.com with ESMTPSA id z196-v6sm30759391oig.12.2018.07.09.08.42.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:42:03 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman Cc: Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, boot-architecture@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/6] pinctrl: Support stopping deferred probe after initcalls Date: Mon, 9 Jul 2018 09:41:50 -0600 Message-Id: <20180709154153.15742-4-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709154153.15742-1-robh@kernel.org> References: <20180709154153.15742-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pinctrl drivers are a common dependency which can prevent a system booting even if the default or bootloader configured settings can work. If a pinctrl node in DT indicates that the default pin setup can be used with the 'pinctrl-use-default' property, then only defer probe until initcalls are done. If the deferred probe timeout is enabled or loadable modules are disabled, then we'll stop deferring probe regardless of the DT property. This gives platforms the option to work without their pinctrl driver being enabled. Dropped the pinctrl specific deferring probe message as the driver core can print deferred probe related messages if needed. Reviewed-by: Linus Walleij Signed-off-by: Rob Herring --- v4: - Add Linus' R-by. v3: - Drop pinctrl deferred probe msg in favor of driver core messages - Move the handling of "pinctrl-use-default" option out of driver core - Stop deferring probe if modules are not enabled. drivers/pinctrl/devicetree.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index c4aa411f5935..2969ff3162c3 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -111,17 +111,24 @@ static int dt_to_map_one_config(struct pinctrl *p, int ret; struct pinctrl_map *map; unsigned num_maps; + bool allow_default = false; /* Find the pin controller containing np_config */ np_pctldev = of_node_get(np_config); for (;;) { + if (!allow_default) + allow_default = of_property_read_bool(np_pctldev, + "pinctrl-use-default"); + np_pctldev = of_get_next_parent(np_pctldev); if (!np_pctldev || of_node_is_root(np_pctldev)) { - dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n", - np_config); of_node_put(np_pctldev); - /* OK let's just assume this will appear later then */ - return -EPROBE_DEFER; + ret = driver_deferred_probe_check_state(p->dev); + /* keep deferring if modules are enabled unless we've timed out */ + if (IS_ENABLED(CONFIG_MODULES) && !allow_default && ret == -ENODEV) + ret = -EPROBE_DEFER; + + return ret; } /* If we're creating a hog we can use the passed pctldev */ if (hog_pctldev && (np_pctldev == p->dev->of_node)) {