Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1250064lqa; Mon, 29 Apr 2024 02:59:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuqlm8wbSBEDZJflZBxIPPXhB6z1DM+sKDg4CAZRILtzYwoF4n6D7oq6Dj0PgUJ3OS9pfLdakLBIkVSW9IDoB6ddHVtAVr9FQFZMYB9g== X-Google-Smtp-Source: AGHT+IG8c7U09NCVE2/HtvfMuOiBO+Y+QiqVTQN8cqRZ9NB5EU/9DnlZn+LcVBnXI+m+lBNZouN5 X-Received: by 2002:a50:d65c:0:b0:572:7b08:d497 with SMTP id c28-20020a50d65c000000b005727b08d497mr2864883edj.17.1714384778771; Mon, 29 Apr 2024 02:59:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714384778; cv=pass; d=google.com; s=arc-20160816; b=YHo+f0ISkCQMODa3UKByywlVHQUGjRUR1s7Gy/YzgRnpBf2E3k8dNijGeR1t1LBVuR 7zKJyapH1k/GtXNSOFekIYjqySSQb0a7NT2H+E+YQTL5w7wHj8nm/hmUyYNXFvl6TKpA 5/AL6k08HAt/lM47oe11W5BwUhaNL8yJGAsxW3VDokt+k4RYLSugDZ5jh71MsCB0vYpR cEI/13DDe/IkQsnvFKA/x9wPAqyX+af/qsOVWeCPB7smrr3IPKDy0trG3ff2F9nNaS8y HzxizexU58Ljq99JKzkYzjW69uhEEnGYTAMSvRgSiaLsKdisptYG5nIKj5AZK6a+aNtr +cbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QE951D5l0qilZ1o07jWbnkqCMRoquuXb8OIu85XME+o=; fh=Z1ua2ET6dVoXCcC4EgL0/Khu09DMr8y0eDK0BAVWn/E=; b=JgoefValqkf0JEwspZNTE1ZpbUpoUYgbDfUJl4/Ddhm+/pEkx8Htx5/4+mkVYhhNpQ zuDxSYjmlXksgtETNDL+baYqySL+fmo4G97XV4W7A1N9Dd62Z5mcX5KrJ0Tq4RlgEgxN qe3SXQhUTmFkXiYhnp8kjIUjIZ09MFxT9xvplRMxI9S9lExwOtWao4Cf+5srDHYBsKc3 Yh6f9PBYWoadNpAiT/SUhQkpRlvUJhaYwbq278GN8RV1CWFX78zL7BWLdZ30f6oqkOIF 7Ss+rnxDlbym458DUt/sg1AJlYhqYuFaSNDDe8V22+1YJ07rCPWjDBoNYGXN9V4eQ311 AaBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=p5EYPf74; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-162010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o13-20020a509b0d000000b00572244e6e4dsi7610641edi.480.2024.04.29.02.59.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 02:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=p5EYPf74; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-162010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 772A21F222D3 for ; Mon, 29 Apr 2024 09:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB8432C68A; Mon, 29 Apr 2024 09:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="p5EYPf74" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 940B328DB7; Mon, 29 Apr 2024 09:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714384768; cv=none; b=EnhyFwaSfrhHw/U2nHCv3axMM4jxYC5WfSbrysYlJzhKY1Fngp7TTYgXLwrc9ViWOpgY8IybVMHhz6V3ImPWjcYWUM7LsvWSNBYkgJsPZ8m9GUJ8Dai/Q7h6H4IOweXtVSCIw280FmvE9QyR9o+RYU+cPbqagqAteEPRQQ7GOHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714384768; c=relaxed/simple; bh=Bg5LgVVCLyCGDSs7jt8knuEqjx+2qSWUIhIO0QMZ4jU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H1MKHX0XRXlVA5SGIa3u4/Vfsz2Am/JlkSYbbq3gh2fK7td4QcMUi1uig7eDb6rLFVMDXICevxXZiSC9b7tRzUFRmp9L+u6Mn4YmKLoqi1/g+SlMeduZ2VZEdsBj1CtBzzy3WW6doFBiMpVzksihm7BMeFaDgRa4mIUNxfkOspA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=p5EYPf74; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QE951D5l0qilZ1o07jWbnkqCMRoquuXb8OIu85XME+o=; b=p5EYPf74YgHv7kaeBx9L4VBEF+ U2XaPUgsI9DOvLi94YdpzE0PrgDBkECABKoxA5Me/SCplKBpJ6C9B5vznmACi4V5DbWG14ny4IoCa nrZs9qPBV004sFNc4N5TjhtGghTiIlrOLevPRWVpKxdg3bpmmtKMxxb30ba/Yxngda0V9OEQh+CoT i6mKk8in0zO/IrMBo9sFkRwpyg+2QPcPwXt+q8ZHd41ee8eFR7lyDSFFGRUz68m7OVJDnfLXmv6VY /x6m257IwvUwIgdKIcuaf77m07ujtdz3F2UUhvn73lRL5tvS6eXJKDxihnAYJcutNA05ctShVOnie e6ZMjGOA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:38050) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s1Nmn-0002wf-2K; Mon, 29 Apr 2024 10:59:01 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1s1Nmi-0000kp-VR; Mon, 29 Apr 2024 10:58:57 +0100 Date: Mon, 29 Apr 2024 10:58:56 +0100 From: "Russell King (Oracle)" To: arinc.unal@arinc9.com Cc: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next] net: dsa: mt7530: detect PHY muxing when PHY is defined on switch MDIO bus Message-ID: References: <20240429-b4-for-netnext-mt7530-use-switch-mdio-bus-for-phy-muxing-v1-1-1f775983e155@arinc9.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240429-b4-for-netnext-mt7530-use-switch-mdio-bus-for-phy-muxing-v1-1-1f775983e155@arinc9.com> Sender: Russell King (Oracle) On Mon, Apr 29, 2024 at 12:46:43PM +0300, Arınç ÜNAL via B4 Relay wrote: > From: Arınç ÜNAL > > Currently, the MT7530 DSA subdriver configures the MT7530 switch to provide > direct access to switch PHYs, meaning, the switch PHYs listen on the MDIO > bus the switch listens on. The PHY muxing feature makes use of this. > > This is problematic as the PHY may be probed before the switch is > initialised, in which case attaching the PHY will fail. > > Since commit 91374ba537bd ("net: dsa: mt7530: support OF-based registration > of switch MDIO bus"), we can describe the switch PHYs on the MDIO bus of > the switch on the device tree. Extend the check to detect PHY muxing when > the PHY is defined on the MDIO bus of the switch on the device tree. > > When the PHY is described this way, the switch will be initialised first, > then the switch MDIO bus will be registered. Only after these steps, the > PHY will be probed. Looking at the commit description and the patch, I'm not sure whether you really mean "probed" or whether you mean "attached". PHY drivers will bind to PHY devices when they are detected on the MDIO bus (either by scanning or instantiating firmware description) and the devices are registered. As each device is registered, the drivers for the bus type are scanned and any matches will have their probe function called. This happens outside of any control of the DSA driver if the DSA device is on the same MDIO bus. This is separate from the process of looking up a PHY and attaching the PHY. So, I think there is probably a terminology issue with the patch description. I suspect you don't mean "probing" as in phy_probe() being called. Looking at the code, it looks like the driver is making decisions based on how PHYs are connected to the ethernet MACs in the device tree, and you're making decisions based on that. I wouldn't call that "probing" a PHY. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!