Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp59443pxb; Tue, 12 Jan 2021 20:04:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpPaXWg2WniALrLmp1YfHfYb4cpFtcAR+5XwRRHOe9BcJzfmV5oPxU05uhOmwRHw0erWrA X-Received: by 2002:aa7:c603:: with SMTP id h3mr236289edq.254.1610510666654; Tue, 12 Jan 2021 20:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610510666; cv=none; d=google.com; s=arc-20160816; b=cpk+ULi9Mz0XSC05ciGgNOzLnZOlswlV09IcDW7yxTJW5bKZjkaxcYW4fsnVDcEv7F C65NvCWa6J7RNyJtaAz4/VLYK2BmLCrGpzl7jbAF3e1cBfzOX7ZWPUWthgmRmGeTtrGI mJ858f4kjyxdDvoNVLD6zaI2XXJT1Y7U/wQ3aD6U901jA7y6rEKmb86fZ3LyFqC/cpSt j+2q1m2yDL00KZsqFCigBV2A7pzQMzwc01HkgI0xyanZgpHagDoaXzXhfjqOApgjT/1Q JTuTtjF6xwFUDJv6t10VNVvxKvSZV2gi3x3LXTi5O/T2sLEqlqaoj2IFZV/ODZsGXQi3 bTaw== 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:dkim-signature; bh=4wcVuL2JHWUe2OSC6B91qspF/lz9pUiODDoT4Xqa+iM=; b=hUas7poQJS6JavN/4aTN7Ae3Pi6DDbMhfpsm+BXHEliamiXnaFcaqysBei6q1ndceI thsfMpE6fh9Dm/sVX04wdS5JiGoW3slcAtfI3Z4OacHl5CA2nR4mA7bu0grJxE2H1g7v TvdlBsXn6ds22swEUYULKb4VL01SHVbWXoNjzhikpZSSTfLXBxtOHVwrFPVWOEqxleFo Bi6Xr/m+a8QcWyMHewbLCcctjAOC6EF6I7rmhOARUdM+8I4pfhQ6B+8rpZx4hUM//xiJ WxA+MYxPVtKnarNFSznR31TRIGdvN5fWlye0PZkNquu7AbQN7HVD/ErgS7FZcm0BI7AV OvaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fed1BSmo; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds8si328002ejc.713.2021.01.12.20.04.03; Tue, 12 Jan 2021 20:04:26 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=fed1BSmo; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437829AbhALVeh (ORCPT + 99 others); Tue, 12 Jan 2021 16:34:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437057AbhALUxP (ORCPT ); Tue, 12 Jan 2021 15:53:15 -0500 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E660CC061786 for ; Tue, 12 Jan 2021 12:52:34 -0800 (PST) Received: by mail-yb1-xb2e.google.com with SMTP id b64so27868ybg.7 for ; Tue, 12 Jan 2021 12:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4wcVuL2JHWUe2OSC6B91qspF/lz9pUiODDoT4Xqa+iM=; b=fed1BSmonr4i0CFVaM7ytMeRTJ0XmCOw0lrfX1w8MkrlzJ/jTr3wSOTfPJMC/BhzrG IPiCSToYZw6m67DQ89vmJAIuFJjQcL29aabYVT70HujxJ/GXS3I3EnOqTq0FLIJO2XyT jReE/+Co++NPwvk1Tx3nwfaahWsxyX0yE4wcINKNUMMTjI0DYplMXX6mQfy8qxMB02N2 UfYxXQrmYBacTtXmDzJ3u28CYuDeqJA9rh7cTNw9WFVOmQn5HcJcs90M37kgo3aYAVUP tivk+yniUKXPqRzVoIO5YMtvCSKfaRLqHxyTVfXSKDUpWBwwt90a0WP+803Ic+nXXfca eRVQ== 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=4wcVuL2JHWUe2OSC6B91qspF/lz9pUiODDoT4Xqa+iM=; b=faPOv9W02m50NVVdZOczG/KrWZfPna4D9L39TXngpWwCbxLHtt8Gvlao0sQFG1swOX 6dZLyKDmd8ao6j0sd2CUIknJGkIqib/vBDtG5WOo9HyDxuU5upGGOKlSziO88fhALzIz tqSeFv6voJrb3hKR8Io0rY6bTdqBWPIJnX2E778wosOdi5nN3uGC+MJh00tZNHfav0KD Tv2yD5JYYa8vs5yFx5X9G5fwOCqRxD4pnB+UUq4Dg2yGbdSO9gY2TaPH8O40yOi3gFt/ cZlvkeaxkHlgHDzEaPA1nSGRhxznuCeBZkEVWKY+50ZS9TtJUWfBb9vPGRZMs3u0kuAU i3MQ== X-Gm-Message-State: AOAM530CXoJSo1yS09r8cPs45dUcuiD4iYIBkwrOcJJdOOQY4pzGwuVT XnFIXNQjnYaI38IPxH7D5JnQMVCJhpbpdNQMT2olXw== X-Received: by 2002:a25:b703:: with SMTP id t3mr2191805ybj.96.1610484753991; Tue, 12 Jan 2021 12:52:33 -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: Saravana Kannan Date: Tue, 12 Jan 2021 12:51:58 -0800 Message-ID: Subject: Re: [PATCH v1 5/5] driver core: Set fw_devlink=on by default To: Marek Szyprowski Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. https://lore.kernel.org/lkml/20201218031703.3053753-2-saravanak@google.com/ Hopefully this meets what you are looking for? -Saravana