Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2905204rdb; Tue, 26 Dec 2023 08:50:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhZicErv5HTJeeLkHbxu6wRw+EARrGn5LdH0oj3/5mZ34kbHoE+m3eOiA2JiQqQqwiWV73 X-Received: by 2002:a05:6214:20a6:b0:67c:ae8:add0 with SMTP id 6-20020a05621420a600b0067c0ae8add0mr10925132qvd.69.1703609420743; Tue, 26 Dec 2023 08:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703609420; cv=none; d=google.com; s=arc-20160816; b=ahVJXTOXK6c4P36IM7P9AQUWu25DgnU4JwVNP9M9lyqyPw38mQYGBu2r7PC68BZAXP d2S4ZzhOLAgOVc4RAhL1XLrOLRzuIe/mLEEgDGlYyFIR+Y7oekzbwA9+pHn8ALtHKOBs OyrwdrpIYGGPtpkf3mpLQBp8g+UFi6YJzOIu19QS6/khX+QoacrUUPKdxV5X/mmLcVq1 3MjOe2B8YXuFUoOlvliz2BAs1B67ZMU5Vb3mQv3D37+RWzfSflRWo+GUwCkORWkwgAtW hkV5J5vTx7Dsq6s7U0DjYzlNK8AW8fQqi+zfOEgnYvqlu4TU9vUHKhct1VzQPFKiECJd 9Feg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PvHe/a/YIlDPbdV9IQijzEnnceejPuf4FbyuqmV0tac=; fh=+uKtAzeq/CAT8OOsgEJY96D8rn5PEokhgz92J6SmYok=; b=epdntI8cksl67RLzz8+k7w/HCVP73W2kL0ocZhLruRZAWKIiDMk4Wi2k+kNlwJ3e66 2F3JD1qLvrq5xcr3ojFQ9vaedBjiewDT0exFLw4S1AXeJW8deazEwPrzNoyO2atRtluN kaE0hNko2KhhDz6hgbeDhSjjn4BaFm2y+2MQeQx0oORK2HOlnF5kuIVNcBHdMXuBhgeG HDzAIcKh4r0SoP8pZER5C5BOMzGezqYKngX9+6KhNVFmz1GhtilmWIAm4MRohdvD5PaJ NB/OSw2+dzMFtKGsimxT0WPWwAfBdN0k8alpgWDF0mnku6UvH1o5NkPtUmbRAU0YoyX8 Irtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5gGxoLAA; spf=pass (google.com: domain of linux-kernel+bounces-11584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n19-20020a0cdc93000000b0067f9fd8e2afsi8809275qvk.376.2023.12.26.08.50.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 08:50:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5gGxoLAA; spf=pass (google.com: domain of linux-kernel+bounces-11584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7B3CB1C203C0 for ; Tue, 26 Dec 2023 16:50:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDF8A4F88F; Tue, 26 Dec 2023 16:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="5gGxoLAA" X-Original-To: linux-kernel@vger.kernel.org Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E7F74F885; Tue, 26 Dec 2023 16:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=PvHe/a/YIlDPbdV9IQijzEnnceejPuf4FbyuqmV0tac=; b=5gGxoLAACjK/8qVzAl1USxjjLg lmSrQP35WDsJBenObM+sC/o8Ss7o+qutgAC/EkuD/sQ+dmDSXlRiccUjTItTyUgpgT/Buu80JaWmT V7eCAqlgSVd/QnlNxO+56lPPSGIHRZtJaMXOUWoDHse8VxZM5/5mx76DuL6MBAdE2aMo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rIAcu-003mcG-Hk; Tue, 26 Dec 2023 17:49:56 +0100 Date: Tue, 26 Dec 2023 17:49:56 +0100 From: Andrew Lunn To: Vladimir Oltean Cc: Jagan Teki , Heiner Kallweit , "Andrew F. Davis" , Florian Fainelli , linux-kernel , netdev@vger.kernel.org, Michael Nazzareno Trimarchi , Ioana Ciornei , Shawn Guo , linux-arm-kernel , Fabio Estevam Subject: Re: PHY issue with SJA1105Q/DP84849I Design Message-ID: <5ec0c324-b07a-4001-b495-f34bfdd8ffe0@lunn.ch> References: <20231222145100.sfcuux7ayxtxgogo@skbuf> <20231226153055.4yihsmu6kiak6hkf@skbuf> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231226153055.4yihsmu6kiak6hkf@skbuf> > Ok. The WARN_ON() is saying that the DSA user port's phy_start() found > the attached PHY already in the RUNNING state. As if there was already > someone else driving it. > > That "someone else" seems to be the FEC driver from the log above, which > for some reason has connected to the DP83849I by itself, and phylink/phylib > hasn't denied the second attempt to connect to the same PHY for some > reason. > > If you look at fec_enet_mii_probe(), I see it has 2 code paths, one for > when fep->phy_node (defined as the "phy-handle" reference) is non-NULL, > and one for when it is NULL. What you're missing is a fixed-link > specifier in the device tree for FEC, otherwise it tries to call > phy_connect() to some random MDIO address on the bus and that breaks > things in some way which I don't understand. At has an open coded phy_find_first(), or something similar. The FEC is a bit of a mess in this respect, but it is hard to fix because of backwards compatibility. > The code which should have prevented this from happening is in > phy_attach_direct(): > > if (phydev->attached_dev) { > dev_err(&dev->dev, "PHY already attached\n"); > err = -EBUSY; > goto error; > } Yes, that is odd. Andrew