From patchwork Thu Jun 28 20:43:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 140481 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp29448ljj; Thu, 28 Jun 2018 13:44:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJKFPtwG/f5ktYCMBLScEQlCNEz3vXke3oBpyMFufaZjtPaTN6lx+ncIEnOxDG6xXY+te+2 X-Received: by 2002:a63:a44a:: with SMTP id c10-v6mr9929681pgp.198.1530218697559; Thu, 28 Jun 2018 13:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530218697; cv=none; d=google.com; s=arc-20160816; b=RI7oBE1mk6opeAVBPkpprCHgCeVTMlICILRLq4VhaXVmynz9AfJ435iy/tertIqM25 EmjRKEJ9g30Tpxj+UtjYLI1/5DgZDl77paCfhhsyfpidtkpDKZcIwa0eCOwSnPfwMlVC 9+yelxBxu5vT1NXPF+T4xeNHk2GqtuR3VAVrvcbJB6tUIuf3ByeZpVV/Q5Otvv3I0gPX vc7L3B5aWIIEUzeitZ2cNTx12qW/XGWR8Rr1z1bEXmHYLA2AZ8ZQKiVO9KEBASYc0LOq 0iIExdeEjJ/sEJqDY7ymsGZUFkY9vkDAnBJdEKLSy3IRNxrCRPCMyh2QmM5lzVVSY6oS nhdQ== 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=fW6oItWLNsuCW0xbS9vtuFs98GrEI3esnJPstkmnNyzzJx+7qWco+1hNypDhMOw1FJ BfOv8f1SPt1+VES3jdE89KTXA2ZpkLHs1wUQv5voEaxZaossUy/1N2Ek/QmcyYxHIHzi iFSlD81GNj1NkeL6T9GqCRoXcsyjXIjOx5tfsPy63XflDCrfryXL+/u2LqZwpw2bQyfF Rhxq+JDs4IU25aSKdgDauc4xxUJEu9dXG6nZSpIpqwpMCqGyFjtIsEULw8Yzo50KObze saW8mB9lZ+pd/FcPL3zu6aplTszLOiXmD7AInj+sdkJCBH1nzcwMFM4ol5q2Edni9Uhn qTGQ== 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 o32-v6si7347498pld.440.2018.06.28.13.44.57; Thu, 28 Jun 2018 13:44:57 -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 S966172AbeF1Uo4 (ORCPT + 31 others); Thu, 28 Jun 2018 16:44:56 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:38604 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754803AbeF1Unw (ORCPT ); Thu, 28 Jun 2018 16:43:52 -0400 Received: by mail-yw0-f194.google.com with SMTP id w13-v6so2637605ywa.5; Thu, 28 Jun 2018 13:43:52 -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=WhYEVbBVh3tT3kVArB86yGL0uhOhYNqwNJSnVvog0dwTIae1gsDBZGrEBwrv3B/SHb tPRMoH2OuYBwN9r50GwEP6EOs077Dqgs5sBUt/KTQpjU8ZrVfPIdHXToZoX8e4Kqfm7s eUEeUwWQXFDcrt2dFw52gf5Df+agF7aiCoPb4tKWj2DYueomdR4KuwOaS8E7K3EACm7y rGc/G5cGIGxS/mR6OKE96MaBc0mfHGutV2v8bT3uzutpSR8X8wwnQJdhfJfZ6gortV8J ws5GDSTGAwSaA3aESf7GeBC4q94AM9BDpMm9RqQ0NWUBiTkimm2HDrMqRGbIqbth9dBU qt+A== X-Gm-Message-State: APt69E2k2wc4//OeYvKpjpidgO8BMuNb3yV7Nqv6FOv/5j4xpw6wAquc nagUedqWPQHvdkgH4AuoTw== X-Received: by 2002:a0d:d981:: with SMTP id b123-v6mr1317270ywe.64.1530218632091; Thu, 28 Jun 2018 13:43:52 -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 o7-v6sm427913ywi.32.2018.06.28.13.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:43:51 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, boot-architecture@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/6] dt-bindings: pinctrl: add a 'pinctrl-use-default' property Date: Thu, 28 Jun 2018 14:43:40 -0600 Message-Id: <20180628204344.13973-3-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628204344.13973-1-robh@kernel.org> References: <20180628204344.13973-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 Thu Jun 28 20:43:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 140477 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp28710ljj; Thu, 28 Jun 2018 13:44:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdj3OQMo0w7Ca5tcLrZBN5/2SeLYu7WuGFpHSsW+bnfGQGk7Cwj6iRR00cx2P0UNj854rol X-Received: by 2002:a63:a042:: with SMTP id u2-v6mr9944680pgn.80.1530218641000; Thu, 28 Jun 2018 13:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530218640; cv=none; d=google.com; s=arc-20160816; b=qzx90VEWucgt28YWlPdosN4vWkGC3Zfi1IXPRoLbWR/IBC3E5APK1B28cchiHD2u2w eCYBmI+K3bz85kCdfdFNMetuRb4ob9CT6GEjY/pkwl+vmBUMWguTDiiQKwX8Jkb80FXH ILQJRwnxENfEzTk9lxpmiYQ7vQuYwB1iaupeAC7Awpc7uMfvydb4IRLroYRqcog38SHO A7sUHlRmAosrMTaCQB2pnhTPAY48rg/eFATRLcvXb9/w+Z32W8+sKV29o5smrZVQYf/v GOnfp1yzHVHxWXBBj1VJ+JdV3kifmUd6/6mOiM4kdXtLo2lAQW60sABwOZ4c6fUXrRNP j1Aw== 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=7/gCfwC9TpQBpbvN/SumEqY62ZoUZbnVSDG91crI5Zs=; b=JVJjYIGcyMQVp+cAMpai4zJwU+JYnFsEEQmuri6tRaQKmnIVo6ZGbcO70BYQO0bHsy S3hBkFaTnd3wc6DkTDNSGQij+IrYPjA5U87ezvcxyhLuLJf4d73U8B3mX4w8IEDYuq6O wAySE90oqhQSPQ6Tci96NY2l5fg4cj/43m2bR9LwfDmjvI1Wb4NwuvjDPtNr5/YrWsmM 08bMJAQ20ft74Bf/+QzFjj1pH8bfYp9wDmwabMdxSchHTxhse696H3TGHnnSmUIFiB11 W8MtX9SHO+zhWCZJrzU4Ed2+vuJXEDiwp9puYtadyjlgET58dWmgk/aWPRfqcCIdJ/e+ Gb8Q== 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 m11-v6si5852767pgq.601.2018.06.28.13.44.00; Thu, 28 Jun 2018 13:44:00 -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 S936066AbeF1Un6 (ORCPT + 31 others); Thu, 28 Jun 2018 16:43:58 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:36778 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbeF1Unz (ORCPT ); Thu, 28 Jun 2018 16:43:55 -0400 Received: by mail-yw0-f196.google.com with SMTP id t198-v6so2638621ywc.3; Thu, 28 Jun 2018 13:43:54 -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=7/gCfwC9TpQBpbvN/SumEqY62ZoUZbnVSDG91crI5Zs=; b=HXG5ucJyxAD1h0dXEd8Q/IbGJOCMwtKGakMJlMPokzOd1MqT6f75iyTbpaE2MrTeS0 UCLOgRFP5GeWOtE9E/PLCw04h/t8M6UnNYXwKBOdh01Qf6knvy0q6P0fCm/M9epBMpb5 dAvyHMPYm04NGznH3ZsqSSWkAj6SAJtDCbo6bKI4MyGW7ys3xe4uoWadXH5yvXlZrR+W fUzX1UdDWxCd1ejc9IzvYyPW2JGY3OlUalwbsVMjkD35wbfbmVufzqAAlqUb1qyjzD4X 2ELsOOCyqNKVEnf96L1/IjWZ43Ox4evJ82Ah9p4XR9he51Qdk3cojWpZLNKpYqWXNCQy eRxg== X-Gm-Message-State: APt69E04LmyUh3RXopeIZoxVwwUs+bxocIr6U+fJbndlTvK9qHdepxia 7XN16DUWLsY4fvLP4kXBBQ== X-Received: by 2002:a81:6846:: with SMTP id d67-v6mr5994393ywc.386.1530218634460; Thu, 28 Jun 2018 13:43:54 -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 o7-v6sm427913ywi.32.2018.06.28.13.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:43:53 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, boot-architecture@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/6] pinctrl: Support stopping deferred probe after initcalls Date: Thu, 28 Jun 2018 14:43:41 -0600 Message-Id: <20180628204344.13973-4-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628204344.13973-1-robh@kernel.org> References: <20180628204344.13973-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. Signed-off-by: Rob Herring --- 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. Linus, I reworked this a bit, so didn't add your ack. 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 Thu Jun 28 20:43:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 140480 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp29302ljj; Thu, 28 Jun 2018 13:44:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfJVBhwaZ67x53QVWwDi5CPG8Gq4FZvw3qODeG85AyNu5EOPPvQ0l5gPH/H7u4UG1FkfWw X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr12186855pla.287.1530218685047; Thu, 28 Jun 2018 13:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530218685; cv=none; d=google.com; s=arc-20160816; b=Lw3s5naA6oSJxu62rCv5Ytt1lnUBw1yK1yg4sY9w0rp49CzDxF7mCth/ZU246bC+3J joNUmfR5+9CDauNoFCjblOSgHs43Y3x5mprJCRE37D5DubCqQ7VZcGFlKdeBcg23LpyK qoeAQ1UKs0vAJL1XzNxo04g/B9zZHobM3fExScrpI5PR/xUH2BZRMcd+p2LUutqHZiA8 yW7RuEEz3XViH5aIz/7yl/+II3tXp5ZLl5A3X/tFTl9GOjunqLeAHBV7RbPNNRJXxR7H bftEWXVnjjnxwZYpiPYJv1qLqsgoLVXs3f21WCVFDqRoHWIkyqQw5YRVF3Yau0W7+eVq 8F0g== 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=BYYywmjJp5embejeIhk/VCtDXRH+EcxILfGn2mhUR6c=; b=QRuB2ARCPhc4xWtNVTJ9IfeOrpQq3ZLclX+4xZiDbFi14lpjZcnvKaPRSonGQG2vNf 40osULNH1DnZdofIH6ROwpEUvDwFU/t/Dxnt14KERnJiu2/FzH0fr55uBkOqWQwMA70B eUTZfYqyF43KU0R1OvOiiBfhal2sJxpYFBcqnGCNUBFmXjfFzwNOCEFds2XB7x6IwvKU rcYD1Le78s7BVmdB8CDJoY8/HXE+eOnw3kpMRtI9GDkhbGM5z/S3pL22KXFPuCLSN4BX CtO0FJmOSW6rxsYXj4FUtQ2Yaab1QGAYFBYG+xddrDpwIZLpcGUw/uVAnKwv7O/woUFd /ZWQ== 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 o32-v6si7347498pld.440.2018.06.28.13.44.44; Thu, 28 Jun 2018 13:44: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 S936079AbeF1Uol (ORCPT + 31 others); Thu, 28 Jun 2018 16:44:41 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:38001 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754882AbeF1Un5 (ORCPT ); Thu, 28 Jun 2018 16:43:57 -0400 Received: by mail-yb0-f195.google.com with SMTP id f12-v6so2534100ybp.5; Thu, 28 Jun 2018 13:43:57 -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=BYYywmjJp5embejeIhk/VCtDXRH+EcxILfGn2mhUR6c=; b=E7mrKQng8nfrPI6QYbHVaMEIHHiB6fieiNXdyXzTVHxzO2ml+MOGsnMoMfchDhrNC/ PA9U4eW6xwk+knjmhbhX4esOIVOHyC19YK8Is/vvgWvTrSQI+ApPRTJovq0JMBNelosG E91MJFhYywsxICMjWW/x5qF4J+9AiyWCy3Z5V5yWKDtFu9f/xRvx6umtDvT93WQhNMuq o3Dt3hk42TszWIL2rrsqNVvrGt/AZLtfVnJCPyWfWzJs2DpZwQ5GW5SPbrm0x5iJbh4W kCigvTmG913CZro8tvGKn7eGUhWmzzKRXddX2cjlRufac7GVs9jQ0+6o3mk1O4vRrb7v V85w== X-Gm-Message-State: APt69E3zrbnZzT0rk8dCHzi8Nk5wwUuep82aq0I8F5XRZ1Q2OLUx5NWB bHuFsS50Wl6kWHV+s0w/jA== X-Received: by 2002:a25:2d43:: with SMTP id s3-v6mr5985146ybe.108.1530218636717; Thu, 28 Jun 2018 13:43:56 -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 o7-v6sm427913ywi.32.2018.06.28.13.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:43:56 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand Cc: 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 v3 4/6] iommu: Stop deferring probe at end of initcalls Date: Thu, 28 Jun 2018 14:43:42 -0600 Message-Id: <20180628204344.13973-5-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628204344.13973-1-robh@kernel.org> References: <20180628204344.13973-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 --- v3: - Update to new function name 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 Thu Jun 28 20:43:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 140478 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp28801ljj; Thu, 28 Jun 2018 13:44:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7jV8PXQ+s0L69hiZWDtl8E1CfdxWHrNw1+2mwMhL97BcFckYj4VNu8rvjE5hGZXUsGHcS X-Received: by 2002:a63:a902:: with SMTP id u2-v6mr9976539pge.67.1530218647427; Thu, 28 Jun 2018 13:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530218647; cv=none; d=google.com; s=arc-20160816; b=PcrqpAh3tuY+PKLFIXV+YSv9XGD8PInXeEqbfrrdqaMNwVGZJ6X9TEnDGsQ5CVCF4W i0shvcUZz7yu0E7M8CWGhc5jeihxK6KYp3N9WJioqBCTA8p1yCNM9EVeMwag+0RZIocm dALzrRunDlJucIdJ7wAf/gq4Wh+IDspHR0hggLn8tLRAshbIRfw4bLHktWqYCBMrATo0 EECK6QRcRB3DtWTqGhKBN3BNUUN1Hhwck21fvCltnR0+2tHM9XQdYGPFkLYpYl+aEIrO 8G+1hGDuFftZfvUMBndqpUgNryWgKBQdmxe9sIRnknvfoGNWOBK9CGl3b38dkVk6xsv8 XcDQ== 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=TvhgMc1vG+h7jxLUFvueOcNWWAd/bqD3DtXmxL/ZB5Y=; b=jdhg9KnVc+kYVWPWk81SoLsRq4MCU3svYcZ79XMLF41tWhTRBAHjbxaI7qJAcrN1CX XXYNgMRAk4POP364YMQ4/ZfRvJBGsWQisGyJYDaSbk+fW72wDf/d3wr7YsFyCgXjOawe ajt2CMTHIKSt5nHKR7LbdrDPrxUh2GnmmzQpFFXpk0kvMLkakThPLGhWipJzt+AwQsOv khJjxc9SvaNAU63zj4Oq0KMeVh1iIBAx2XgoPVhzdfqeARHK+AokaP/UpOxG3Yd28Un5 DqhNmjyiY68C1cN+zAd4D67oEdyWrNB3RvMnmGkKJGuyt8vJqna2wap2Tlcy05XGhVnb qmBw== 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 d191-v6si6673653pga.192.2018.06.28.13.44.07; Thu, 28 Jun 2018 13:44: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 S966108AbeF1UoG (ORCPT + 31 others); Thu, 28 Jun 2018 16:44:06 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:45692 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbeF1UoA (ORCPT ); Thu, 28 Jun 2018 16:44:00 -0400 Received: by mail-yb0-f195.google.com with SMTP id h127-v6so2525143ybg.12; Thu, 28 Jun 2018 13:44: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=TvhgMc1vG+h7jxLUFvueOcNWWAd/bqD3DtXmxL/ZB5Y=; b=CJoe87XzMu9VOrOq1oUJWY2hz9HzTYYMAASXn8U4+02z4C3t/9vCwPkV9/JFqaYuhw zRU93zy5oUQ+yft3wBhJ9o19AgnYbbsiOirVW0fOUZezWeTlI2zAkcfv5/PikudXTDFH EQtLTOghwTtaAaNsFyduMXbAs+6c3wG6DdH9tguZvhyj/iL+MZlpWeSW9h7RY084W88P OoVBsJ4a968kF6H4z6Sjc0cQKbX6ifwDsuVvjqtpczF7hgqTf+otBo0lUwuZWshNcJr+ bluXgrupZAHqBuiPM5X1GZA/9nfgexlFn5JLJWh4SrHkEdRpDp2b78EHbGldn0d0nyaT HWCw== X-Gm-Message-State: APt69E1M6qROCoWFjz1xqtc0FdX3G/QGvfz4qAQq7+fFeo+Rky8d9Hkj v1MK+OhB1QVtSdHkh7gFpQ== X-Received: by 2002:a25:5684:: with SMTP id k126-v6mr6121898ybb.170.1530218639710; Thu, 28 Jun 2018 13:43:59 -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 o7-v6sm427913ywi.32.2018.06.28.13.43.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:43:58 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand Cc: 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 v3 5/6] iommu: Remove IOMMU_OF_DECLARE Date: Thu, 28 Jun 2018 14:43:43 -0600 Message-Id: <20180628204344.13973-6-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628204344.13973-1-robh@kernel.org> References: <20180628204344.13973-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 --- v3: - Also remove linker sections from vmlinux.lds.h 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 Thu Jun 28 20:43:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 140479 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp28995ljj; Thu, 28 Jun 2018 13:44:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIH7+8tVuZVR1M+Sy9eNlSV+95JsBoHkiIjiKrZR2gtC1UUf3k4tj01Z8I+Ja4Z+ZsRqG+K X-Received: by 2002:a65:4b0f:: with SMTP id r15-v6mr10271062pgq.103.1530218663499; Thu, 28 Jun 2018 13:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530218663; cv=none; d=google.com; s=arc-20160816; b=RXjrgj0nEfyIC12SUYmErvI1Zyh/fRcFECN8htYyCugIFejjK157lGpZqRyGeT32mv BuaBEYUwL3oZbZ9m6csoufgXknmQBbsfofoVk/qQa5DcIl329ncFOnCET33eE58srTRV i5OntLIPRJgtuCCoHxfGiTaLuMK58AjIebJdhYVEgSlexuyaXwAmml9NWLh7MHM3JGMy vZcVjh+WTZ0eZH4HwT1CeFnOPyXJFsnQQo9Ll/9+rxu+i39E4xxggM7YcQ0sdjYRWl8s QoNOcZlSBoC8WDU9sWeRqS063BFPJ6JTmR1FSafE4k9zm0/OMPsOVwyo4BRDOqgXrDHH z/ew== 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=7ea/NpiLT+Qun81NMw+9SpKXGfmMaznin7WyFr0FNcM=; b=fl9X4mBFmAUhjRutseCeMmUI6sWrdyKnWCW6VmOAAU8aG1u2DeA7thU/LOnZPLvdO0 KOtTXsDikuUyZRHmD2kA/Ki8t/7WD+M3LP1a9Bq8oAGcZJcSvnof3cGfKhzKKbGKiaQE eaI1CeRDdIYhthF7zSrgCgckM4SsvQyQK0qpIpC7qhAmcggiZYcvjTPiLJwjxSJcypBC 1vcfYi2PUZPikHpgPwPMKGoIfus/eoCCd92ZJ1xSYXtYmnEqu14X5gdV0zzE3Sj8LDpe 3D4t43xYrqA15/gwofCgWCwDd9gw2fDRmNS01lv6UpnGVZEuzzjaaTEdd4bhjdvq7o3D 7JZw== 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 x3-v6si7606959plb.478.2018.06.28.13.44.23; Thu, 28 Jun 2018 13:44:23 -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 S1754956AbeF1UoV (ORCPT + 31 others); Thu, 28 Jun 2018 16:44:21 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:33859 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936067AbeF1UoC (ORCPT ); Thu, 28 Jun 2018 16:44:02 -0400 Received: by mail-yw0-f193.google.com with SMTP id n187-v6so2645494ywd.1; Thu, 28 Jun 2018 13:44: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=7ea/NpiLT+Qun81NMw+9SpKXGfmMaznin7WyFr0FNcM=; b=fw9UnT/oIrOSIYaa86uTbrnuZ6jmB7IJTYPpS30G2dQO4159Cwe+aB3HemjYRlduiz MHnwu61CjbOBDbjbBrZrAkIH8uTGXAD2jPSBTADBGgsE5F487TT1s4Yuu5v3xL6+pOwS pVu0LZIq+1N7+QMnzH0yWTqISXhp6JW+piUBBMEhkToBsTtYc1yDVNxGzWmgLubJMLEB jdvu3vJ4a2ytzARFoeB5g76q4uVQWMNJIREQQ25naPKvEINyzhhH+UoLS4S15PGFTB1r TOymzbhCHLFcGiKrPvCKkGgrs+GLPu4li369IF6q/W/lXlg1ggnJCty+PZ37nwtFsfNq Jx6g== X-Gm-Message-State: APt69E04ZhENeaxFCDEsSNpE5M6+Rbb5YJ8ntSW57PUtWVbl7yv2NOS8 C7CiYvqrkU/5XZFRD1C7K6Svam0= X-Received: by 2002:a81:4d41:: with SMTP id a62-v6mr1844020ywb.343.1530218642003; Thu, 28 Jun 2018 13:44: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 o7-v6sm427913ywi.32.2018.06.28.13.43.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:44:01 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman , Linus Walleij , Alexander Graf , Bjorn Andersson , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Joerg Roedel , Robin Murphy , Mark Brown , Frank Rowand Cc: 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 v3 6/6] PM / Domains: Stop deferring probe at the end of initcall Date: Thu, 28 Jun 2018 14:43:44 -0600 Message-Id: <20180628204344.13973-7-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628204344.13973-1-robh@kernel.org> References: <20180628204344.13973-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. Cc: "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 --- 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);