Received: by 10.192.165.148 with SMTP id m20csp5434094imm; Tue, 1 May 2018 15:09:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/2315i0UhVq0MpSI1XVoi/2XWiEQX+ZtLFNNvnQWIo8BAhFrMXgB0bO0S2wPs4XjdDA0h X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr17513342pld.163.1525212593161; Tue, 01 May 2018 15:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525212593; cv=none; d=google.com; s=arc-20160816; b=BnffltJTz/AWOrRdglOTKeZGX66oMOsEUClccPEdIHRZKS+cds2SwWBSPiUWluUWMz ZfhnPQKp/Kbo3yJNMdv/yH1ftePOPpHJnbcpK/Lnyq4M9xtJxnp114gipvJ9n7wFAGAO 56oM4HocXez3HhWHjyBdOHxkuBLJ+8qLwyi0K76BmYJ3bqJ/9fHd8ocO0Okkk4h3W/I4 ucq22K97Yj0SyyUUj3Y/8M+4d3oAw6uUvQBHiGyQOPd2PUVQijqjIFFmW8lvbHxe1ouk Bu3MwdLkg63cRfRl4AHXZ8xDxDY2w53EQGHNKiC1UQYTRopXynFbXxg7Ay3XG6aKMMFn h33A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=gdXYPbIpGixGMU93hU0QlK2bmiNv7QbZ3C07ibpOP48=; b=oQUvNsgNLQAT6/mFJszewWfWeccXv0xrXWvsiqH8wkoePfM57cbTpfHZQXsrerTrM8 BSVPmayL7QVO8UQ3SFht6Bbr3DxM7ltPT0eclaGAg8ZDTzzEBq+798ap5C5zL2K0N1Ha 6QcAAoMIzbB9U+qYLRKObu4pW4gYU5I0JCDVy1KCO4G0E4WdArlKOvFYFjRvGkdEB9Jc nzgIsCOiXCjTgW/wEc2skI/gmAYWrW5kS5zfitggLdfE9YnHve0Vh1CyyS8tHVJ6TGwI syM4RPpMhbvp4E6C0+xeBF0ueQChyxc5UNVDcNlMaI9t0WU/chHhaEWuHHO7uGHw7jpl P5pg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si10709115pla.365.2018.05.01.15.09.37; Tue, 01 May 2018 15:09:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751055AbeEAWIO (ORCPT + 99 others); Tue, 1 May 2018 18:08:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:48462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbeEAWIN (ORCPT ); Tue, 1 May 2018 18:08:13 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95BAA2368F; Tue, 1 May 2018 22:08:12 +0000 (UTC) Date: Tue, 1 May 2018 15:08:03 -0700 From: Greg Kroah-Hartman To: Rob Herring Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Grant Likely , Linus Walleij , Mark Brown , Stephen Boyd , boot-architecture@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Alexander Graf Subject: Re: [RFC PATCH] driver core: make deferring probe forever optional Message-ID: <20180501220803.GB31900@kroah.com> References: <20180501213114.20183-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180501213114.20183-1-robh@kernel.org> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 01, 2018 at 04:31:14PM -0500, Rob Herring wrote: > 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. > > Unfortunately, this change breaks with modules as we have no way of > knowing when modules are done loading. One possibility is to make this > opt in or out based on compatible strings rather than at a subsystem level. > Ideally this information could be extracted automatically somehow. OTOH, > maybe the lists are pretty small. There's only a handful of subsystems > that can be optional, and then only so many drivers in those that can be > modules (at least for pinctrl, many drivers are built-in only). > > Cc: Alexander Graf > Signed-off-by: Rob Herring > --- > This patch came out of a discussion on the ARM boot-architecture > list[1] about DT forwards and backwards compatibility issues. There are > issues with newer DTs breaking on older, stable kernels. Some of these > are difficult to solve, but cases of optional devices not having > kernel support should be solvable. > > I tested this on a RPi3 B with the pinctrl driver forced off. With this > change, the MMC/SD and UART drivers can function without the pinctrl > driver. > > Rob > > [1] https://lists.linaro.org/pipermail/boot-architecture/2018-April/000466.html > > drivers/base/dd.c | 16 ++++++++++++++++ > drivers/pinctrl/devicetree.c | 2 +- > include/linux/device.h | 2 ++ > 3 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c > index c9f54089429b..5848808b9d7a 100644 > --- a/drivers/base/dd.c > +++ b/drivers/base/dd.c > @@ -226,6 +226,15 @@ void device_unblock_probing(void) > driver_deferred_probe_trigger(); > } > > + > +int driver_deferred_probe_optional(void) > +{ > + if (initcalls_done) > + return -ENODEV; > + > + return -EPROBE_DEFER; > +} The name is ackward for this function, but I can't think of anything better at the moment, sorry. However, the overall idea for this is sane, no objection from me at all for this change. thanks, greg k-h