From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B709EC432BE for ; Wed, 1 Sep 2021 02:37:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C84761090 for ; Wed, 1 Sep 2021 02:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241687AbhIACin (ORCPT ); Tue, 31 Aug 2021 22:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241626AbhIACim (ORCPT ); Tue, 31 Aug 2021 22:38:42 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F5E1C061760 for ; Tue, 31 Aug 2021 19:37:46 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id e131so2278512ybb.7 for ; Tue, 31 Aug 2021 19:37:46 -0700 (PDT) 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=0opF/kr0ejNwsbqFLuijHFAHYYE8veDJxbbCiW1Xdvk=; b=ZnRT7KinbU5mx6PR+Tr0/wUycD7EyhO81kA4J8P/0p0LmW9RFfAM6W7tivTV8QbjZW wr6Bb7Yq2EpJ7ybbQfGE8qMfehVRs1cL04zCdfFKXNxM8GTn+ILA40IpZVcoINUAZD3F yL7VpS/WEJzHJzdDONndAS/V0Nx+pWc0tzL4n3GmFipfjdefCWra88HGs9KnxCCYEMjq GHJa1YLnUJhSbQLakI5kEfsRJBolmLPJDz37l2iFguB6QGvYOXVQQuTrwVMRUQbUrfHi yX5B/vQUyY85yWMXLOE5GwdRqzO4FtwNlHGylGzEvhWhRy3NQykzcFu8S02WM2ZZjTJ1 HovA== 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=0opF/kr0ejNwsbqFLuijHFAHYYE8veDJxbbCiW1Xdvk=; b=p1wOHt1nXq1au8pBiKJ9fSuMYjYNOOiPZaDdMp/RgM9OrbeYsdxRyYJk9ubTZBl+PK j+mJQYu+Qu91iDXm3AoheS99UHy+A4/Lpb4Bh1MRE7bv/i2psvNfVeRzkInq4AxAs29c ds1n+QlHZCKjUxDQMd5l5Plqm2E5s/tztA5o5wvTe2Fs2q+fKywmYI9S9f7W+kJvTKTI VZ/dxZUevlHra7Xl/H2e0klHzKID6piNMpnNpmirk8zqPyemSBgJD17/H/kTG8f/ZkM2 TxgXe20RFVR8krPlVOe/Koa/szWvtDNQuIbaLOb0LBoZ7+Utd3JCGPbOBaV1VKbMB05B O1aA== X-Gm-Message-State: AOAM532GK5u9pvu3xIYYX1iMvGyspv8aw3BJ4AS0HD5NhMwDWTgOHaq6 /8zqNLrX8L3bF0nn0coFgR/ASadsolbLNG6fQSgC/g== X-Google-Smtp-Source: ABdhPJwFHQtr3OtEiZ8Z+LO0gsZha7a26K9bGuUqiTulJwfuwnyVxhZiQG1Km4vGapVVc+8KG4gfMnZ76wf7jggIzAA= X-Received: by 2002:a5b:50b:: with SMTP id o11mr34819958ybp.466.1630463865509; Tue, 31 Aug 2021 19:37:45 -0700 (PDT) MIME-Version: 1.0 References: <20210818021717.3268255-1-saravanak@google.com> <0a2c4106-7f48-2bb5-048e-8c001a7c3fda@samsung.com> <427ce8cd-977b-03ae-2020-f5ddc7439390@samsung.com> In-Reply-To: From: Saravana Kannan Date: Tue, 31 Aug 2021 19:37:09 -0700 Message-ID: Subject: Re: [PATCH v2] of: property: fw_devlink: Add support for "phy-handle" property To: Marek Szyprowski Cc: Rob Herring , Frank Rowand , Andrew Lunn , netdev@vger.kernel.org, kernel-team@android.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , linux-amlogic@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Aug 24, 2021 at 12:31 AM Saravana Kannan wrote: > > On Tue, Aug 24, 2021 at 12:03 AM Marek Szyprowski > wrote: > > > > Hi, > > > > On 23.08.2021 20:22, Saravana Kannan wrote: > > > On Mon, Aug 23, 2021 at 5:08 AM Marek Szyprowski > > > wrote: > > >> On 18.08.2021 04:17, Saravana Kannan wrote: > > >>> Allows tracking dependencies between Ethernet PHYs and their consumers. > > >>> > > >>> Cc: Andrew Lunn > > >>> Cc: netdev@vger.kernel.org > > >>> Signed-off-by: Saravana Kannan > > >> This patch landed recently in linux-next as commit cf4b94c8530d ("of: > > >> property: fw_devlink: Add support for "phy-handle" property"). It breaks > > >> ethernet operation on my Amlogic-based ARM64 boards: Odroid C4 > > >> (arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts) and N2 > > >> (meson-g12b-odroid-n2.dts) as well as Khadas VIM3/VIM3l > > >> (meson-g12b-a311d-khadas-vim3.dts and meson-sm1-khadas-vim3l.dts). > > >> > > >> In case of OdroidC4 I see the following entries in the > > >> /sys/kernel/debug/devices_deferred: > > >> > > >> ff64c000.mdio-multiplexer > > >> ff3f0000.ethernet > > >> > > >> Let me know if there is anything I can check to help debugging this issue. > > > I'm fairly certain you are hitting this issue because the PHY device > > > doesn't have a compatible property. And so the device link dependency > > > is propagated up to the mdio bus. But busses as suppliers aren't good > > > because busses never "probe". > > > > > > PHY seems to be one of those cases where it's okay to have the > > > compatible property but also okay to not have it. You can confirm my > > > theory by checking for the list of suppliers under > > > ff64c000.mdio-multiplexer. You'd see mdio@0 (ext_mdio) and if you look > > > at the "status" file under the folder it should be "dormant". If you > > > add a compatible property that fits the formats a PHY node can have, > > > that should also fix your issue (not the solution though). > > > > Where should I look for the mentioned device links 'status' file? > > > > # find /sys -name ff64c000.mdio-multiplexer > > /sys/devices/platform/soc/ff600000.bus/ff64c000.mdio-multiplexer > > /sys/bus/platform/devices/ff64c000.mdio-multiplexer > > > > # ls -l /sys/devices/platform/soc/ff600000.bus/ff64c000.mdio-multiplexer > > total 0 > > This is the folder I wanted you to check. > > > lrwxrwxrwx 1 root root 0 Jan 1 00:04 > > consumer:platform:ff3f0000.ethernet -> > > ../../../../virtual/devlink/platform:ff64c000.mdio-multiplexer--platform:ff3f0000.ethernet > > But I should have asked to look for the consumer list and not the > supplier list. In any case, we can see that the ethernet is marked as > the consumer of the mdio-multiplexer instead of the PHY device. So my > hunch seems to be right. > > > -rw-r--r-- 1 root root 4096 Jan 1 00:04 driver_override > > -r--r--r-- 1 root root 4096 Jan 1 00:04 modalias > > lrwxrwxrwx 1 root root 0 Jan 1 00:04 of_node -> > > ../../../../../firmware/devicetree/base/soc/bus@ff600000/mdio-multiplexer@4c000 > > drwxr-xr-x 2 root root 0 Jan 1 00:02 power > > lrwxrwxrwx 1 root root 0 Jan 1 00:04 subsystem -> > > ../../../../../bus/platform > > lrwxrwxrwx 1 root root 0 Jan 1 00:04 > > supplier:platform:ff63c000.system-controller:clock-controller -> > > ../../../../virtual/devlink/platform:ff63c000.system-controller:clock-controller--platform:ff64c000.mdio-multiplexer > > -rw-r--r-- 1 root root 4096 Jan 1 00:04 uevent > > -r--r--r-- 1 root root 4096 Jan 1 00:04 waiting_for_supplier > > > > # cat > > /sys/devices/platform/soc/ff600000.bus/ff64c000.mdio-multiplexer/waiting_for_supplier > > 0 > > > > I'm also not sure what compatible string should I add there. > > It should have been added to external_phy: ethernet-phy@0. But don't > worry about it (because you need to use a specific format for the > compatible string). > Marek, Can you give this a shot? https://lore.kernel.org/lkml/20210831224510.703253-1-saravanak@google.com/ This is not the main fix for the case you brought up, but it should fix your issue as a side effect of fixing another issue. The main fix for your issue would be to teach fw_devlink that phy-handle always points to the actual DT node that'll become a device even if it doesn't have a compatible property. I'll send that out later. -Saravana