From patchwork Sat Apr 22 11:48:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 86589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1651560vqo; Sat, 22 Apr 2023 04:50:11 -0700 (PDT) X-Google-Smtp-Source: AKy350Z5ZqyJY+ETKPUzKv9QGdY0dV8K/ZwbIwuo0wpuHwee4swBFWAAjE24j64nbE/MFZBYBfCv X-Received: by 2002:a05:6a20:9190:b0:f2:dc4d:935d with SMTP id v16-20020a056a20919000b000f2dc4d935dmr4100782pzd.18.1682164210882; Sat, 22 Apr 2023 04:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682164210; cv=none; d=google.com; s=arc-20160816; b=u9txbVao23o3CuqttdV8fGHUTdbQXr6hVZWNFubJ9ryyNL24bFbnyTiUmZmHgb7C6D bU/bS8d0GTcY+NJrz9LXB+nFk3GFCaZsNNCMUzWCAYGM9NzlihJz+t9quF+txP19Ug+k wFEUVuY6czYkgTK4kZxgICPfBIx3y77XeA9pDX1lwBnxZopL+d5bm9blye2hXP5ZAFt8 Bz36x0AGG5/UGTzEb76MiQgnKHrpgsdF+FAFRXyjJ940YzlHBmmk+GT1DvqBoK92y6vM 7sYYNwKrkBo2QJ+Ojs28PHi/pmyqOjZbrwMnv6eaCY0E9bJIUOEHj6/g0VchQo3fRctX 5+Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Ou2g3Kg8R5umMD/mLJWOWuDUgEzMBCCyBFU9A5jXPsY=; b=wPSJTvLzI4I9LczL/3dtPiAE/JmEOCH3NRoDuLsWNxTR9outs+OzxB5TMHsAjB95ru 3WiJ2zbRzmmJovUt/MXZ+ErCcXqXmeOw8xZOW/YF0HgkTBXM2L3gtKOLvaoa13Vpa7Xz Vmc9LMK1I4t5fah+Yb4LFHDZptc9MW3i6K/flWRY8cWkqqF5+suVxUsVfb4stNzENqqT wrPVfzsS4JM+TpdYOyq6qlLoaK2VBSw3FteJOoLNEkdpPmqZAMyU+J0ve77zzXywUsgW 7A/ISAkdnbpFmBphRmshDQkZNS9bXmdZnhx7OLaWFJ5Z2jD4XUC5enD7+5Ij7b65YRET 69yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t69-20020a638148000000b00524d36c5335si4645031pgd.177.2023.04.22.04.49.58; Sat, 22 Apr 2023 04:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbjDVLtG (ORCPT + 99 others); Sat, 22 Apr 2023 07:49:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjDVLtE (ORCPT ); Sat, 22 Apr 2023 07:49:04 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004322116; Sat, 22 Apr 2023 04:48:43 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pqBjO-000853-1B; Sat, 22 Apr 2023 13:48:42 +0200 Date: Sat, 22 Apr 2023 12:48:38 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Chen Minqiang , Chukun Pan , Yevhen Kolomeiko , Alexander Couzens Subject: [RFC PATCH net-next 3/8] net: phy: realtek: use genphy_soft_reset for 2.5G PHYs Message-ID: <3ddae95741d87b94c9d135f3c0acfa1617f91836.1682163424.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763877019538184269?= X-GMAIL-MSGID: =?utf-8?q?1763877019538184269?= Some vendor bootloaders do weird things with those PHYs which result in link modes being reported wrongly. Start from a clean sheet by resetting the PHY. Reported-by: Yevhen Kolomeiko Signed-off-by: Daniel Golle --- drivers/net/phy/realtek.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 34fd86b8ecf7d..9b477dd17fa56 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -1038,6 +1038,7 @@ static struct phy_driver realtek_drvs[] = { .write_page = rtl821x_write_page, .read_mmd = rtl822x_read_mmd, .write_mmd = rtl822x_write_mmd, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc840), .name = "RTL8226B_RTL8221B 2.5Gbps PHY", @@ -1050,6 +1051,7 @@ static struct phy_driver realtek_drvs[] = { .write_page = rtl821x_write_page, .read_mmd = rtl822x_read_mmd, .write_mmd = rtl822x_write_mmd, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc838), .name = "RTL8226-CG 2.5Gbps PHY", @@ -1060,6 +1062,7 @@ static struct phy_driver realtek_drvs[] = { .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc848), .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", @@ -1070,6 +1073,7 @@ static struct phy_driver realtek_drvs[] = { .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc849), .name = "RTL8221B-VB-CG 2.5Gbps PHY", @@ -1081,6 +1085,7 @@ static struct phy_driver realtek_drvs[] = { .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc84a), .name = "RTL8221B-VM-CG 2.5Gbps PHY", @@ -1092,6 +1097,7 @@ static struct phy_driver realtek_drvs[] = { .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, + .soft_reset = genphy_soft_reset, }, { PHY_ID_MATCH_EXACT(0x001cc961), .name = "RTL8366RB Gigabit Ethernet",