Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp625609lqs; Fri, 14 Jun 2024 00:01:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdSXUkIToqPSIS4RFJZdSiB1UkXAxbMCcdbEF+E7+T2tUThnlpeLmd95FLxFHIlTtrZacWezEceH58BoSRS/DaE5xlSzAYZWU2vNa05A== X-Google-Smtp-Source: AGHT+IFtPsiPdjvVZDWS33AMSIkVBl9mxco2ArC2efUmSEca23AhNAt0VRE5ZWDy+DGz4nIA9q6L X-Received: by 2002:a50:f610:0:b0:57a:2538:7b67 with SMTP id 4fb4d7f45d1cf-57cbd652a4bmr1902701a12.3.1718348503863; Fri, 14 Jun 2024 00:01:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718348503; cv=pass; d=google.com; s=arc-20160816; b=nyc0S+LMWOOE6w6Jruc/qSXSM243OTJ5gLF6XgN+3Ds6TotKaxHYzofECMeprux8f0 H3L0lfeyd1vNg+toVsr5ro1MzC5+h8l/hGL6VBGl59ObKL+ae5TbY0Mh5gcxJfId+jY/ aGySN6ZhcxS9EaOLdQzDVwM2qa5XRKb8FcsfUSteVanxY/V5FXqo1XJsBZ0JFPahjSIg GC48aZcG3m+ERV6oZkrS7PdxLkITau74IBTsSk+vMcbEWFEwUyod4vgZOlDnWOThVvJL GW43WgseEnm/1G17QoMVfKooOquoiltubRZAFizx+PVPHmZcUDNkA4lkYa8Qk5vpFYvg mdFg== ARC-Message-Signature: i=2; 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; bh=+EcrZhR2mHz/dKucdO7eBjk53qYu6GgYRFhR4oymQes=; fh=URXd+bRBpEDyJaXuPDKr/Xh/yzZj5Rx/sILGoo3d8lg=; b=eBrNiY1x5BOAtarnCOC4LJrgGN34vamXfxJV/zz3qql5CHmC5LtXkDm9edDF4vN1PQ u2dp+ZhWjl4xTNQnqCd/E2Rw1u8J2aY3PYOUOolJbEofWktVhxa84mqEEnsVu2pLkdvP ZprcwTvY9FFHXA5auuB/TOum1AJRchy8tO82QwPno0iA4i2wEbB7Msbe/yUmHP7eQPZH Imd87hwm746oVz08V4HE7IL42tFdyexm0B48mtB9+jC9vhKBDGCJKEwy+BeuOMj4Vb+R x5wqZrpYpwGppr5M2ZTT3Yx2P/s+A/rcWX3QKdE9gJYvRrHj/YkH+xClLdYwUi2V+3ML nVEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-214417-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214417-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb72d602csi1539353a12.8.2024.06.14.00.01.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 00:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214417-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; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-214417-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214417-linux.lists.archive=gmail.com@vger.kernel.org" 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 89DA31F2262E for ; Fri, 14 Jun 2024 07:01:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 131D01487E1; Fri, 14 Jun 2024 07:01:39 +0000 (UTC) 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 |