Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3398505rwr; Sat, 22 Apr 2023 04:49:58 -0700 (PDT) X-Google-Smtp-Source: AKy350b0azPh6opPVSt+OiKbmKfQJ0KRplWB8EGeHR0JHnPzAxZVjH95U1zIm4yfDGCvS3HvdDE0 X-Received: by 2002:a05:6a00:1496:b0:63a:fb57:63c5 with SMTP id v22-20020a056a00149600b0063afb5763c5mr8680369pfu.3.1682164198349; Sat, 22 Apr 2023 04:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682164198; cv=none; d=google.com; s=arc-20160816; b=1ATfjTv1YUpPUF8SxPbLWDx21qH2oZI7jukSPwgfo1ZO7PA3VU6OGmpcZTiNvutGWh IltlkidxVBSS6jF7lNH0PRQSnVBLb2h8mW6G5V8KBSTP1I6syfZFL6k4aG86gPGvPqq0 8zOljfIjACX5+v+iaRFkn2swLscC/jYvIAi8EfphXjOV1xsHVSKa4Q1teaYdp4+O4bpR 4slbEKEO2jHhH0ETntoYOjdrgkQjHz3qWm1kMQtSny8z/rLouGRXuD+/jGYZ0B1d/KOu xZ05DHU+v2S9itr+atB6IYY85k9MGtq87SKVwImAjEgtsglgW81YMW+lZLaqPlp+NIYm GAgA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b00513ec891472si6186715pgp.88.2023.04.22.04.49.47; Sat, 22 Apr 2023 04:49:58 -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 S229718AbjDVLtG (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-Type: text/plain; charset=us-ascii 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 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", -- 2.40.0