From patchwork Mon Jul 9 15:41:48 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: 141439 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2813418ljj; Mon, 9 Jul 2018 08:42:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf9m65BqeDhl1S9tKUBdYbB9F5vpio3+z6W+U7LjkaJO/SQySiTt0RHjF+DdjdD4j4Jjymb X-Received: by 2002:a17:902:8206:: with SMTP id x6-v6mr20728661pln.220.1531150927428; Mon, 09 Jul 2018 08:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531150927; cv=none; d=google.com; s=arc-20160816; b=egjlaO7o19MW+cs7YWGRms42YvdlkQFdV0KwkzTjj8iOKS+YQHC3oIrsm18vhpso28 RearF8WhL6Is152slHseVPK5xlcbuAt2E9FPJnZRNbMMAD1L4Z9mnUY/7sdWU5oJ6cM6 o/GaRFbaEdzB/LjcOAWrR15cPPEgXdGj4c0Do49lIAIiMXJrfGiOYRmpBYXUN+jYcaWY JEBpHr7ZXco22FRCoiwYY6cn8tD65ngULYVrw1FV8YuuEpNeBVAvoJLjqIJltw06yA3e 3cH4rMMjlnHGlz4gYl94kM0pF/fNYJ6ogZjBngmruJ1v+dYpvtNDXS4BMviUsaBrhf6Y 5Oeg== 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=saQ436eaurAbu2okU+dKORu9bdhDpvxbPgF9Cd5+TaA=; b=rd/cl10S5q1LUXLMRMtRzAyLaGIuOEi5mGy8Nl473c8YjSuAOkSUjhtxpju3QF9ELr tqMg9hupdPa2kgn69SNBN3mQ9cC9GyPwyirFIPQFoYm+nBiwXx7NDIUW0F7aoPUlR+XQ Bv7/VSQXGBtIjF1WHbE/2oKNORYw+RDQpqSawCpcC5GByY059afQCnMpR3lVSr+V6i9l jXUQdU8ezQPO8rvqeTWXbtLWwIzOPm/2o2Ti3pTIEme0KHbqQf6DV4s075VBBKoc6Ide boYiG0mH9LUKi7VmnGPpmDW8OXqfW79NYiH0EYVxm/ljwnSL6KbE4QH+fXJhFOrsR9Tn 7WAw== 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 t6-v6si14403828plo.508.2018.07.09.08.42.07; Mon, 09 Jul 2018 08:42:07 -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 S933651AbeGIPmE (ORCPT + 30 others); Mon, 9 Jul 2018 11:42:04 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:42828 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933520AbeGIPmB (ORCPT ); Mon, 9 Jul 2018 11:42:01 -0400 Received: by mail-oi0-f67.google.com with SMTP id n84-v6so36700480oib.9; Mon, 09 Jul 2018 08:42:00 -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=saQ436eaurAbu2okU+dKORu9bdhDpvxbPgF9Cd5+TaA=; b=FhmHGVd0OiHKIGTjzIksXK47oESMtmVBWHT64XvGt2g2Vphf6bgW9psX6WdF4Pli2B /icJgpAV50uhk3mGky6Kb5qf+bsTgTtL8TH9r3SRD/tCzkwMI8Rmpsh+bbD78sZqhoEi F1+f4oFZUZTKoWjy4WCAyPyuHfF7v8hcAaArpxHq9jkYxf+w+kzxKx5gnr7md8x075uX Muv4HlFvD3/Qm5Q9RQazpir4vJCahYxis1lbBSzRmRdtJtNC2LV/ynPsu4xgG4aGqbYq o9JAptVZQhIevSHW0ipc8bbh24t5pfOvd3VAaaOYlJLIswgrv57uMO2DLfF3CvdMdd6T k18g== X-Gm-Message-State: APt69E0NbLG85nmakCcPlVY2C5TZ+5WKuT5r+/rE1ZFfUQgXDzWEQA09 R1XagCYSR0iE5+ZBijIXqw== X-Received: by 2002:aca:3954:: with SMTP id g81-v6mr25211279oia.215.1531150920437; Mon, 09 Jul 2018 08:42:00 -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.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:41:59 -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 1/6] driver core: allow stopping deferred probe after init Date: Mon, 9 Jul 2018 09:41:48 -0600 Message-Id: <20180709154153.15742-2-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 Deferred probe will currently wait forever on dependent devices to probe, but sometimes a driver will never exist. It's also not always critical for a driver to exist. Platforms can rely on default configuration from the bootloader or reset defaults for things such as pinctrl and power domains. This is often the case with initial platform support until various drivers get enabled. There's at least 2 scenarios where deferred probe can render a platform broken. Both involve using a DT which has more devices and dependencies than the kernel supports. The 1st case is a driver may be disabled in the kernel config. The 2nd case is the kernel version may simply not have the dependent driver. This can happen if using a newer DT (provided by firmware perhaps) with a stable kernel version. Deferred probe issues can be difficult to debug especially if the console has dependencies or userspace fails to boot to a shell. There are also cases like IOMMUs where only built-in drivers are supported, so deferring probe after initcalls is not needed. The IOMMU subsystem implemented its own mechanism to handle this using OF_DECLARE linker sections. This commit adds makes ending deferred probe conditional on initcalls being completed or a debug timeout. Subsystems or drivers may opt-in by calling driver_deferred_probe_check_init_done() instead of unconditionally returning -EPROBE_DEFER. They may use additional information from DT or kernel's config to decide whether to continue to defer probe or not. The timeout mechanism is intended for debug purposes and WARNs loudly. The remaining deferred probe pending list will also be dumped after the timeout. Not that this timeout won't work for the console which needs to be enabled before userspace starts. However, if the console's dependencies are resolved, then the kernel log will be printed (as opposed to no output). Cc: Alexander Graf Signed-off-by: Rob Herring --- v4: - Rebase on driver-core-next - Only allow base 10 for timeout v3: - Merged with timeout patch. - Clarify that deferred_probe_timeout is a debug option. - Drop the 'optional' param. The only user was pinctrl, so it has to handle that functionality. - Rename function to driver_deferred_probe_check_state - Added kerneldoc for driver_deferred_probe_check_state - Print a 1 line warning if stopping deferred probe after initcalls and a WARN on timeout. .../admin-guide/kernel-parameters.txt | 9 +++ drivers/base/dd.c | 59 +++++++++++++++++++ include/linux/device.h | 2 + 3 files changed, 70 insertions(+) -- 2.17.1 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index efc7aa7a0670..e83ef4648ea4 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -804,6 +804,15 @@ Defaults to the default architecture's huge page size if not specified. + deferred_probe_timeout= + [KNL] Debugging option to set a timeout in seconds for + deferred probe to give up waiting on dependencies to + probe. Only specific dependencies (subsystems or + drivers) that have opted in will be ignored. A timeout of 0 + will timeout at the end of initcalls. This option will also + dump out devices still on the deferred probe list after + retrying. + dhash_entries= [KNL] Set number of hash buckets for dentry cache. diff --git a/drivers/base/dd.c b/drivers/base/dd.c index e85705e84407..fb62f1be40d3 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -55,6 +55,7 @@ static LIST_HEAD(deferred_probe_pending_list); static LIST_HEAD(deferred_probe_active_list); static atomic_t deferred_trigger_count = ATOMIC_INIT(0); static struct dentry *deferred_devices; +static bool initcalls_done; /* * In some cases, like suspend to RAM or hibernation, It might be reasonable @@ -219,6 +220,51 @@ static int deferred_devs_show(struct seq_file *s, void *data) } DEFINE_SHOW_ATTRIBUTE(deferred_devs); +static int deferred_probe_timeout = -1; +static int __init deferred_probe_timeout_setup(char *str) +{ + deferred_probe_timeout = simple_strtol(str, NULL, 10); + return 1; +} +__setup("deferred_probe_timeout=", deferred_probe_timeout_setup); + +/** + * driver_deferred_probe_check_state() - Check deferred probe state + * @dev: device to check + * + * Returns -ENODEV if init is done and all built-in drivers have had a chance + * to probe (i.e. initcalls are done), -ETIMEDOUT if deferred probe debug + * timeout has expired, or -EPROBE_DEFER if none of those conditions are met. + * + * Drivers or subsystems can opt-in to calling this function instead of directly + * returning -EPROBE_DEFER. + */ +int driver_deferred_probe_check_state(struct device *dev) +{ + if (initcalls_done) { + if (!deferred_probe_timeout) { + dev_WARN(dev, "deferred probe timeout, ignoring dependency"); + return -ETIMEDOUT; + } + dev_warn(dev, "ignoring dependency for device, assuming no driver"); + return -ENODEV; + } + return -EPROBE_DEFER; +} + +static void deferred_probe_timeout_work_func(struct work_struct *work) +{ + struct device_private *private, *p; + + deferred_probe_timeout = 0; + driver_deferred_probe_trigger(); + flush_work(&deferred_probe_work); + + list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) + dev_info(private->device, "deferred probe pending"); +} +static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); + /** * deferred_probe_initcall() - Enable probing of deferred devices * @@ -235,6 +281,19 @@ static int deferred_probe_initcall(void) driver_deferred_probe_trigger(); /* Sort as many dependencies as possible before exiting initcalls */ flush_work(&deferred_probe_work); + initcalls_done = true; + + /* + * Trigger deferred probe again, this time we won't defer anything + * that is optional + */ + driver_deferred_probe_trigger(); + flush_work(&deferred_probe_work); + + if (deferred_probe_timeout > 0) { + schedule_delayed_work(&deferred_probe_timeout_work, + deferred_probe_timeout * HZ); + } return 0; } late_initcall(deferred_probe_initcall); diff --git a/include/linux/device.h b/include/linux/device.h index 575c5a35ece5..d2acc78d279b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -339,6 +339,8 @@ struct device *driver_find_device(struct device_driver *drv, struct device *start, void *data, int (*match)(struct device *dev, void *data)); +int driver_deferred_probe_check_state(struct device *dev); + /** * struct subsys_interface - interfaces to device functions * @name: name of the device function From patchwork Mon Jul 9 15:41:49 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: 141444 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2815016ljj; Mon, 9 Jul 2018 08:43:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdsH0WH5bjRVwt7F4vKrBGDNoEnWC3LZJlz/2LbLNzuGbUJgZ3NwA0onuckj2j6qyOgT7Q8 X-Received: by 2002:a63:714a:: with SMTP id b10-v6mr18799056pgn.73.1531151025236; Mon, 09 Jul 2018 08:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151025; cv=none; d=google.com; s=arc-20160816; b=lJpt82iYeWQeQi8U+B2EWljnMSmYZBeJ2Z3Kgzsh+fOp5XwaNTmIZ1iQUZM+uMnvBo zrwmvrkMwWb6jHslRMggvGfy3Qumjbk+8zwMikQ9Rl6eTmadrR/pEqOWI/4FNRjEFdd4 dFEYlXYD/MW8ONI7/GBtqpzZKn17ttOOazuO94fvx9ZFs4eayIWYkdiD3bgffUihRsZE oHZ9xsZSrGbnYRwKqySuwxM543zcVztXOdbZ676PWT0fB8WDUi1rLlZ/TM7gPNVmWBUN E5hR7RzBrm3ZWpnDOmG38LbX+JEfCQAdFFI6I+5+9sJSbnXW6vfo8xbIqMbDOps2MFxf 6+UQ== 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=03fLRQWBWjrnrq//f5qAO73beSpbPCDyJ89HOkL1LXw=; b=ZGvdiY/qxITd7n0tPawVr6RFZpRGPg5VG7Ua9YEPAZZOUbbuW2k3Q6fzEvZVyO/79n IaeNdSk531flnXSHH66XG7UOfgYYXyCmYGX+wu76gjc02Ez6w6lq1jTRWiL1GqgIxQGD JstKcBvy0iFJQWml5wuzYDrJjtd5FwXwt4wEXCcfnV6D2BwGa4c9TlyY0D+dziWjL1wm rWkohKC5yRUEkTyYXkc3T+GlG0H2oArgC831T1qHKlNtZafSTA+uMLcyawH0i38oNotB ZoeL9NljBfh69dOXRumx06ItrW/4vxDvwjnbXNxPF2K8N2QtL7BmRfH+IcFSxgYxFZeR B90w== 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 r1-v6si14931890plb.172.2018.07.09.08.43.44; Mon, 09 Jul 2018 08:43:45 -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 S933753AbeGIPnm (ORCPT + 30 others); Mon, 9 Jul 2018 11:43:42 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:43123 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932867AbeGIPmC (ORCPT ); Mon, 9 Jul 2018 11:42:02 -0400 Received: by mail-oi0-f68.google.com with SMTP id b15-v6so36666070oib.10; Mon, 09 Jul 2018 08:42:02 -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=03fLRQWBWjrnrq//f5qAO73beSpbPCDyJ89HOkL1LXw=; b=Q2HH4gHxmP6vM/m8GZ2qSBKvuT1fv/R52qU0B/MCuGEyZ8VDeuR7JHAxNk/MA6hQ2H Lif0yEDQD1nL4VJ5+htjr9kYzVib1Gghzs9tf+6wZ6l++xofj7FWEDCcYNIqP/Hp7ooz 7HpUYdNOUxiwubERYaK+EJ2VPfRZ5BJY7BOZva4bgW1jNbUTtrXUDLdNE31g/Y/iLbEs dv7n5Hj/fZX064cDR38AgkmMSAhd0FxBbD4lQCMTscOC7L3OqbmtjC8jKx3EcKcTVOrQ pRTIA8IGVa8ylXl+KW0bpL7JdtzCAyGdabUWH2wQ7zofJiODsSjOK+0M2EPXCrqFqiZZ KtOQ== X-Gm-Message-State: APt69E3KIXmAkfm+tIfUfJnDLRQssduQYjjP9vNQ+XZ/oNfLChzv6oDO gc84u6YodPXijRhUUwbzyQ== X-Received: by 2002:aca:665b:: with SMTP id a88-v6mr24312433oic.101.1531150922149; Mon, 09 Jul 2018 08:42:02 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:42:01 -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 2/6] dt-bindings: pinctrl: add a 'pinctrl-use-default' property Date: Mon, 9 Jul 2018 09:41:49 -0600 Message-Id: <20180709154153.15742-3-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 Pin setup may be optional in some cases such as the reset default works or the pin setup is done by the bootloader. In these cases, it is optional for the OS to support managing the pin controller and pin setup. In order to support this scenario, add a property 'pinctrl-use-default' to indicate that the pin configuration is optional. Signed-off-by: Rob Herring --- .../devicetree/bindings/pinctrl/pinctrl-bindings.txt | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index ad9bbbba36e9..cef2b5855d60 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -103,6 +103,12 @@ Optional properties: #pinctrl-cells: Number of pin control cells in addition to the index within the pin controller device instance +pinctrl-use-default: Boolean. Indicates that the OS can use the boot default + pin configuration. This allows using an OS that does not have a + driver for the pin controller. This property can be set either + globally for the pin controller or in child nodes for individual + pin group control. + Pin controller devices should contain the pin configuration nodes that client devices reference. 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)) { From patchwork Mon Jul 9 15:41:51 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: 141443 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2814614ljj; Mon, 9 Jul 2018 08:43:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcG7PoCqtg3x/vH67L3DfH1bYTs115yYT7qp6u/b1j2t8SdHgno3o1sOHha9AaqPitHUaWf X-Received: by 2002:a62:1d97:: with SMTP id d145-v6mr22091800pfd.101.1531151000822; Mon, 09 Jul 2018 08:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151000; cv=none; d=google.com; s=arc-20160816; b=YV7RoNp5HkWCx3a8c1t7kyD5cHtIQzgutf4ccjZrnuEyxOVWwLf0bInqXOe9D/F/EM xYF50330sh5dnGjEUy5kV9rayoNXBT30f4C9WrPOS11qjc+6DnuyHbxW8zqMnR27k7p/ eS6y6rATtmu1Ej/JxWBadesKxcpooDiLUdpc28ScSRWLbubhKNUxQW+L7/dyUIW0HWeI tjwKZ0d5M2DGE6FHR3UlZ3BnQUmYLDZXNOlfMZOZuavd6hoi+wkZ/NytkQdnvXx4n4cn fEAokD5KR1kE1iWCbHrSsSOIweVy0paSUWL4e4JqIt9vjFsj8Zz1wv53XVOUUklGIw0H cyNQ== 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=vCohodIIanHa5uBHiQc1B5XPmGoIOIBepeJZ6BKWz/A=; b=IDLoi/HvinuMv6s92J7Ptx7kcvjaTsq+R7BPi1VWliZHHe3qwVuk3JbNCezu0yULzV AqiqUksjz2HunGt2TL8iWMvwhA85pSxtAoywBSVSbvUPcOHCmiZ8sQX3D0rEnw/I3mdb r4Z8VV3ExB/fKUwbDNZbfZb+si1sjgU3sLP0eqo7ppYdOE31ShWo+DS2poFhbezLt4kd OFvNMYKbjvq7zEvTEfi47jWJCzSbntaDlkFe2RrLfDlsUeWY2d+8OEDeBhtSXehM4Jmt IIZn6WS5epD0Jjr/0mY1IhZw8c+Td7H2oc7MlEijvPYYeMKpoG3ayeN3cTGKnlrsjSDq r5MQ== 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 r1-v6si14931890plb.172.2018.07.09.08.43.20; Mon, 09 Jul 2018 08:43:20 -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 S933746AbeGIPnT (ORCPT + 30 others); Mon, 9 Jul 2018 11:43:19 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36365 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933298AbeGIPmG (ORCPT ); Mon, 9 Jul 2018 11:42:06 -0400 Received: by mail-oi0-f66.google.com with SMTP id r16-v6so36734191oie.3; Mon, 09 Jul 2018 08:42:06 -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=vCohodIIanHa5uBHiQc1B5XPmGoIOIBepeJZ6BKWz/A=; b=BB4bCSMXthArGkBcU9Np4Q1RCclRmnmhabBi/PWZIsGOGXrVCbZCctjoTA0kZ2kiVX bo/UNxpbalQEMY9/FnY7SiAFJ+vU2sP+OZlMNwzkw0CHw4Tia4Az5bxx2SF5oevqQrak HxuDo0vnwiYgf00ogrsevx+A5s5He8WU0zQOEtmQjujZPRxZI11OyKxkPlP82CVvGkAh vI/z7nbQx/wwwc68ZezQLZ0brJb+3zPfJR1nuEqIlReIeqxXgYhdjooua34SGDh6/DA5 CE9l0ssklr+702Hz3UQkMZvKQIE0KW9oGyKJzA9g1A3YKRsUcLOxPhvR43Hpp3L8SLbJ FPng== X-Gm-Message-State: APt69E1TMOQpSt59/4f7w9Krnf/dxGhfkvCsVcu0I84sG2p2S6bQZ+7c TwqtZc1GmjWS6QCKB6RCAA== X-Received: by 2002:aca:b60a:: with SMTP id g10-v6mr24442586oif.263.1531150925929; Mon, 09 Jul 2018 08:42:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:42:05 -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, iommu@lists.linux-foundation.org, Joerg Roedel Subject: [PATCH v4 4/6] iommu: Stop deferring probe at end of initcalls Date: Mon, 9 Jul 2018 09:41:51 -0600 Message-Id: <20180709154153.15742-5-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 The IOMMU subsystem has its own mechanism to not defer probe if driver support is missing. Now that the driver core supports stopping deferring probe if drivers aren't built-in (and probed), use the driver core support so the IOMMU specific support can be removed. Acked-by: Joerg Roedel Cc: iommu@lists.linux-foundation.org Signed-off-by: Rob Herring --- drivers/iommu/of_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 5c36a8b7656a..78ddf47dd67a 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -133,7 +133,7 @@ static int of_iommu_xlate(struct device *dev, * a proper probe-ordering dependency mechanism in future. */ if (!ops) - return -EPROBE_DEFER; + return driver_deferred_probe_check_state(dev); return ops->of_xlate(dev, iommu_spec); } From patchwork Mon Jul 9 15:41:52 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: 141441 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2813632ljj; Mon, 9 Jul 2018 08:42:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdrfC0eVOgWnIvrBXVU9Hdihqavb9tz5e8ASd3csGfSpEZpUHJIca4+OAUSGG+G/LhsNDO3 X-Received: by 2002:a62:8b87:: with SMTP id e7-v6mr21919808pfl.133.1531150937217; Mon, 09 Jul 2018 08:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531150937; cv=none; d=google.com; s=arc-20160816; b=SiryBqvQlbrlWWY3Blfee0TkJhPxQTaApVF8dga3DjNXkko+DFSqi7w5sQncnlfvVP LLoaawlmqSn6IJtS5wAdWFpOhMLZ6ZF8XFrAM0oZuYmnftQY6zWIP+3Akn3kicOUrd+S aI+hTmiO5Fzu+XOpCU/YX8yjnosFqi1NVZZTzxk7zLKZp58f9bNkG7u1vIw0iastI4uA SOkuFIM5BMeB/Ndtt+XPcYyq74YISm/l6HBg0r9jGbJZznhx6R/n13+Nouakh31/Pd39 SjXy64VoP/2BnSpsth9SVZ82qF8OOcH3zQtNZFr/zaZKgoNVX+MHfu4Dbfz+NiG8v9xp xm3w== 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=3bGancJVr3XeRqzVj1sUBDCgPaP76cWtWFpfgEAONTQ=; b=RkbIR6R4tNqqytSVpMs8Rx8I2UxHdEgKCKZcD5JCtoAmZq8+qSVrePdm4k0hmRZqYk qV7PRQKXdYWbTGLiXUg6CjUm+7iKggSdWXFaZqce/UoEJ/spU2MNl+fQTZWrO+HQ50iU P7708byW9d1hK/8y+a9x0Gw6D9I3PjVh7tFLU9HGzq/BoR1o2GcSlUHI1+FIX+iGzFsI UQC+SAuCfhxATMlALFG+a6PU1T6Rk7JF8Ct+BTtaoXS0lP6tzgJGuUHREKe0zgY5RdBK LNJE0IONuCrUt5RMoqv/Z5zBzbeEfgGyvBgtyXu++TCp6nDSGQtPbpv2jwpk16IK8e3U qXXA== 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.16; Mon, 09 Jul 2018 08:42:17 -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 S933695AbeGIPmP (ORCPT + 30 others); Mon, 9 Jul 2018 11:42:15 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:40506 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933650AbeGIPmJ (ORCPT ); Mon, 9 Jul 2018 11:42:09 -0400 Received: by mail-oi0-f66.google.com with SMTP id w126-v6so36703041oie.7; Mon, 09 Jul 2018 08:42:08 -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=3bGancJVr3XeRqzVj1sUBDCgPaP76cWtWFpfgEAONTQ=; b=A0QM6SREowOWs/R1IYoBExOdw90tNQKjjSqq24Fhm4C85YqTiVQsgJTLbhK/BmU5cE OFHfuRaXlkn5tzWVw3Fs+wJDPzgDkKfyZyfEMFcTUmEnriRVruktxYTfeM3m65w9q8I5 alKMGfPbecPEM0HaxXC5F8RZRz/2KbwMN4My0XYc3FxNSITevMVc+3DxNf7ndExQ3i8e j7PvfUvBPiXVufXI/SuGXgurmViwSSuyWIIrIVcf7MJAqt1m+k/jfq9OdwwJDk6wXcZ/ ARaSJiMKFHl/dasp+rZk4OclJqjcJ0e8tYPK3T8SkR3ajnaCffBuz+P0WCL1duAWFKAW Jobg== X-Gm-Message-State: APt69E2vLHgxy5wbVM34xiozZlhqqeUuaaOWCbHN22HNfTDBrtPdSr4i WvPUnZKeOFC+2sDx1em7vQ== X-Received: by 2002:aca:dc08:: with SMTP id t8-v6mr24974652oig.226.1531150928299; Mon, 09 Jul 2018 08:42:08 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:42:07 -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, Kukjin Kim , Krzysztof Kozlowski , Rob Clark , Heiko Stuebner , iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, Will Deacon , Marek Szyprowski , Joerg Roedel Subject: [PATCH v4 5/6] iommu: Remove IOMMU_OF_DECLARE Date: Mon, 9 Jul 2018 09:41:52 -0600 Message-Id: <20180709154153.15742-6-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 Now that we use the driver core to stop deferred probe for missing drivers, IOMMU_OF_DECLARE can be removed. This is slightly less optimal than having a list of built-in drivers in that we'll now defer probe twice before giving up. This shouldn't have a significant impact on boot times as past discussions about deferred probe have given no evidence of deferred probe having a substantial impact. Cc: Robin Murphy Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Rob Clark Cc: Heiko Stuebner Cc: Frank Rowand Cc: linux-arm-kernel@lists.infradead.org Cc: iommu@lists.linux-foundation.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org Acked-by: Will Deacon Acked-by: Marek Szyprowski Acked-by: Joerg Roedel Signed-off-by: Rob Herring --- drivers/iommu/arm-smmu-v3.c | 2 -- drivers/iommu/arm-smmu.c | 7 ------- drivers/iommu/exynos-iommu.c | 2 -- drivers/iommu/ipmmu-vmsa.c | 3 --- drivers/iommu/msm_iommu.c | 2 -- drivers/iommu/of_iommu.c | 19 +------------------ drivers/iommu/qcom_iommu.c | 2 -- drivers/iommu/rockchip-iommu.c | 2 -- include/asm-generic/vmlinux.lds.h | 2 -- include/linux/of_iommu.h | 4 ---- 10 files changed, 1 insertion(+), 44 deletions(-) -- 2.17.1 diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 1d647104bccc..22bdabd3d8e0 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -2915,8 +2915,6 @@ static struct platform_driver arm_smmu_driver = { }; module_platform_driver(arm_smmu_driver); -IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3"); - MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations"); MODULE_AUTHOR("Will Deacon "); MODULE_LICENSE("GPL v2"); diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index f7a96bcf94a6..c73cfce1ccc0 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2211,13 +2211,6 @@ static struct platform_driver arm_smmu_driver = { }; module_platform_driver(arm_smmu_driver); -IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1"); -IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2"); -IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400"); -IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401"); -IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500"); -IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2"); - MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); MODULE_AUTHOR("Will Deacon "); MODULE_LICENSE("GPL v2"); diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 85879cfec52f..b128cb4372d3 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1390,5 +1390,3 @@ static int __init exynos_iommu_init(void) return ret; } core_initcall(exynos_iommu_init); - -IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu"); diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 40ae6e87cb88..f026aa16d5f1 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -1108,9 +1108,6 @@ static void __exit ipmmu_exit(void) subsys_initcall(ipmmu_init); module_exit(ipmmu_exit); -IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa"); -IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795"); - MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU"); MODULE_AUTHOR("Laurent Pinchart "); MODULE_LICENSE("GPL v2"); diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 0d3350463a3f..27377742600d 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -877,7 +877,5 @@ static void __exit msm_iommu_driver_exit(void) subsys_initcall(msm_iommu_driver_init); module_exit(msm_iommu_driver_exit); -IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu"); - MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Stepan Moskovchenko "); diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 78ddf47dd67a..f7787e757244 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -27,9 +27,6 @@ #define NO_IOMMU 1 -static const struct of_device_id __iommu_of_table_sentinel - __used __section(__iommu_of_table_end); - /** * of_get_dma_window - Parse *dma-window property and returns 0 if found. * @@ -98,19 +95,6 @@ int of_get_dma_window(struct device_node *dn, const char *prefix, int index, } EXPORT_SYMBOL_GPL(of_get_dma_window); -static bool of_iommu_driver_present(struct device_node *np) -{ - /* - * If the IOMMU still isn't ready by the time we reach init, assume - * it never will be. We don't want to defer indefinitely, nor attempt - * to dereference __iommu_of_table after it's been freed. - */ - if (system_state >= SYSTEM_RUNNING) - return false; - - return of_match_node(&__iommu_of_table, np); -} - static int of_iommu_xlate(struct device *dev, struct of_phandle_args *iommu_spec) { @@ -120,8 +104,7 @@ static int of_iommu_xlate(struct device *dev, ops = iommu_ops_from_fwnode(fwnode); if ((ops && !ops->of_xlate) || - !of_device_is_available(iommu_spec->np) || - (!ops && !of_iommu_driver_present(iommu_spec->np))) + !of_device_is_available(iommu_spec->np)) return NO_IOMMU; err = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops); diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c index fe88a4880d3a..b48aee82d14b 100644 --- a/drivers/iommu/qcom_iommu.c +++ b/drivers/iommu/qcom_iommu.c @@ -945,7 +945,5 @@ static void __exit qcom_iommu_exit(void) module_init(qcom_iommu_init); module_exit(qcom_iommu_exit); -IOMMU_OF_DECLARE(qcom_iommu_dev, "qcom,msm-iommu-v1"); - MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 054cd2c8e9c8..de8d3bf91b23 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1284,8 +1284,6 @@ static int __init rk_iommu_init(void) } subsys_initcall(rk_iommu_init); -IOMMU_OF_DECLARE(rk_iommu_of, "rockchip,iommu"); - MODULE_DESCRIPTION("IOMMU API for Rockchip"); MODULE_AUTHOR("Simon Xue and Daniel Kurtz "); MODULE_ALIAS("platform:rockchip-iommu"); diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index e373e2e10f6a..f173b5f30dbe 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -218,7 +218,6 @@ #define TIMER_OF_TABLES() OF_TABLE(CONFIG_TIMER_OF, timer) #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip) #define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk) -#define IOMMU_OF_TABLES() OF_TABLE(CONFIG_OF_IOMMU, iommu) #define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem) #define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method) #define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method) @@ -601,7 +600,6 @@ CLK_OF_TABLES() \ RESERVEDMEM_OF_TABLES() \ TIMER_OF_TABLES() \ - IOMMU_OF_TABLES() \ CPU_METHOD_OF_TABLES() \ CPUIDLE_METHOD_OF_TABLES() \ KERNEL_DTB() \ diff --git a/include/linux/of_iommu.h b/include/linux/of_iommu.h index 4fa654e4b5a9..f3d40dd7bb66 100644 --- a/include/linux/of_iommu.h +++ b/include/linux/of_iommu.h @@ -32,8 +32,4 @@ static inline const struct iommu_ops *of_iommu_configure(struct device *dev, #endif /* CONFIG_OF_IOMMU */ -extern struct of_device_id __iommu_of_table; - -#define IOMMU_OF_DECLARE(name, compat) OF_DECLARE_1(iommu, name, compat, NULL) - #endif /* __OF_IOMMU_H */ From patchwork Mon Jul 9 15:41:53 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: 141442 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2813680ljj; Mon, 9 Jul 2018 08:42:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBzY5xe6FJjJoaHDB5skxm1avCBZb2TCko1JVNPKSAkkXiZfFwinxKU4Ji/KCXH3wI5uyu X-Received: by 2002:a17:902:8308:: with SMTP id bd8-v6mr21268929plb.329.1531150939250; Mon, 09 Jul 2018 08:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531150939; cv=none; d=google.com; s=arc-20160816; b=ooz8fHMxLuGr9JVCvC8azylL4Z6dJhiHj7Q0qFWUNd7atBh25INSca1Xgp5R9GHZl3 iLeeakodyhBlqGZIYqMteo3ldWvhtUVq3guVXbboSAQYjz+JWls/7ZPNiBp8zyzNno8A CWKepQ8HJ7ntApxtoWSAbfITtPpDUI6w7HZZtDWUbM3dMLRftZ4+F2WNWqbW11h/qr5Q 2+7SWCxm8D1ceLOnGJ5SAxs4TCjopu0GdQZAkzDFk/D60cuksfFNOKlQNGLC4USjEXTa qmiNIYjlZb4tEeXZm5otgKtv3AbTZJ21bqjtNXMT3ZqsIwhcP7IQ/En0ksd7HyL/o4J7 zU2w== 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=NI/NAiVamX5JscPMOlLTMlvmZPXKGe3fL9XuOVxkFH8=; b=JVQEz3xpKpgU21uV6cV1kpTIwhmLpyEs2mtp9l1iS1yTPH9ExkSqqZuY9PIZZXcxGX PoXF5t/ppcTvk0PVSXoVsvJkM6+O6fN+rKD7MQ61NaqY2ytDBIq4bgZH0iCCuOXbIgf6 8j3AQpBeezXh0koD/W5ByqB7WGNe2oWWYPHPrIaFfPP7KJR8CeJmMKklJYmhKW7mZe7F Xtvin9fOKZf8Q9BSRL1JrGzQPTU+4pgdQmxO5KZI7GwwbQ9zOFg4H4o7+wlVIAHjqUc/ nhVMiDgpsI0Z04t7gTiwnn66EtpUj6fu/4a99e5qYcVb8G8MSYJQC2oQhIiXQ+9JxuKg ml6Q== 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.18; Mon, 09 Jul 2018 08:42:19 -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 S933714AbeGIPmR (ORCPT + 30 others); Mon, 9 Jul 2018 11:42:17 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:45086 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932881AbeGIPmL (ORCPT ); Mon, 9 Jul 2018 11:42:11 -0400 Received: by mail-oi0-f66.google.com with SMTP id q11-v6so11139551oic.12; Mon, 09 Jul 2018 08:42:11 -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=NI/NAiVamX5JscPMOlLTMlvmZPXKGe3fL9XuOVxkFH8=; b=uboHKQ1LE7s7uCE8h8/8F6U1jY6Bd6Gqq1Gn21ZjdIGN1Hxp5dyveyflXqmq3ByDQv VpVc1LwmdGhUKiSSCKZkYCe75FTvrrCq+bZ7VEo7hHvOmrvlr/biM1gOr2XAepQuyKyk GZWiDWy76PZ79LaujCFWPOvPx7v4JNbiAMXgROjGUK0+IrNQKVykHyNGpd56nDUPSp4B MAr5NtwMG0/eu8E39+53WHNSytoMDUyEsS3rmubeioigSmkcJACClzomUY7vrxXD30Q3 u59E2yznh7NHvZK1LHwUU6GCjDgFphelgeXO4X1IyeSJPDg490WEqFWFgl1wG5/NaWM9 CNiQ== X-Gm-Message-State: APt69E3I7Lgcp0ykxSdUkbiZW5JKZmv9sQ1yzMctkGTGDPHBFauqh73/ Pb9eUv+63riGS7dtJBPT/w== X-Received: by 2002:aca:b641:: with SMTP id g62-v6mr26095324oif.71.1531150930783; Mon, 09 Jul 2018 08:42:10 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 08:42:10 -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, Pavel Machek , Len Brown , linux-pm@vger.kernel.org Subject: [PATCH v4 6/6] PM / Domains: Stop deferring probe at the end of initcall Date: Mon, 9 Jul 2018 09:41:53 -0600 Message-Id: <20180709154153.15742-7-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 All PM domain drivers must be built-in (at least those using DT), so there is no point deferring probe after initcalls are done. Continuing to defer probe may prevent booting successfully even if managing PM domains is not required. This can happen if the user failed to enable the driver or if power-domains are added to a platform's DT, but there is not yet a driver (e.g. a new DTB with an old kernel). Call the driver core function driver_deferred_probe_check_init_done() instead of just returning -EPROBE_DEFER to stop deferring probe when initcalls are done. Acked-by: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: Pavel Machek Cc: Len Brown Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Rob Herring --- v4: - Add Rafael's ack v3: - Update to new function name drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 4925af5c4cf0..8c12213875c6 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2253,7 +2253,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, mutex_unlock(&gpd_list_lock); dev_dbg(dev, "%s() failed to find PM domain: %ld\n", __func__, PTR_ERR(pd)); - return -EPROBE_DEFER; + return driver_deferred_probe_check_state(dev); } dev_dbg(dev, "adding to PM domain %s\n", pd->name);