From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 99F9217C72 for ; Fri, 14 Jun 2024 07:01:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718348498; cv=none; b=Gc0pHbBYyJtrYWppwHCjX3bX/bTtz03wGoGB8ZTdQEdkX9c1OJ/DVwn2nd/tXXyh/3+hDH8JXjx0rPVTCTReRLiUQW3uiYtMtXdHohEGOQBuObXcrtLeF4wSHfZzOSfLdb3M0muz/0I7wuK8SSHcHEv8hneFc4FrsygfzsKDHOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718348498; c=relaxed/simple; bh=f+47wVGcuysOXwCj/07vA1XG0M+Mix+78gdu2z03d+8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UsNbz88Oq9Lcchp+70LXfJIUFExQsn/kt05s/1J9nNM9yMFVLIFFIfACI2qnq9PO0Im8yWwZppV9e8MvPtlfLrWId13+ne2p8Ms8j4J/rf9nbpJWE5u8Q/ZnAUDzlXJMU29HkebKSK+Tn7z4CElVBC2dC6voK+WCYJhmk8EwkgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sI0w9-0004Jv-JE; Fri, 14 Jun 2024 09:01:25 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sI0w7-002Cwf-Q0; Fri, 14 Jun 2024 09:01:23 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sI0w7-00ALq4-2I; Fri, 14 Jun 2024 09:01:23 +0200 Date: Fri, 14 Jun 2024 09:01:23 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , stable@vger.kernel.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net v1 2/2] net: phy: dp83tg720: get initial master/slave configuration Message-ID: References: <20240613183034.2407798-1-o.rempel@pengutronix.de> <20240613183034.2407798-2-o.rempel@pengutronix.de> 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 In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Fri, Jun 14, 2024 at 07:21:15AM +0200, Oleksij Rempel wrote: > On Thu, Jun 13, 2024 at 09:33:01PM +0200, Andrew Lunn wrote: > > On Thu, Jun 13, 2024 at 08:30:34PM +0200, Oleksij Rempel wrote: > > > Get initial master/slave configuration, otherwise ethtool > > > wont be able to provide this information until link is > > > established. This makes troubleshooting harder, since wrong > > > role configuration would prevent the link start. > > > > I looked at how genphy_c45_read_status() works. If we have > > phydev->autoneg == AUTONEG_ENABLE then genphy_c45_baset1_read_status() > > is called which sets phydev->master_slave_get. If not AUTONEG_ENABLE > > it calls genphy_c45_read_pma() which ends up calling > > genphy_c45_pma_baset1_read_master_slave(). > > > > So it seems like the .read_status op should be setting master/slave > > each time it is called, and not one time during .config_init. > > > > What do you think? > > Yes, you are right. I verified it: > In case of this driver, .config_init will be executed every time no link > is detected over phy_init_hw() call. If link is detected > genphy_c45_pma_baset1_read_master_slave() is called directly. > It is not directly visible but read_master_slave() will be executed on > every .read_status. Hm.. on other hand. Since the configuration state is readed only on init and reset, we will see on user space side only default state not updated after config_aneg(). -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |