Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2495556pxb; Mon, 18 Jan 2021 21:10:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRZLgUZ3CCDqTMgDNHViw/FdHkut6bJd0hp2cCm0JvsWFGaew+1eoDbsAnxR8zCHpvZWNl X-Received: by 2002:a17:907:d8b:: with SMTP id go11mr1854444ejc.303.1611033034792; Mon, 18 Jan 2021 21:10:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611033034; cv=none; d=google.com; s=arc-20160816; b=Hj5q2VO1Hcxp2M+xg63EIX77i1sRNGZeKFvB7wPbdXASG+y57CI+vG9A4GDTEJkJIA hurOmkza03EmqYsS49jtYQbnd2VhO+EMMumE1bqkfMwLdJmpG94AAWbVi56EgSZ1ZgVo 3Ci/Z/cXIVQPVq/wfNpEwZXuf9mO7ogKfN2uw6joJiehlhgSZ1NebBdEcCy9oI7A45vi I42hkzVc8/G9EBKoiRA5Mhk5iCaCuciAWj4l/6BdwnwYB0LbDM5c0lTFWoS47CCyrEKL X9y+bf5226pIQXx48GuiSoTNOFJC4pm21+el+Yj8z6QT72pa4qAQKpmGBcr0NUD95rtb HyOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=avb6TU1Ux0K05/HGDWAbvkVy5h2MZ5kLcvVPk2x8SiY=; b=a96O1l8FwbFGse1vNYGe2YPRz81lppJtdsV+BXgczfSZ+U/yobqY1hFx/aVBXlQD9i aDp7k2GYeSmEVe6KsT+1IUa4vdYKruhzGS7UkToF0Y7LGkUaMc/nGX6uiP6gNmHBjzar HVxrl/CQC7+uaphAs7gH2xwX31+cSEjGJBa+0bQMByu4nfcaStduV/9hcRJGkj1kahz+ NgbsUEA+c3iNJluYN/QBx8ptEzZXP20xo+GxrDmjb6TPlN8wATXdLT4CdSRbk1mGoCH1 U2rWE5lf3H5vrCRJW1HYMbxyfMLnOB25xidgZfg3T+ajvwaPR1W7yoZff1ErRCCRoV7E Gmgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si7206397edv.185.2021.01.18.21.10.11; Mon, 18 Jan 2021 21:10:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437563AbhARThK (ORCPT + 99 others); Mon, 18 Jan 2021 14:37:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:46506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437257AbhARTau (ORCPT ); Mon, 18 Jan 2021 14:30:50 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 9698A22252; Mon, 18 Jan 2021 19:30:09 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l1aE3-008abD-Dx; Mon, 18 Jan 2021 19:30:07 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 18 Jan 2021 19:30:02 +0000 From: Marc Zyngier To: Geert Uytterhoeven Cc: Saravana Kannan , Greg Kroah-Hartman , "Rafael J. Wysocki" , Android Kernel Team , Linux Kernel Mailing List , Jisheng Zhang , Kevin Hilman , John Stultz , Nicolas Saenz Julienne , Yoshihiro Shimoda , Linux-Renesas Subject: Re: [PATCH v1 5/5] driver core: Set fw_devlink=on by default In-Reply-To: References: <20201218031703.3053753-1-saravanak@google.com> <20201218031703.3053753-6-saravanak@google.com> <86db7747ea6d48eebbf40a5855240d14@kernel.org> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <9773fac5a4d142684ecc87341ebe0b5d@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: geert@linux-m68k.org, saravanak@google.com, gregkh@linuxfoundation.org, rafael@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org, Jisheng.Zhang@synaptics.com, khilman@baylibre.com, john.stultz@linaro.org, nsaenzjulienne@suse.de, yoshihiro.shimoda.uh@renesas.com, linux-renesas-soc@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-18 19:16, Geert Uytterhoeven wrote: > Hi Marc, > > On Mon, Jan 18, 2021 at 6:59 PM Marc Zyngier wrote: >> On 2021-01-18 17:39, Geert Uytterhoeven wrote: >> > On Fri, Dec 18, 2020 at 4:34 AM Saravana Kannan >> > wrote: >> >> Cyclic dependencies in some firmware was one of the last remaining >> >> reasons fw_devlink=on couldn't be set by default. Now that cyclic >> >> dependencies don't block probing, set fw_devlink=on by default. >> >> >> >> Setting fw_devlink=on by default brings a bunch of benefits >> >> (currently, >> >> only for systems with device tree firmware): >> >> * Significantly cuts down deferred probes. >> >> * Device probe is effectively attempted in graph order. >> >> * Makes it much easier to load drivers as modules without having to >> >> worry about functional dependencies between modules (depmod is still >> >> needed for symbol dependencies). >> >> >> >> If this patch prevents some devices from probing, it's very likely due >> >> to the system having one or more device drivers that "probe"/set up a >> >> device (DT node with compatible property) without creating a struct >> >> device for it. If we hit such cases, the device drivers need to be >> >> fixed so that they populate struct devices and probe them like normal >> >> device drivers so that the driver core is aware of the devices and >> >> their >> >> status. See [1] for an example of such a case. >> >> >> >> [1] - >> >> https://lore.kernel.org/lkml/CAGETcx9PiX==mLxB9PO8Myyk6u2vhPVwTMsA5NkD-ywH5xhusw@mail.gmail.com/ >> >> Signed-off-by: Saravana Kannan >> > >> > Shimoda-san reported that next-20210111 and later fail to boot >> > on Renesas R-Car Gen3 platforms. No output is seen, unless earlycon >> > is enabled. >> > >> > I have bisected this to commit e590474768f1cc04 ("driver core: Set >> > fw_devlink=on by default"). >> >> There is a tentative patch from Saravana here[1], which works around >> some issues on my RK3399 platform, and it'd be interesting to find >> out whether that helps on your system. >> >> Thanks, >> >> M. >> >> [1] >> https://lore.kernel.org/r/20210116011412.3211292-1-saravanak@google.com > > Thanks for the suggestion, but given no devices probe (incl. GPIO > providers), I'm afraid it won't help. [testing] Indeed. > > With the debug prints in device_links_check_suppliers enabled, and > some postprocessing, I get: > > 255 supplier e6180000.system-controller not ready > 9 supplier fe990000.iommu not ready > 9 supplier fe980000.iommu not ready > 6 supplier febd0000.iommu not ready > 6 supplier ec670000.iommu not ready > 3 supplier febe0000.iommu not ready > 3 supplier e7740000.iommu not ready > 3 supplier e6740000.iommu not ready > 3 supplier e65ee000.usb-phy not ready > 3 supplier e6570000.iommu not ready > 3 supplier e6054000.gpio not ready > 3 supplier e6053000.gpio not ready > > As everything is part of a PM Domain, the (lack of the) system > controller > must be the culprit. What's wrong with it? It is registered very early > in > the boot: > > [ 0.142096] rcar_sysc_pd_init:442: of_genpd_add_provider_onecell() > returned 0 Yeah, this looks like the exact same problem. The devlink stuff assumes that because there is a "compatible" property, there will be a driver directly associated with the node containing this property. If any other node has a reference to that first node, the dependency will only get resolved if/when that first node is bound to a driver. Trouble is, there are *tons* of code in the tree that invalidate this heuristic, and for each occurrence of this we get another failure. The patch I referred to papers over it by registering a dummy driver, but that doesn't scale easily... M. -- Jazz is not dead. It just smells funny...