Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2162961pxb; Mon, 18 Jan 2021 09:48:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQEFdetdrAuKsbAKxWQNXIyKfg6Z2ffLQmJmaqjR8EMigMFIqxfx4etND6XsxLfQsORcPr X-Received: by 2002:a50:b586:: with SMTP id a6mr478605ede.206.1610992093933; Mon, 18 Jan 2021 09:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610992093; cv=none; d=google.com; s=arc-20160816; b=zQUCjYFuw9SYB4P8fqozSKl7g1YXLdsWi0+Y1xLy1jkmLp0eRH8XGmv4NFhLxIUvQG gX7KBYJu/Vlcp+6fINrKBRKrFlFHB74OTLMRbotAPYo0wHzpQC3zw+3KhISw7+PSIXHi qw98TbbCoZaF05R92Aoim45jBeSVonM924xO0Hvhqf1rCbiPhzvanJG8U+1n5itb/mSC QKbJr1PeyS9T7dkuTOzBSVOMRWqbDBNuDMu9/loCPpfU+3eO0k1R59glgyGbNGyuAYn+ Ozu5pYf+FLNDfRAuMHfNsedUvczIn2Az4uhRdCuun7bHD46veS9XaYKVldEKo7Ut/WOt D5HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=WshXhzkH2XfopRbzIV2UWEt8m4y4wNSaw59qJ5tNr3s=; b=enKEiMXfqeWkoSHB6/Q5s1klJAaN9y547l3nO4vmODDsjSyt2mYeCRlPa50ax0TBS7 HJPAqciXZCsdwL5enHXlWM1m2oUz0lmDYaZvIP48u98WLOfnO+MZkLHDIGpgupqyQeAF +rE0nnbvE5bGRde1K1XTFQh0wN4+Ylw4SlyPhFkLI//fB+vDz720posxw3yz7ylAJWgw 68/oIzwlV78SscDqyWnePPebql4WU9zs66i5zrxF9uZe51JfduwGoEKaFO0TVkieuhE0 49/K1FuPdl92aNto+fbgr2kbumMIC2kUSAozZ09lasgrXqc9d9gppJpjOML3mE1P+/LU HlXg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si7854701ejs.184.2021.01.18.09.47.51; Mon, 18 Jan 2021 09:48:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407147AbhARRox (ORCPT + 99 others); Mon, 18 Jan 2021 12:44:53 -0500 Received: from mail-ot1-f49.google.com ([209.85.210.49]:41105 "EHLO mail-ot1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436662AbhARRoh (ORCPT ); Mon, 18 Jan 2021 12:44:37 -0500 Received: by mail-ot1-f49.google.com with SMTP id x13so17040518oto.8; Mon, 18 Jan 2021 09:44:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WshXhzkH2XfopRbzIV2UWEt8m4y4wNSaw59qJ5tNr3s=; b=WbGcpXN8RaF1eQdmWJM8Snw6piKSTLoArDTOSKWe1bS7HzMOjxJAx8yKlLPKDG3HBt ScE0eRTdEdU7/8OSoIXJ7dK4eKLGauMOIcQqvqk0W4+P3WvY/iVAHDIFBwNzc/Tuu3zO XBweaNkatyPpGetiH2S6iX8YPNjTWqql7yA4IRGjlwcEwVXdOqVu4okPKkhvqdUS1Rpr tCRvY44SG+DW/48O6lZNHMleczJBqxD2x8vb9mQYYOS8zjzlSEaxK+lGHI50yGZNqXKi urJ0XhSNhZeAlKbxoI3zc8runt9kNWjo2rUHA+7cNWIEAWg2Yt4rqiItGeJRqgprrwLt b1lA== X-Gm-Message-State: AOAM530fgFAOxGSZw56PgUFKbUJU0xVQcwu+1MdXc+dJZZFTB/iVTpUh Tv6noJ65+LaZptDiOWjaxtyReakH0DXgLKJT+cA= X-Received: by 2002:a9d:c01:: with SMTP id 1mr465551otr.107.1610991835791; Mon, 18 Jan 2021 09:43:55 -0800 (PST) MIME-Version: 1.0 References: <20201218031703.3053753-1-saravanak@google.com> <20201218031703.3053753-6-saravanak@google.com> <5484316b-0f27-6c36-9259-5c765bb6b96c@samsung.com> <2556a69b-5da5-bf80-e051-df2d02fbc40f@samsung.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 18 Jan 2021 18:43:44 +0100 Message-ID: Subject: Re: [PATCH v1 5/5] driver core: Set fw_devlink=on by default To: Saravana Kannan Cc: Marek Szyprowski , Greg Kroah-Hartman , "Rafael J. Wysocki" , Android Kernel Team , LKML , Jisheng Zhang , Kevin Hilman , John Stultz , Nicolas Saenz Julienne , Marc Zyngier , Linux Samsung SOC , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Yoshihiro Shimoda , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Wed, Jan 13, 2021 at 3:34 AM Saravana Kannan wrote: > On Mon, Jan 11, 2021 at 11:11 PM Marek Szyprowski > wrote: > > On 11.01.2021 22:47, Saravana Kannan wrote: > > > On Mon, Jan 11, 2021 at 6:18 AM Marek Szyprowski > > > wrote: > > >> On 11.01.2021 12:12, Marek Szyprowski wrote: > > >>> On 18.12.2020 04:17, 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 > > >>> This patch landed recently in linux next-20210111 as commit > > >>> e590474768f1 ("driver core: Set fw_devlink=on by default"). Sadly it > > >>> breaks Exynos IOMMU operation, what causes lots of devices being > > >>> deferred and not probed at all. I've briefly checked and noticed that > > >>> exynos_sysmmu_probe() is never called after this patch. This is really > > >>> strange for me, as the SYSMMU controllers on Exynos platform are > > >>> regular platform devices registered by the OF code. The driver code is > > >>> here: drivers/iommu/exynos-iommu.c, example dts: > > >>> arch/arm/boot/dts/exynos3250.dtsi (compatible = "samsung,exynos-sysmmu"). > > >> Okay, I found the source of this problem. It is caused by Exynos power > > >> domain driver, which is not platform driver yet. I will post a patch, > > >> which converts it to the platform driver. > > > Thanks Marek! Hopefully the debug logs I added were sufficient to > > > figure out the reason. > > > > Frankly, it took me a while to figure out that device core waits for the > > power domain devices. Maybe it would be possible to add some more debug > > messages or hints? Like the reason of the deferred probe in > > /sys/kernel/debug/devices_deferred ? > > There's already a /sys/devices/...//waiting_for_supplier file > that tells you if the device is waiting for a supplier device to be > added. That file goes away once the device probes. If the file has 1, > then it's waiting for the supplier device to be added (like your > case). If it's 0, then the device is just waiting on one of the > existing suppliers to probe. You can find the existing suppliers > through /sys/devices/...//supplier:*/supplier. Also, flip > these dev_dbg() to dev_info() if you need more details about deferred > probing. How are we supposed to check the contents of that file, if the system doesn't even boot into userspace with a ramdisk? All hardware drivers fail to probe. The only thing that works is "earlycon keep_bootcon", and kernel output just stops after a while. Thanks for your suggestions! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds