Received: by 10.192.165.148 with SMTP id m20csp5300541imm; Wed, 9 May 2018 02:45:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp65k7GN8QCPInIDxznxio5E/YIv7r3Gm5NG7I8q7wN/Dh58rFk5suUdRKGcGbYe6IUtl3R X-Received: by 2002:a63:8bca:: with SMTP id j193-v6mr33708343pge.300.1525859151608; Wed, 09 May 2018 02:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859151; cv=none; d=google.com; s=arc-20160816; b=xRFEveUzWNSmf2HnvE0kgya1VvZnTBKduwZjEqr2h0Hc4OFIeHZ7QK5I5jzZVOE7ZI u2DJbnPhsKYIKCZnozQ6q6rdK0fYoyRcKhvYI//iD7WPzr2g86Ny2u+1mRFabMYu35hl cJBYaDed27TUhuzwoRLx7CAknpA45FuXObEJ2+FTLQ/hN10QCu/iMxBBr1ADM7Ub/ZP2 VoC/pEtrXByMzDIlRj6vsCKJrmmqan7H0zDKWB+aR61fIQOThbVynREGDKWvJtcdpBu/ T7ls0IiUO/f/O6/vjc0v9l3oIP3F6eRdlPkj5ZxLHn81i/vIR0ZtnjUPfS6w3EqwE3is pvMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=MQLez/jkf8e1Mf1KBT5k5tOWoPwPgCei3a+VstPodyU=; b=EmTswAdy9/6MaS7E4tWVi2RaxIKmtu78jzLpgpLT0h5Ins0IMz2Y7gzkFTgocz0zcr Ca2k4pySvQ2kVx002pP4OsIzmRBCpQLcOkL1nr+tGK571+KriRP73lWaUuH4IdCtnSsp GvI+2eyhZeSQHVIEp96NwacmV1PEZHGhFjifwABfqpT5ZSW9tf3PDXL8za3CdXgzYYlc pChXrPHGb0V1W7kvM/MrCK21J54Ohr6l3Bxt3016CR3qHUy87KFaa9xdGLDayUhOU2S6 h2KfeusMEcibxY7R6Nxxck0n4YX5ztUQ14NWBonXoTuxs76+CV2KK/Bh3pBToTKEz1Rw hfnQ== 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 p7-v6si25038198plk.293.2018.05.09.02.45.37; Wed, 09 May 2018 02:45:51 -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 S934266AbeEIJpA (ORCPT + 99 others); Wed, 9 May 2018 05:45:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:38869 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933783AbeEIJo5 (ORCPT ); Wed, 9 May 2018 05:44:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 44286ACDD; Wed, 9 May 2018 09:44:56 +0000 (UTC) Subject: Re: [RFC PATCH] driver core: make deferring probe forever optional To: Bjorn Andersson , 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 References: <20180501213114.20183-1-robh@kernel.org> <20180507183106.GF2259@tuxbook-pro> From: Alexander Graf Message-ID: <91dad272-e07d-2ab6-2afa-538294e9cefa@suse.de> Date: Wed, 9 May 2018 11:44:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180507183106.GF2259@tuxbook-pro> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/07/2018 08:31 PM, Bjorn Andersson wrote: > 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. ZynqMP is one example that immediately comes to my mind. I'm sure there are others too. In general it's very frustrating to debug what goes wrong when you can't even get serial to output anything at all just because there are now pinctrl bindings that your kernel may not know about yet. I've run into that too many times. > >> 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). I don't see how setting them to bool contradicts with the hack? The goal of this patch is to allow systems to load drivers on firmware provided pinctrl setups if there is no matching pinctrl driver in the kernel. > >> 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. The key point is not to regress. Imagine you have firmware 1.0 which works with OS 1.0. Firmware provides the device tree. When you update to firmware to 1.1 you want to make sure OS 1.0 still works. The bug you're referring to that existed before of course still exists. But we're not worse off. > >> 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? Again, it's about regressions. If audio didn't work before, a firmware update may not get you working audio with OS 1.0. But it may enable OS 1.1 to provide audio. Alex