Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp341254lqs; Thu, 13 Jun 2024 11:31:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXN5G+L1RXxEy368TIjXbqlfujLs8O76ITWEEYzXJvh+oO7kPp6g83j6Gdjt4oS8Edy0plTh02X/yzkwJq+lmMICjKpq/r1aOm0LkkC6A== X-Google-Smtp-Source: AGHT+IFHp6Aq1ui3GgGnVLT7lIZdlxfPKtrjHQ7V1voUYnF1OB2/pbHV63wDUmWqKU4j94un0YE7 X-Received: by 2002:a05:620a:410b:b0:795:5ca2:3742 with SMTP id af79cd13be357-798d243333fmr36200585a.34.1718303468167; Thu, 13 Jun 2024 11:31:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718303468; cv=pass; d=google.com; s=arc-20160816; b=h3aJ3ONxRULBk8lCNPrSKlrvWv6SmZMwTg6nkNDiAzbqND60rwSpwF3fiwvazsBG5c Httd81LJHnwFloEM3E6hN8uVXq7h8KVicwx01npznLKcZa9teRPe0BByS+QE0HoVQE6U T9Q3WsA7Fo9ksDgEnF2OC1IUF39szj6QrUDGFsKMxBfFcDZ3LcmfZF9q3NEiHxd8XZVt zgq71muU1EJr9ASP4QAp0OHNxp7JlP0kP+QEBnxZokceD0lyiCWrMHipFzMXqGJEMa6a NhZpTSLFHBzTPSsR1VDUh6sReN3aCJVSmhAkGZZCYTkBWarJBmj5emyjXjYJ7xCXSYUd VD5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=f1OUDvuCpkPyNK/ScINXPyimi1LefnL6Ce3jfnrSdHI=; fh=YzGQXgDDYOrmT3D+MtJsLExG9bjBeDrQYFUUj3HIigI=; b=hliIqKUDFPAAbv4UrKFef175P0PNJrbBltVXav+T/U2XooIaI5xgNr6leyugn7auvZ iZErZwYYmr/+46Lb0v7Rdt7t/uoTUNv9TuErnYdp8Zl7ZYTDZ5tgA0ziD9EbVT06Z1gf uJ0wo0bh4blLzsqalaoS9Asj/QBEe4EBfXDXQupQAEW6dREc80IA6qy0cW2b6aUckTHQ 2LspS9lZBdbsqUSM9ilsn/X7HrEE05XE0z+v9gRtMkfOU7OX6wOl2n9+a/Sqyctthpwb ogqIqDTNrc1l+fehPDF1PSXR4r0oicMc2x9g7pIZiAXem4RQsaWRyfA2LTcv+uhmhB+Q OdBg==; 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-213830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213830-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798ab9f9a8asi192823885a.355.2024.06.13.11.31.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 11:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-213830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213830-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C77C51C232E9 for ; Thu, 13 Jun 2024 18:31:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56DE114B95B; Thu, 13 Jun 2024 18:30:59 +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 5E585149C6A for ; Thu, 13 Jun 2024 18:30:57 +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=1718303458; cv=none; b=aNaXd+javdxks3puLdH3ApqPTneMIJ34Gp84ZvysJC8K+qowPzrqYesKf3gXQ4A/7CjZrNqg9D9vP6jj2T7FOBlyASimF5IdTiuocXigvnxm9t8s6V8dYdmqAfGtdUV/Vwwq0mi5SaFQq5y+19VwBolJob0BoB0WU0sCdgOhFxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718303458; c=relaxed/simple; bh=0e+G3kQB6Uq5qxJSceMPJhaKZk0F5S/1gS0TWqkhT+Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SmMDHm24Mf6DJFYqhFzan6tnbEgmGbLfEKOQDczPSgTNxHVi0fyWsZR5I+V98DIslTVncvGLIUBBK77A8iVdOEcWBZW+eVnFD2AGU1G3gUY2nRftvRxXa9QJN1EZ1Q3fig4vYL/Bmxy8fP6nk20f/1+ag/PSeFJytc0w8Xt2o3Y= 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 1sHpDZ-0003UW-7p; Thu, 13 Jun 2024 20:30:37 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.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 1sHpDX-0025Xk-UN; Thu, 13 Jun 2024 20:30:35 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sHpDX-00A6Nx-2p; Thu, 13 Jun 2024 20:30:35 +0200 From: Oleksij Rempel To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Oleksij Rempel , stable@vger.kernel.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net v1 2/2] net: phy: dp83tg720: get initial master/slave configuration Date: Thu, 13 Jun 2024 20:30:34 +0200 Message-Id: <20240613183034.2407798-2-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240613183034.2407798-1-o.rempel@pengutronix.de> References: <20240613183034.2407798-1-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-Transfer-Encoding: 8bit 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 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. Fixes: cb80ee2f9bee1 ("net: phy: Add support for the DP83TG720S Ethernet PHY") Cc: stable@vger.kernel.org Signed-off-by: Oleksij Rempel --- drivers/net/phy/dp83tg720.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/dp83tg720.c b/drivers/net/phy/dp83tg720.c index 1186dfc70fb3c..84256827a03bf 100644 --- a/drivers/net/phy/dp83tg720.c +++ b/drivers/net/phy/dp83tg720.c @@ -168,8 +168,12 @@ static int dp83tg720_config_init(struct phy_device *phydev) /* In case the PHY is bootstrapped in managed mode, we need to * wake it. */ - return phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3, - DP83TG720S_LPS_CFG3_PWR_MODE_0); + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3, + DP83TG720S_LPS_CFG3_PWR_MODE_0); + if (ret) + return ret; + + return genphy_c45_pma_baset1_read_master_slave(phydev); } static struct phy_driver dp83tg720_driver[] = { -- 2.39.2