Received: by 10.192.165.148 with SMTP id m20csp3394724imm; Mon, 7 May 2018 11:30:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqgoC2FYoAb4S7aNA352Sd6TD6BIHb1admO5kgshJE9DA76aFcky377H2s2+6UokGUs1AwU X-Received: by 2002:a6b:244f:: with SMTP id k76-v6mr12887642iok.211.1525717816207; Mon, 07 May 2018 11:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525717816; cv=none; d=google.com; s=arc-20160816; b=DL+Tfolarx8XIWOY3GXnBZkgyrqhsQzoYd9aMgdFnxhiMMRR9tNoC5OEB5PoGSK4j7 eK9rUSbWs8vRqew4BdkpPIp6wkt3z9w40nwyIDDZYa4zLJGRfOC9uLNE2UsjKecTxy5D rG8JyEysy0rz9yeOkD39PzAI5cb4l2fdFOfCWOuKMbN0Jn1yK0ZA+A+6UCXwU20AStDu OnF/e6suQNLAwmYbLXs950crOBG2XvWyJryXlwvR9tu2asEvFKWCw1lTbTv3nvDpZcAE 5biYAGUKsy6j93hz/6WJbfwYq4YiSb1dkR1V9n3XBaq1WP1vzYgSFsGEx3eAQUtDiuTQ nxnw== 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:dkim-signature:arc-authentication-results; bh=yq8Ioa23SZN0SBj5CSGWfS1hw39l85DU/HQlRo0UJGo=; b=Pe4gFPOfwk/Tp6c+tsmY74rr+9dfFxtHPIykyWagcwo7pXwX/8MWxBdj2Edh7Eu6Ow LccO7LofE8apuxN0xx03F49y7WLAbr2ffWtNccF1DLQLOIDl4QIMt2Aj6ramW/IB7nVN nRpCmUjAJX2YycZ6nCJv194IyyMOCnKtNyfOGS9MFnG/M00nuf+SaKZ4nAQfluQZQ3Nb NBWS8W6lYuAarzqY7w0w0HxTQ6VxTjm6sqxSVpSFpfXvztpZm//ZsflkyLO+Tffod0/0 A/YRdH+LOQLqrqJVRBZG+AnEgsCyaK4HLbHC6+qlsSfmcWjX7gDcwytPVc1WcO+lF78m fXNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ngbi2Pst; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k68-v6si7718477ite.45.2018.05.07.11.30.01; Mon, 07 May 2018 11:30:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Ngbi2Pst; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbeEGS3q (ORCPT + 99 others); Mon, 7 May 2018 14:29:46 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44903 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbeEGS3o (ORCPT ); Mon, 7 May 2018 14:29:44 -0400 Received: by mail-pl0-f67.google.com with SMTP id e6-v6so278676plt.11 for ; Mon, 07 May 2018 11:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yq8Ioa23SZN0SBj5CSGWfS1hw39l85DU/HQlRo0UJGo=; b=Ngbi2PstEuoV5div9nE9xns98RCEgBQR1mKYQgmm05bSTPiKr+DJ4xuEcsLQMIkY5c b+bAyZ206ekU1bykNZ3T6rIUu/v3gcMci/YkoHtD+O69rX0lQn5Bt+m38j6Bgj6cz6nj btjt614wClSCiE+PhHFO4VLsA539hDjl3AWRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yq8Ioa23SZN0SBj5CSGWfS1hw39l85DU/HQlRo0UJGo=; b=DGY/wtNB2CiVHKb3+cS4pPeJlDj8Zz/x7z5S3K7BR5I2QTMHNtyfCAWVD6G+nTcBXl u1CaTz8O2Zucbd9yP4tcmKfQlIN/hthqxqHGDWlwoXaCJcm0jyc6YHmTS5nQjsENN/+w X1CRE1xQ0qhl5yuG4KA0LINIefzJUZ2Rmc7ys0xopYVO2Xx/hhikkV7f1xDxd5zhRUu7 t5H9dnTMpvSywVni2WvDdMPnZvdUSXlABiQ422wldU0XtrCreL9yUAWQSZc1Z2AeXWXA IWRTswOjGXjkRzjR0TyTLGaXvzTZLkp8TqrcyEoMux8cKv6rsg9jJE33t2Ho2WUFmY+2 eFeA== X-Gm-Message-State: ALQs6tBN34X3R3So1j10KUJJBaAzi+NwIf8XXqvV9PWsxU2LBmd3x2Kj Wwa9HF09isowaY+o8yneN5PumA== X-Received: by 2002:a65:41cb:: with SMTP id b11-v6mr18601753pgq.260.1525717783637; Mon, 07 May 2018 11:29:43 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id p1sm8362291pfp.137.2018.05.07.11.29.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 11:29:42 -0700 (PDT) Date: Mon, 7 May 2018 11:31:06 -0700 From: Bjorn Andersson To: Rob Herring Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , 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: <20180507183106.GF2259@tuxbook-pro> 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> X-TUID: ElwpAdRVJzeN User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 01 May 14:31 PDT 2018, 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. But how do you know if this is the case? > This is often the case with initial platform support until various drivers > get enabled. Can you please name platform that has enough support for Alexander to care about backwards and forwards compatibility but lacks a pinctrl driver. > 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. I agree that there is a chance that you _might_ get some parts of the system working by relying on the boot loader configuration, but misconfiguration issues applies to any other fundamental providers, such as clocks, regulators, power domains and gpios as well. > 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. > As above, this is in no way limited to pinctrl drivers. > 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). > On the Qualcomm platform most drivers are tristate and on most platforms there are size restrictions in the proprietary boot loader preventing us from boot the kernel after switching all these frameworks from tristate to bool (which feels like a more appropriate solution than your hack). > 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. > There are two cases here: 1) DT contains compatibles that isn't supported by the kernel. In this case the associated device will remain in the probe deferral list and user space won't know about the device. 2) DT contains compatibles known to the kernel but has new optional properties that makes things functional or works around hardware bugs. > 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. > Cool, so what about graphics, audio, networking, usb and all the other things that people actually expect when they _use_ a distro? > 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; You forgot the humongous printout here that tells the users that we do not want any bug reports related hardware not working as expected after this point. > + > + return -EPROBE_DEFER; > +} > + I do not agree with the partial benefits of this at the cost of not supporting kernel modules. Regards, Bjorn