Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp691399pxb; Wed, 13 Jan 2021 13:39:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4WzRMLVkq8hDacz2XK6X97tVpQ6kg3fD155IxQl2m1oNsaL1dkEc5aVoTeGQ4gtQ7ALB9 X-Received: by 2002:a17:906:3101:: with SMTP id 1mr3076185ejx.115.1610573996398; Wed, 13 Jan 2021 13:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610573996; cv=none; d=google.com; s=arc-20160816; b=ZaFgLCaXfg3Ru+LphD9oeQEt0Pbeqbfb3vO6t1fi0Nbfu5pyLKMS2kgIcWDt5QnbYK p6yn/BSXFL8Vkn7c9MWVMZGj/skucq73lRgj0URHh10E5ub74BPlwjcuRbHTiIaW3IHi OhviQjjMawsBIZomQH0GKpq9vL+ZqHF1YC+80y4s/BP21NJHvFgioY1olsKcyYmsDRnt DTQO+cEyd/WB7YE1TUgXAd+P6eIxrGGUDZUkdS4KNiaK4woZY+ecYHm/O8q+BPHjJFQu rIPIK1rB2LDcd17gviaaTv29pi+qYP4bmAEY0ereQmGAvxcLBMsgWRyEtDgex+wmrR8+ BJLA== 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=KYfuGnLwArlinw5s1DodWez2H2suYhTdu1Oid0kJwRY=; b=s1w8NkGivRF2VhrGNVfMX+P5GD+z5n8IXW4IjFCaId265h+MfGzCR9S9vu8gJ/ghqD TiCop9K4W5Dx80SCDOatx2z8ConUV00RxCSBZemZZJ27epCrwMwJPudwD3XtUutcOt9C 7sbPjkcBrUXUL6SCuq1OdsErnD/TdElD2+M7Fg4XOflV+7CaDKpWZckUiDFXbN9ihxhx csR5kbduScpKx27OpYGtlcuS0i1BkS3SEP47u05Puk5hTpVooRaONNCD2dt9hbwAkI/P 1QHtAQLVQzfvzpsPHrSlLjFcgzegFo/WhZkqQNBYC4VhYBX6EiRk4D/gcd3aMKWYCl8B nRGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r3hmvLs9; 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 a89si1629498edf.215.2021.01.13.13.39.32; Wed, 13 Jan 2021 13:39:56 -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=r3hmvLs9; 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 S1729158AbhAMVcZ (ORCPT + 99 others); Wed, 13 Jan 2021 16:32:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729130AbhAMV2I (ORCPT ); Wed, 13 Jan 2021 16:28:08 -0500 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DA28C06179F for ; Wed, 13 Jan 2021 13:27:28 -0800 (PST) Received: by mail-qk1-x729.google.com with SMTP id b64so4162192qkc.12 for ; Wed, 13 Jan 2021 13:27:28 -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=KYfuGnLwArlinw5s1DodWez2H2suYhTdu1Oid0kJwRY=; b=r3hmvLs9ZA7yzltYa5GNNLkPnSiaItyhkoVfhKIlZJz/2W6WbPgNrVP0BKwaMhjzkV Zct5gPPx+smoEIxds+onaBFcJS9w/0Y+IC7kXubLEO23XygggLoD8QeEsUSvcERMpNvN Ndr2HxPuUfsbt/x60f+uRCqxF6K+iSl2PLCFCtbNxPTxIr/H600n1R9pDWwj5dD/zFqk +phsNj/SRxSDFH2qOx5s+jKvYLwaP2zYPUEDW93wZYzM14fCHyORIQSCUqc1kqZeLPKI kQQ/r+utOYaq7vCHtIMxblDxNnkDo+rZlvdc8ekJsiSynF7YavUf3CT6PTW705KbcyKt Ri2g== 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=KYfuGnLwArlinw5s1DodWez2H2suYhTdu1Oid0kJwRY=; b=Dsyjb6ChjWXjuF5iSjhZYktoN/LooYQjVx9c3lQSzBFCqHgEsDTLLnA3qbmyu1Ay86 1JbprxGOFS5h5Wyqy6+oCrjHA+PhDwBDbX02RkLkguHDPhUqa2eYgtc8Cz2ytdY5C3ZK Io54dlH2zSJLryF0ZI0Vo2saurG1vCWSsQx+vG8/4EO0vWBa+q8gZuctTthXRf5jg1tS p76lazZNKxogLyUJxjqRd9KqPEFXuOlCYVajia7yM8Oinz4ro1tYxOIrmYM0F+rGAJo5 NDcRNoM06k/XAwzp0CiVxHJVHZt4XN0EWuqKe8wU0QfIB8vR6q2A/mreD25AwyzQV33Z 20Iw== X-Gm-Message-State: AOAM530u80CaL/GLF+c2ugZOzeR3HjphSX78KSBKN+2iDBj5RnpThzpj rtADXwO11WaISHDl0FcP2E/Or9vA3ZSlYgP7QsBk2Z0GwR1dUaY6 X-Received: by 2002:a25:6604:: with SMTP id a4mr6435438ybc.412.1610573247136; Wed, 13 Jan 2021 13:27:27 -0800 (PST) MIME-Version: 1.0 References: <20201218031703.3053753-1-saravanak@google.com> <56f7d032-ba5a-a8c7-23de-2969d98c527e@nvidia.com> In-Reply-To: <56f7d032-ba5a-a8c7-23de-2969d98c527e@nvidia.com> From: Saravana Kannan Date: Wed, 13 Jan 2021 13:26:51 -0800 Message-ID: Subject: Re: [PATCH v1 0/5] Enable fw_devlink=on by default To: Jon Hunter Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Android Kernel Team , LKML , Jisheng Zhang , Kevin Hilman , John Stultz , Nicolas Saenz Julienne , Marc Zyngier , linux-tegra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021 at 3:30 AM Jon Hunter wrote: > > > On 18/12/2020 03:16, Saravana Kannan wrote: > > As discussed in LPC 2020, cyclic dependencies in firmware that couldn't > > be broken using logic was one of the last remaining reasons > > fw_devlink=on couldn't be set by default. > > > > This series changes fw_devlink so that when a cyclic dependency is found > > in firmware, the links between those devices fallback to permissive mode > > behavior. This way, the rest of the system still benefits from > > fw_devlink, but the ambiguous cases fallback to permissive mode. > > > > 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). > > > One issue we have come across with this is the of_mdio.c driver. On > Tegra194 Jetson Xavier I am seeing the following ... > > boot: logs: [ 4.194791] WARNING KERN WARNING: CPU: 0 PID: 1 at /dvs/git/dirty/git-master_l4t-upstream/kernel/drivers/base/core.c:1189 device_links_driver_bound+0x240/0x260 > boot: logs: [ 4.207683] WARNING KERN Modules linked in: > boot: logs: [ 4.210691] WARNING KERN CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.11.0-rc3-next-20210112-gdf869cab4b35 #1 > boot: logs: [ 4.219221] WARNING KERN Hardware name: NVIDIA Jetson AGX Xavier Developer Kit (DT) > boot: logs: [ 4.225628] WARNING KERN pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--) > boot: logs: [ 4.231542] WARNING KERN pc : device_links_driver_bound+0x240/0x260 > boot: logs: [ 4.236587] WARNING KERN lr : device_links_driver_bound+0xf8/0x260 > boot: logs: [ 4.241560] WARNING KERN sp : ffff800011f4b980 > boot: logs: [ 4.244819] WARNING KERN x29: ffff800011f4b980 x28: ffff00008208a0a0 > boot: logs: [ 4.250051] WARNING KERN x27: ffff00008208a080 x26: 00000000ffffffff > boot: logs: [ 4.255271] WARNING KERN x25: 0000000000000003 x24: ffff800011b99000 > boot: logs: [ 4.260489] WARNING KERN x23: 0000000000000001 x22: ffff800011df14f0 > boot: logs: [ 4.265706] WARNING KERN x21: ffff800011f4b9f8 x20: ffff800011df1000 > boot: logs: [ 4.270934] WARNING KERN x19: ffff00008208a000 x18: 0000000000000005 > boot: logs: [ 4.276166] WARNING KERN x17: 0000000000000007 x16: 0000000000000001 > boot: logs: [ 4.281382] WARNING KERN x15: ffff000080030c90 x14: ffff0000805c9df8 > boot: logs: [ 4.286618] WARNING KERN x13: 0000000000000000 x12: ffff000080030c90 > boot: logs: [ 4.291847] WARNING KERN x11: ffff0000805c9da8 x10: 0000000000000040 > boot: logs: [ 4.297061] WARNING KERN x9 : ffff000080030c98 x8 : 0000000000000000 > boot: logs: [ 4.302291] WARNING KERN x7 : 0000000000000009 x6 : 0000000000000000 > boot: logs: [ 4.307509] WARNING KERN x5 : ffff000080100000 x4 : 0000000000000000 > boot: logs: [ 4.312739] WARNING KERN x3 : ffff800011df1e38 x2 : ffff000080908c10 > boot: logs: [ 4.317956] WARNING KERN x1 : 0000000000000001 x0 : ffff0000809ca400 > boot: logs: [ 4.323183] WARNING KERN Call trace: > boot: logs: [ 4.325593] WARNING KERN device_links_driver_bound+0x240/0x260 > boot: logs: [ 4.330301] WARNING KERN driver_bound+0x70/0xd0 > boot: logs: [ 4.333740] WARNING KERN device_bind_driver+0x50/0x60 > boot: logs: [ 4.337671] WARNING KERN phy_attach_direct+0x258/0x2e0 > boot: logs: [ 4.341718] WARNING KERN phylink_of_phy_connect+0x7c/0x140 > boot: logs: [ 4.346081] WARNING KERN stmmac_open+0xb04/0xc70 > boot: logs: [ 4.349612] WARNING KERN __dev_open+0xe0/0x190 > boot: logs: [ 4.352972] WARNING KERN __dev_change_flags+0x16c/0x1b8 > boot: logs: [ 4.357081] WARNING KERN dev_change_flags+0x20/0x60 > boot: logs: [ 4.360856] WARNING KERN ip_auto_config+0x2a0/0xfe8 > boot: logs: [ 4.364633] WARNING KERN do_one_initcall+0x58/0x1b8 > boot: logs: [ 4.368405] WARNING KERN kernel_init_freeable+0x1ec/0x240 > boot: logs: [ 4.372698] WARNING KERN kernel_init+0x10/0x110 > boot: logs: [ 4.376130] WARNING KERN ret_from_fork+0x10/0x18 > > > So looking at this change does this mean that the of_mdio needs to be > converted to a proper driver? Sorry, there's not enough context in this log for me to tell how this is even related to of_mdio.c. My guess is this is related to network stack directly calling device_bind_driver() and not updating device link state correctly. See what device_links_check_suppliers() does in the normal path. I think I know which warning this is, but can you check your tree and tell me the code you see in drivers/base/core.c:1189 ? Also, can you give me a few more lines above and below this log and also explain why you think this is related to of_mdio.c? Where is the DT file for this board in case I need to look at it? And where is this phy node defined in DT? If there's an easy way to convert it to a proper driver, that's always better than calling into driver core in a piecemeal fashion. > I would have thought that this will be > seen on several platforms. I'm surprised you are seeing this issue only now. I'd have expected it to have happened even without this series. -Saravana