Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp591771lqs; Thu, 13 Jun 2024 22:21:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKOu3cgKy8h4p5d68RHfq6FtgKqjMUz4OVy4T7S9xyrA+fJ+9J/H/HqxuGb8onVylD3Q75QzZJMtmsGvdANETT5NkgThJ6F1kABgB2aw== X-Google-Smtp-Source: AGHT+IED/JcIzurdqHpVjWfO6OsqaAzWRWb0F/eu5/uMBjWCV+/clIAXNZTySir2jUqiMfUVrz3Z X-Received: by 2002:a05:6808:308d:b0:3d2:275b:15a with SMTP id 5614622812f47-3d24e8afa40mr1567030b6e.10.1718342513175; Thu, 13 Jun 2024 22:21:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718342513; cv=pass; d=google.com; s=arc-20160816; b=s/lqw/pI8MEvr38nlQTpdVjafMckJVsd4CCTufWVLV6ggAVGK4JXjmvYJqiilJCjcl MMqaZu55wz96/44GUJ5BN3OGMc9iqclIfvYSimDyB2xzTWOowiclPb9/A+vkgBvoOmwA ivad49pICethZZI3rt21QFl9zNkXn7h3q4rkfgYwRx0hcgCX+YHLGmQenKzZMCvoR3ii ctZE4Wt0KfhQrMaGvSiM8eHZyDuOCIX+zLUnJxSt6m5vFOYIu17pgpcv/ZPrZSnM98YT kyydYZd+NCWYnW6kmhA3/cGf/DM9YP9kXm6Z22s2jkGqcnv5crjnbNcEn4spfltXh3p0 4TeQ== 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=TJXSECvDQrC1qWZ8CSB6RDNy/HfKWhww45fdBbwiqgo=; fh=URXd+bRBpEDyJaXuPDKr/Xh/yzZj5Rx/sILGoo3d8lg=; b=rlDyczbSpGjdNeUo/r+elNc78yiYRspzpGQRW+Ea5WDdaANZJbvwLin5/whPZ75odl ESC70/syCpiQYfKM5oxXvO70J3qAt4BcTRRKyNhDJWruKudmpaYIKn6z1x/R5WK/X6Ez cpZFWIDBwRuocFQtBj+GkxSgKEjxiGavJfYwhL2Iqr9n+69FSRIR4Tyfe1LeM+WZZsq8 qYMnWGSiY5nVRMaYHtDSMYQ3B9THioBZBoypHMm8N+zXCBAgy+bV+jiYxrCZSbzT0DXt QqRarmscii21pkAm2OeVrUifSmp86ZwzCi4famOOiDp/+pSt4WVYO6cEpQ9k2pkLM68f +R7A==; 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-214362-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214362-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccba2764si2873587b3a.354.2024.06.13.22.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 22:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214362-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-214362-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214362-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C6FFB281A4F for ; Fri, 14 Jun 2024 05:21:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFECA146D6B; Fri, 14 Jun 2024 05:21:44 +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 C775026ADE for ; Fri, 14 Jun 2024 05:21:41 +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=1718342504; cv=none; b=f5gCzHCZ3rjC4rOedkQLqKCYzm8Sd1351RGdAdvBvF4VwhQoejUL74m4Afd5Jbp3qKzmHkrJ8AFDqNiAFAoIdagP4Yi6t7sLm4Q1qIaEEyT3653IWOUfhOq+ed+8jt1+iQW8CJLA/uoTDhK2nQHYBB6xH+mJ8I1CB3j9YZ8/vLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718342504; c=relaxed/simple; bh=fKO/5zkOVclOdvCQkxPk3POF8YxQHXOsRIKmY0snq5s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qUpDRF647KlMwTmnY2BVOWkdfUHswP0NDH1/sIkIGGSSv1suTu8nDBsT8yX6et063Kxp4uPmPAGDq0Es+wM0YeeyTkCMcbyQRuwujP4+yxjeqlmL8+XlKP6XzCJL0hjQiejLDLbiDln1CvKXi6IiL01grblbHdAMaAMx8cLN3SY= 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 1sHzNF-0007H8-Tv; Fri, 14 Jun 2024 07:21:17 +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 1sHzND-002C5W-ON; Fri, 14 Jun 2024 07:21:15 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sHzND-00AKed-29; Fri, 14 Jun 2024 07:21:15 +0200 Date: Fri, 14 Jun 2024 07:21:15 +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 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. -- 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 |