From patchwork Thu May 24 17:50:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136766 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2528452lji; Thu, 24 May 2018 10:52:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3jtwzRNcP+6eSzW8F3E6YUpcrFPDE3nIiokhRC4a8Qf/QXQeDNWCwErh0wlY802QpPSZ9 X-Received: by 2002:a65:5b4d:: with SMTP id y13-v6mr6713684pgr.152.1527184352065; Thu, 24 May 2018 10:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184352; cv=none; d=google.com; s=arc-20160816; b=aYAcC4kVEKpqvaDwbMlquieJ4tDzCqxlese2HauoYltxpVyYsgxiEBuxOm+xnfxZ3F ByPa4KYsLo4JIgLPpwjRevpeGIkJkX9fyZJb1RNpkEjV6sBT56U2dTfEYhg9S2cY3FQG pzW1KSFwhBEBJjAAo0TtUr2xRG/+JqYaBiZaB24aJBeyBnlvy5X2Akc8/lXEATVk2yVw 6vUo89d/yOcDDpr3X9k53vtSF1eWYL2Y5FwI9U5r9Z+pMmBGKSjEGXcJ1VWSnH4y7liD w+UW2iMg5t4fUS8PhMgtSdLG/iXZiiwbL04/lC516tNYJJDyw91Lo/z2TgFTnGliTn2M 0JmA== 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=jSsr5AKyHYUp04OQersuDfpGvb89i0IKuaN1Cyk7ZAE=; b=WIiUwSj0PdvyKxCWrzHosTOsUlI6ncKj+85LkGOrhIiphfEdRGjjOuhI3DTEUFCX0V dyTg5QdQTc7ZFVBsb4ONUHaD87R+HzcWqn9SI3q4N8zT19Pro3H7s0qfLgmDhhfvKNQu HNjDxp20U8QbkNMW8Z3XtLbpxS3g/FNY2vGEHDEC3TODF84ARqAoTSir8gHc5By5CqKz aZrCj5HS3TlGdflM/zxc3ZO9htwOUTe70gOpPmHL9G6fuRG4aMvLfOaH6JQduRimO/Yb WCGtdJqjdoyRaZWr/RYyyfmm6Yz973BO4ZKplkEveuV2vd4f1WTz8xTd93NlsaYQ++ou 6pAA== 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 w4-v6si11141025plp.357.2018.05.24.10.52.31; Thu, 24 May 2018 10:52:32 -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 S1032109AbeEXRw3 (ORCPT + 30 others); Thu, 24 May 2018 13:52:29 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:45527 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031090AbeEXRuc (ORCPT ); Thu, 24 May 2018 13:50:32 -0400 Received: by mail-yw0-f193.google.com with SMTP id m65-v6so836271ywc.12; Thu, 24 May 2018 10:50:32 -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=jSsr5AKyHYUp04OQersuDfpGvb89i0IKuaN1Cyk7ZAE=; b=qDcikGhLFH5YHO9okJcjUoz9tZWA2ME6wTKn+ZqfDkrey+TcwBlmmeAqg0WnyrUjO6 zcXDKwuLbTtp6NLkK8uqp4kqnEQ/BAC4FW7kXTy2Oc0JuPEv4S40Odr98dxXqroKd0hR q3WKvuMgrqF6wNN9nsPX62DPzhi9fNsa06nC4wwXW2a3uWXw15taHY/+asBCEPOSH20P YwVtiPp2IUtQT99cnVqroltrHYcK8zzLHQyMXbdq7BCD9IG/Re3SiQ9LU1zSDYuOI26Q Crb4Aq9OsRs0WoRSkgTAPYkJaIKyOBVtsLIyeg2V2T9Phe85/XVZIegQMU+kuyCGIB8o vKBA== X-Gm-Message-State: ALKqPweZFkq692mxN/P24Rby/2QJpUxr4HM9UrGE4ja3FuAyu236xes7 XU80BtkMJIwkhRxwudVcxA== X-Received: by 2002:a81:274d:: with SMTP id n74-v6mr2187688ywn.370.1527184231472; Thu, 24 May 2018 10:50:31 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:31 -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 v2 1/8] driver core: make deferring probe after init optional Date: Thu, 24 May 2018 12:50:17 -0500 Message-Id: <20180524175024.19874-2-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-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. Subsystems or drivers may opt-in to this behavior by calling driver_deferred_probe_check_init_done() instead of just returning -EPROBE_DEFER. They may use additional information from DT or kernel's config to decide whether to continue to defer probe or not. Cc: Alexander Graf Signed-off-by: Rob Herring --- drivers/base/dd.c | 17 +++++++++++++++++ include/linux/device.h | 2 ++ 2 files changed, 19 insertions(+) -- 2.17.0 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index c9f54089429b..d6034718da6f 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -226,6 +226,16 @@ void device_unblock_probing(void) driver_deferred_probe_trigger(); } +int driver_deferred_probe_check_init_done(struct device *dev, bool optional) +{ + if (optional && initcalls_done) { + dev_WARN(dev, "ignoring dependency for device, assuming no driver"); + return -ENODEV; + } + + return -EPROBE_DEFER; +} + /** * deferred_probe_initcall() - Enable probing of deferred devices * @@ -240,6 +250,13 @@ static int deferred_probe_initcall(void) /* 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); return 0; } late_initcall(deferred_probe_initcall); diff --git a/include/linux/device.h b/include/linux/device.h index 477956990f5e..f3dafd44c285 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -334,6 +334,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_init_done(struct device *dev, bool optional); + /** * struct subsys_interface - interfaces to device functions * @name: name of the device function From patchwork Thu May 24 17:50:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136760 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2526716lji; Thu, 24 May 2018 10:50:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoNyAg1GD44qX96wVnHA+YQnBxJNYALc+51h125XNV165bxkWLfZxpTrEAsfBYNz8bLs1yt X-Received: by 2002:a62:8b92:: with SMTP id e18-v6mr8292580pfl.60.1527184247789; Thu, 24 May 2018 10:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184247; cv=none; d=google.com; s=arc-20160816; b=Ma3OOZ9o/B5Tj4//PzeTs7XXb8MpatXScj3ZDgG7LLFfocSusAUd7YQzx61et0E5Uw +lhjjonDsNg5RT0MEfbea/2gMjiMaQLJjSOR2LIyKxJDeREJUjHjMM3fp5QXIFfMT3Gr n3IzH26VsmQ1XLXao2fxSQjMjbzaxFWrcq/Cl44IHNVeE0W4vos36KfvVx50MJly3HIv 6kac/V5WzX3DXEhOivyVXbu2aLJ7JK48MJD0SJLSiVFakeq0sN2OcUFqvVcdtK96ZjX1 Y15RMtLv68WgWBSGJY+pWHB4aPTYlAHHISxu/91hvKnzh5XXqKtN/tPc/Gh70uFUa6XB rF+g== 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=cS8ROXMSFF5tKvPLVR8o9D6gPGVX5L3DlPWdWmBTbqI=; b=LLwUB7CMT+sjdGRBP2VVaOp7SoP9zLQgK1pQnxcpHDTrogjqtJnSmoHi0Ed1mAQuaG gR5BPg3ctRGqk/drF3e4FWAQjyRyUeqv72LceAZuZOvUGIva8nXMlAp9hE+/42ByBjg3 yODLsVK0mia/u8/eEf4PaA++aOp5zO0jmrQM6bfl1kou6LzslWsaRZ7j8dZa+djfNpKK KTD8eS9rFyomXl2ePlNAb+OMdMmOrdWYlFI1iBAnD21IgYcV/l1qHFPezQ0O1Q0AjcnG fIfkX5LDVrAYpUlHhHwIWV2b7iJhGPWV/rU1N4PYlh/NupixhDNBIqx0DTExa7YtAmpr W0Mg== 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 3-v6si22057197plh.34.2018.05.24.10.50.47; Thu, 24 May 2018 10:50:47 -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 S1031316AbeEXRun (ORCPT + 30 others); Thu, 24 May 2018 13:50:43 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:34623 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031146AbeEXRug (ORCPT ); Thu, 24 May 2018 13:50:36 -0400 Received: by mail-yw0-f195.google.com with SMTP id x27-v6so841624ywj.1; Thu, 24 May 2018 10:50:35 -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=cS8ROXMSFF5tKvPLVR8o9D6gPGVX5L3DlPWdWmBTbqI=; b=aYSqg2bLp77rvmE22X2LlX5jo72WClxdunddZHFYAqjktZuRfcXvWF/2Zla0tWcpcM ar1RpjL1abgx8K4l5ca7yuiD8/u90DxLZd1ixfzNxrVclQjWRoh/am3EfSwwOfJ8MUOa 9OcyCyeBhFWq5E1YclGfbRwbynhsGX90IupTtk7Dlucc12KwdOjAtCnaDzWtLpGGqrbn tC6yZfiMqw9o91OZ5tbzU63FO/F+CA59YBuYya0pxcVpmMLVN/F6FxZawcrLGarux14w hj6Jent0/Pl6deKmZW5DOVD1spOGQjNqrQBYXApBn582F0JA+LWq5PFX1jNjudwEtVJJ zNWw== X-Gm-Message-State: ALKqPwdjpKcs3AaKPtHxdxEuQI+YIXAsSl52IOsnLgQ7tLhueaA+zhX4 e8BavI1H7YH0OubfMKwgSg== X-Received: by 2002:a81:c84a:: with SMTP id k10-v6mr4749922ywl.54.1527184234036; Thu, 24 May 2018 10:50:34 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:33 -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 v2 2/8] driver core: add a deferred probe timeout Date: Thu, 24 May 2018 12:50:18 -0500 Message-Id: <20180524175024.19874-3-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Deferring probe can wait forever on dependencies that may never appear for a variety of reasons. This can be difficult to debug especially if the console has dependencies or userspace fails to boot to a shell. Add a timeout to retry probing without possibly optional dependencies and to dump out the deferred probe pending list after retrying. This mechanism is intended for debug purposes. It 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). Signed-off-by: Rob Herring --- .../admin-guide/kernel-parameters.txt | 7 +++++ drivers/base/dd.c | 28 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 11fc28ecdb6d..dd3f40b34a24 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -809,6 +809,13 @@ Defaults to the default architecture's huge page size if not specified. + deferred_probe_timeout= + [KNL] 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. This option also dumps 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 d6034718da6f..4133b240c7e4 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -226,9 +226,17 @@ void device_unblock_probing(void) driver_deferred_probe_trigger(); } +static int deferred_probe_timeout = -1; +static int __init deferred_probe_timeout_setup(char *str) +{ + deferred_probe_timeout = simple_strtol(str, NULL, 0); + return 1; +} +__setup("deferred_probe_timeout=", deferred_probe_timeout_setup); + int driver_deferred_probe_check_init_done(struct device *dev, bool optional) { - if (optional && initcalls_done) { + if ((optional || !deferred_probe_timeout) && initcalls_done) { dev_WARN(dev, "ignoring dependency for device, assuming no driver"); return -ENODEV; } @@ -236,6 +244,19 @@ int driver_deferred_probe_check_init_done(struct device *dev, bool optional) 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 * @@ -257,6 +278,11 @@ static int deferred_probe_initcall(void) */ 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); From patchwork Thu May 24 17:50:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136759 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2526651lji; Thu, 24 May 2018 10:50:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpl3ZMylOkufpK8+n1VqZJOPHr21VkuDxtZg/xGB+w0giiH3McfhqkgsGohjGAV9t5ExWhj X-Received: by 2002:a65:5a88:: with SMTP id c8-v6mr6783687pgt.115.1527184244390; Thu, 24 May 2018 10:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184244; cv=none; d=google.com; s=arc-20160816; b=jyIiCKmFWwCib4nB+ex+QQuLzda51CogDPzCJImV63xA7JJxq1mhpbq06FCuLav1YZ 6Gsgc/cFHNaODHSKdAV/nypYBgnURgMrELEBA9//NgoFoASdMfpJICPyLWxnDEwdJvFF 5ksKw5rZAJ2RAblCZFozEC9qNRIxpVB7UR//173sU3ms60kQOfXQHesy0mDRIWU/N4pz ZT8a6Z6BFAFOP+o/GucdIbzSr7WRxxTGbv0Zl7MIfs6IBD6NAzjEZo8JHj3PSFyX6Gtm x1BSo30U0RrED3v7V0GA9nzIeFNggo7ZhZyZk+Oadjsq0MQta6EzzeCArmDdTbwdog3C s0hw== 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=CJeYDD9vOqDf9s/qcBXtz1esgVuGo62aEFZUJaijlu0=; b=x/vzFS+BHsZmD9oLmy8hXZPXTcvhqHZzUr2qGPJ/aJNywNArs0onl3srmZPdBaMlia omrU7zu/JTM+EcBFSYV/llEyf6QyL3LN7UT7aWa5t46mhBo5JOV78KuEYCHHDa0Pvsk2 +RkjkRUk8NVse0eTHa25RfRKB2eYmTtN891WPOeDaV9HUDf887EqM5ezOFzeQ4u8g6xy t7CVWD9OlmfWJU1u0XPdDqeAqi8g7/Z8Wo9dd6/9cMNrRwYQfIZ2h5VW5uSZ0W2/FNeM nGkVfYDmF8BiH3QM4NHlJuJIDU8WHUeeJvGTkYjUeHvYWMuOKUBV7ZxLAYhkEf2qaTgR ac6g== 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 a81-v6si20903222pfj.300.2018.05.24.10.50.44; Thu, 24 May 2018 10:50:44 -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 S1031238AbeEXRum (ORCPT + 30 others); Thu, 24 May 2018 13:50:42 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:41479 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031150AbeEXRug (ORCPT ); Thu, 24 May 2018 13:50:36 -0400 Received: by mail-yw0-f195.google.com with SMTP id u71-v6so836443ywf.8; Thu, 24 May 2018 10:50:36 -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=CJeYDD9vOqDf9s/qcBXtz1esgVuGo62aEFZUJaijlu0=; b=hBTh7MVrfUz3CXjtfovOV+4QWgdkBtssVnMsuFGhQNGZx7iRcgawiPni0vjnCGaj2E nIzpVt4zGUZvValrKVMa1mzcyclYe8ie32A36/VyI0iqQR80hKb2aS2c3OJP+CwoGTco iULKIsu18ypU5KwqhKPEmIm4AbM+gA20MX0qbgCHhkppmLbKfqi0X5upmqCTTYL8NMWh /fGGxlcNH8hdJRrhawE72ByEyrz6tjBoF9O5n9+eTOBU36nKwFIJzw84BIvsx53IoafG 3caLOuBj1xpdivtoI/cSKrltmxraYa1iTjhiLK4Okz8X6fcENeipZp/0Slpv9vkUChFg IcoA== X-Gm-Message-State: ALKqPwdDhTdwBACHMUD1wPfRQuFtDPg+CeODQv8ME70BrH34Qu0UX/oB GGxfYCSiKkKGFAridbrOow== X-Received: by 2002:a81:8a04:: with SMTP id a4-v6mr4562159ywg.140.1527184235829; Thu, 24 May 2018 10:50:35 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:35 -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 v2 3/8] dt-bindings: pinctrl: add a 'pinctrl-use-default' property Date: Thu, 24 May 2018 12:50:19 -0500 Message-Id: <20180524175024.19874-4-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-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.0 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 May 24 17:50:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136761 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2526808lji; Thu, 24 May 2018 10:50:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7KDe7GrNXBuASFilQRTNqN7nekjn29QtH5BcmAR79sAHc7yLCHz0lw8jDZaw9j6NJsCG1 X-Received: by 2002:a17:902:b94a:: with SMTP id h10-v6mr8598508pls.321.1527184252540; Thu, 24 May 2018 10:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184252; cv=none; d=google.com; s=arc-20160816; b=skxvO+411n5zW8E9Zglkmggk75OCczuSiWlAMuETD2QpTkB+jAyX89NA0Pc/j5kXZQ awAhaSg5ouQcg6FpiMu3JzPvoIFQwQ01tYYGJ1h6fiaE32i1DONyFXzKheVnN1tmYkmK 4HldPB6/EPE0/OH5HLOA96hdSOpLiQ4Bzccm5SamGEx5I0JxsDae6HOwIeEVq6xSNpGY 51V+GasK8PjN4xgDQPqBxR8/1ES5SCdFg120ut5kVyPmrs3lcqAu0SpSCZTOGXygCYPY ekPXsU787cNIEGA634Qnu/JVER+MNPZMtUCe1athlFFK1FXOd2rN2i4pmCMjbnOWseg3 BqeA== 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=Ku7BFx+Ua5AzPcX/Wra5qA1rX0XBMKdTQF935sVO4bk=; b=i4xhEpIi99NZj9KUdR2GRBFiztq6+/5aYhxAp7C4cQ+K02LK7N2Hpu3vXIHHIch6p2 cM0PHUzGCv3obSGhdTXzkoa9RWAu6vL3C/Xxvfp2SheRhCJCqUslMIrTYMcyc7ZCS+/Z G/eeOhZUkrUp2ePWHAnwM/Shyn35p9x3LYReAQMKb2oemC+N3qyi1TP227TBMyy7NkYb b9DIbG8XGXZL0DyG9pTD19ob2vKxWVAbPHGXotk3uqfjVVIVJsxZf5ArVTtwvlYBm/Yp zUbUvdR6Nxs122zcH4jJQQn6UZfN+vslnr5/Tw3Pj0QJcS4qaPRkxLFSDEEbNaWRkei3 XlgA== 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 3-v6si22057197plh.34.2018.05.24.10.50.52; Thu, 24 May 2018 10:50:52 -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 S1031473AbeEXRuu (ORCPT + 30 others); Thu, 24 May 2018 13:50:50 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:33466 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031152AbeEXRui (ORCPT ); Thu, 24 May 2018 13:50:38 -0400 Received: by mail-yb0-f195.google.com with SMTP id x36-v6so906573ybi.0; Thu, 24 May 2018 10:50:38 -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=Ku7BFx+Ua5AzPcX/Wra5qA1rX0XBMKdTQF935sVO4bk=; b=CjMkE9l6WmSWz+H8ZPlZmq0rAzbsj+H/gZSWDa+2OikhvAbxcuFJ/hTMreBem9p8e9 0yxi5+SST7uOUybjtYs6h8Bdqx9sJNHrcedSicMp77M/BOOLOEsGSfdDrOoN98WuMzPq Ez2aJFdm6BatTGvlrsyDe+vWAshNyHpKlLlyBC0JCaYPeuNtZ0BxpeOn1iHeqpbRXIMy cX9iRsp62JeckpcrFog5oABkNQwtfvUg660qwedKELjmtt3xmiUFj2hn5/DGQyAm+gE8 RZPN68QD+fWjDKLTiH7Kxvq4ADtWESfEoR7bm9dBFvMVKDA4utkLp3YcBBfD3cjGCYY0 bUoQ== X-Gm-Message-State: ALKqPwfbbd9jMrpZpW0CwA21Mx1SlqsllxfJrpNu1cBHPBhMRBcbf98d 492iZfw5pVvBuQlzIjSSjQ== X-Received: by 2002:a25:c591:: with SMTP id v139-v6mr4783248ybe.124.1527184238201; Thu, 24 May 2018 10:50:38 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:37 -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 v2 4/8] arm: dts: bcm283x: mark the UART pin muxing nodes with pinctrl-use-default Date: Thu, 24 May 2018 12:50:20 -0500 Message-Id: <20180524175024.19874-5-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Rob Herring --- arch/arm/boot/dts/bcm283x.dtsi | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.0 diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi index ac00e730f898..c8b8ede3d273 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -321,6 +321,7 @@ }; uart0_gpio14: uart0_gpio14 { + pinctrl-use-default; brcm,pins = <14 15>; brcm,function = ; }; @@ -353,6 +354,7 @@ }; uart1_gpio14: uart1_gpio14 { + pinctrl-use-default; brcm,pins = <14 15>; brcm,function = ; }; From patchwork Thu May 24 17:50:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136765 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2528395lji; Thu, 24 May 2018 10:52:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZockPTrilOjXgSn+IZi44P0oCZhet3GNQQDDOEVZ+Y6BFMLgZYYbxiQL/uJs4P/t2M3vzAK X-Received: by 2002:a62:b03:: with SMTP id t3-v6mr8352788pfi.32.1527184348187; Thu, 24 May 2018 10:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184348; cv=none; d=google.com; s=arc-20160816; b=NQJXcLmYetDBqopnphIZuq5gcRwwG8mwtX24PV8oWF9aGsyiNKNX+Rws9rDPwr8ZJa s4sm8Ki+q8C59w40mBtI+5A5ZAd2QRkvMzJcUJNW2vBZgyK+bP+/RkPOkxvlt+qMxzvc OSwRtJoXpCnqU/8kU7LS9gGA1qm/1kh6cmZ6pd8UOdI/PUMlbs1yYiNmSqSAGeeyB5pu og5HSBqNqSikKpBF9/7/QYXm1jJOWKcTgPtDiA26frxq6RjYhantEdFFK21TgRJyjbFd CLTUmuocakN92Df12PnbWHIjdeomJ1M2+CK27pC7xRPPox6R5ylrdLSVW+c1Dvw0UBXf 2B4w== 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=7YAVxxaB8HDX73lc1ub8E0b43LtMwYpddRc8+ydEaUw=; b=AhRzmAW3ZZZ/RM+xae6y3hpxqBxBNInFDdZl6AJgdpVjUTLQAfIVKQeFOQ6rzxq/IF A6WnR5z35E7NklJt8XMYIPdbawRi0y37OdYRZev3XhNLiUwrERh4b1PMjvH1ci3XRLfv goPKe8Eio+u1cv1hmJEiLMTRLXynawqCTHqutLi/w42rBfGj64hYkwBOSdyZm5LWdqzq ooi5HOOCPA1zBGK9Z+ypyyLgl6lERCihVb9gbIutS0T2bBNmy0HAu0DDH6Rca3qjI8w9 nOOO0MB3Z4xbODR0vRkiUBu+1XKR4A6SnLRmWy/L13ScCjRy9FgmzY2apbDGfpw1ZSNS u2xg== 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 w4-v6si11141025plp.357.2018.05.24.10.52.27; Thu, 24 May 2018 10:52:28 -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 S1032064AbeEXRwZ (ORCPT + 30 others); Thu, 24 May 2018 13:52:25 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:38181 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031168AbeEXRul (ORCPT ); Thu, 24 May 2018 13:50:41 -0400 Received: by mail-yb0-f196.google.com with SMTP id w14-v6so900947ybm.5; Thu, 24 May 2018 10:50:40 -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=7YAVxxaB8HDX73lc1ub8E0b43LtMwYpddRc8+ydEaUw=; b=ORPg76FbNHTqMTRU7fzlitXbCPiJ68kll1KZG2pvxsBqkpVwQupnVemBLJJzPMNexw Sz7upEzYuhj4qZpHqnkB22nqRHUeTEBpbXsULSjHzon4ZfV7H6/yW4uZJmJG9agzkxqo tHAootPzIiltcUTd8v62cFxRu6JkPz9glxDUaNRqya/6HqsBLJLaselP3VMprMqeAIcm kwaNMJJMDYryWHaa5hqpSkJW886Qsz51Ff4tcrw15FUdElu61Y9/GcJSQOQmkFoI0E31 kd7kR6O8IE25tcpzL0yEYrTXsNZZtmTIJCr+Vy6KZC7cW3z971l5XnrY4WouLmAioRNv U+wQ== X-Gm-Message-State: ALKqPwfdWhkd7ALBHE74+Dgi7Ndc02cJmn8VARU+d/XMPf0tq1vRo0Gr tRyp2GltW1XqCsR78ast6Q== X-Received: by 2002:a25:d342:: with SMTP id e63-v6mr4937941ybf.77.1527184240230; Thu, 24 May 2018 10:50:40 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:39 -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 v2 5/8] pinctrl: optionally stop deferring probe at end of initcalls Date: Thu, 24 May 2018 12:50:21 -0500 Message-Id: <20180524175024.19874-6-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the pinctrl node in DT indicates that pin setup is optional and the defaults can be used with the 'pinctrl-use-default', then only defer probe until initcalls are done. This gives platforms the option to work without their pinctrl driver being enabled. Signed-off-by: Rob Herring --- drivers/pinctrl/devicetree.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.17.0 diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index b601039d6c69..74a31074b406 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -110,17 +110,23 @@ static int dt_to_map_one_config(struct pinctrl *p, int ret; struct pinctrl_map *map; unsigned num_maps; + bool pctl_optional = false; /* Find the pin controller containing np_config */ np_pctldev = of_node_get(np_config); for (;;) { + if (!pctl_optional) + pctl_optional = 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_init_done(p->dev, pctl_optional); + if (ret == -EPROBE_DEFER) + /* OK let's just assume this will appear later then */ + dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n", + np_config); + return ret; } /* If we're creating a hog we can use the passed pctldev */ if (pctldev && (np_pctldev == p->dev->of_node)) From patchwork Thu May 24 17:50:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136762 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2526889lji; Thu, 24 May 2018 10:50:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrzCzS9PLKLRmU/uZb7GmILHXoFXp7Hppc3LOtXqnGFlt1NM4Po1O0IPq3l23Wt32Co9P+z X-Received: by 2002:a17:902:9a4c:: with SMTP id x12-v6mr8265891plv.213.1527184256808; Thu, 24 May 2018 10:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184256; cv=none; d=google.com; s=arc-20160816; b=bnY/T8DW5sEewaJ2H2c4fsy+Sy0pOj5aAKinBF0k7k1lF/jdSlSp5mg58E1UlRUUyx k5S2HHcCLwHKCdv8icWSe4Ri51haDg3NzoKwfR4NsuA8aLlq3ICjH3q6n+UXuSNTJJsb UJS73W8Bssl2wpx9A+54ROYvV0901LM18yKIBtgvIleH+ugopwnyT9gSbYV2FfAAeM1F 1hMXVNHcC6imTlIRSSAHHQFtK0XNdXSF9GCcRXhgMe+JjgPXUm3Ac93N20HVs6m4xdOd zk7KtB0xp4aodvs2zNktNV/2PpvzDNVQ+hDdRLTFrHG+1IMYKWBmC4rbiSazCqg7f8Xh eIkA== 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=piRNzbrsqEHUmSlJscEld94O7lqX7YuEJ6Uj1rEmoBo=; b=qpxN4EakE6ESs+8PpAp3u4h/hwcUwZ+jy/aEI63AU3t8CCGeRK7stqPLwW9eO+F3pk Kdc/rjW3ShvY6+kQpHwxSp/1W7DG6INLXBPE8TIBitpnht8eLA5XtHRc8W4/VMGdwvEQ pEDowjiu/9U5NNLkBH+2RhafgQf6f36CIzuUgZCUBOevSD4/dUvivbtFRpSxFhakSgSz uT4+yN4lGFetOgmbFWEq4EkTnrjzygbalQJWSEcJgu1GLTknQF34eaXyE/+6yDeqCHLG vN9eBAiLY3aG/E38alOVJpv2kyMuCCw7wBVdzIOeamadoHmQL2QDQG1zjJJZiOrt22CY Ijhg== 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 g63-v6si22185578pfd.93.2018.05.24.10.50.56; Thu, 24 May 2018 10:50:56 -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 S1031527AbeEXRuy (ORCPT + 30 others); Thu, 24 May 2018 13:50:54 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:38830 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031263AbeEXRun (ORCPT ); Thu, 24 May 2018 13:50:43 -0400 Received: by mail-yw0-f196.google.com with SMTP id y123-v6so839339ywa.5; Thu, 24 May 2018 10:50:43 -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=piRNzbrsqEHUmSlJscEld94O7lqX7YuEJ6Uj1rEmoBo=; b=Azj3ZECftBmTRYTiJu84EHBioUx0phOSHhhuLwSmEzK9suQu4NoXfkvMNF7qGOJz4e An7H9vktoX+ViMTt8i3MEdwtRZk6S4aD/ua6S1eA2nqgp3twscb2P2pixu/Imidjp4TU bAyGtBuUUYPPbf/Ubah7y1KlOwVotjvj9bBMI0vBSoUywgH8FLOiPWPGrfbSUn8SOAOb 7SKkEQmCtRGGjAKBbZyMqjBlGs9RllsqmF8OnyD4KmKigcxScLLpP4tWHYhpWJ7gHhnu Q83ycmdd8Yx+yRAaV45MmIyQM1z3rIY4moBfOUrEwmifHzpGeufauHviBQvDTa8bYuT9 HERw== X-Gm-Message-State: ALKqPwdxWOxE7d68dHOEh4Wfr+OZVNLTD7F1ZpuKHkIyuevPku6NENZl rytu2R8m+B+du8hO+6lYHQ== X-Received: by 2002:a81:3145:: with SMTP id x66-v6mr4251041ywx.355.1527184243054; Thu, 24 May 2018 10:50:43 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:42 -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 Subject: [PATCH v2 6/8] iommu: Stop deferring probe at end of initcalls Date: Thu, 24 May 2018 12:50:22 -0500 Message-Id: <20180524175024.19874-7-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-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. Cc: 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.0 diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 5c36a8b7656a..2aac8387717c 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_init_done(dev, true); return ops->of_xlate(dev, iommu_spec); } From patchwork Thu May 24 17:50:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 136763 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2527446lji; Thu, 24 May 2018 10:51:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq94hhWxua7tI+9lZXZRShBGPx/SXhCYpn5edIo6yIpGKcpqhRzu4mSQudaQthbn8EQS5zg X-Received: by 2002:a17:902:a585:: with SMTP id az5-v6mr8338463plb.79.1527184289919; Thu, 24 May 2018 10:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527184289; cv=none; d=google.com; s=arc-20160816; b=HXE22DAsP+MI/OlRjrm6EigRlISYDh/LFeWYJ2ZEtvGqeBIoPkdb6Io8Do7pTagqlp kKFBEjTZa4HgV87V2C4IlEM0oqIhdhESKn+x0pPx03bYAGMNgZZGNpSZPDsWj+7J6LfA T5RZkdP9+xWL8PIZsTpL3H6i2ou26xKZ0k3BgX3spLarZJWOejrlXKWkrB3HxG2nGfRo YuuE8uLuHizSMtAcJNyxvPIjrnx2l2YNQellljHs125w7fD6cJN7VAAXxZCMifBF4kd9 4bllKEFedLRQ1117i3zs0IC3/6csmzTDSuCtGcmSP0PCJaztJS2mmFmcTs3n9qM/zHlr CSSg== 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=BvRrGxva8JQZfW/TQXjlF4GuHF38rp1PtXOtm01GC9o=; b=iOjIYH0AD/8dqlLjM0x4q8OkMDTEHP7Vg+d/NeBqtT5h20TNC9Px7r9ZykMhbP9ZKt 8B7NkpMwzvO+r1iF3L3IwCQFEY8lroxecGeVpbDvR8Ir4gnlVbBi1pbLcIwVzmboE+lb F1U2nYSpqV/gsverCR+j0MP2vRt4CCgvsRjJfa+Irie5ueDRlsaw5L11zcmcbJWrMMVY T+uWzoFQy1lE3/pw3rjVYB7UIMIYaUJovWqWtf0tWgzMTg5ViMw4soLlzAyQ7InhCSsr UTMm18IIIeHESi6SCEtuwAE9naHFiN9J6sEVOmpMGtNdk2fkNvCHEHNeWYCc86/tXRSJ KOyQ== 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 z12-v6si6252019pgc.134.2018.05.24.10.51.29; Thu, 24 May 2018 10:51:29 -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 S1031912AbeEXRv1 (ORCPT + 30 others); Thu, 24 May 2018 13:51:27 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:37045 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031361AbeEXRut (ORCPT ); Thu, 24 May 2018 13:50:49 -0400 Received: by mail-yb0-f193.google.com with SMTP id i13-v6so904340ybl.4; Thu, 24 May 2018 10:50:49 -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=BvRrGxva8JQZfW/TQXjlF4GuHF38rp1PtXOtm01GC9o=; b=QIWC18boPCigm/R033PrXKgXEXRjYSDudRViRJ42rorTmjbCk5Ou2M9W3b6/xdYYHc 9k1EEfpUcwBriK3YytYrkYP+W2f7GCjlBy+IorSRB+bPw2KLqYrm/1OIcDQwprgHAvm0 vwlTATMKkQM1mtvQS+8zy5DIiID2IAs/lkHOlQhWnH5kOrQionjgX/MhuZJetdZhY6E7 T0Df9hp70ljU20pfxr66DAvpw/WUEcihxOXb/C5w2I7wRn9Kbd5ghI6MPzzF61MYQB6g HcxadywtGdCXN9y9SMZk+MSo91f3FrFzvZYz+flAH7tka1VpY05+nsK+gSVHnbOlVwQ/ RG2Q== X-Gm-Message-State: ALKqPwcWCB1usMigXfswiwqYq5QAVG8d7fBDVY6H3olPF8EDPF8bO1hw DC5oPunQkPyrjFWo52+4BQ== X-Received: by 2002:a25:ba08:: with SMTP id t8-v6mr4883791ybg.468.1527184248995; Thu, 24 May 2018 10:50:48 -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 v73-v6sm9183814ywa.92.2018.05.24.10.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 10:50:48 -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 v2 8/8] PM / Domains: Stop deferring probe at the end of initcall Date: Thu, 24 May 2018 12:50:24 -0500 Message-Id: <20180524175024.19874-9-robh@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524175024.19874-1-robh@kernel.org> References: <20180524175024.19874-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 --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.0 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 1ea0e2502e8e..6398cf786e6a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2218,7 +2218,7 @@ int genpd_dev_pm_attach(struct device *dev) 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_init_done(dev, true); } dev_dbg(dev, "adding to PM domain %s\n", pd->name);