From patchwork Wed May 10 22:55:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 92321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3974293vqo; Wed, 10 May 2023 16:02:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5I6HhKSEjYS0bK4B7EEb+Pn3CKvoqjQ8DmJlUhivzQj/uGbKLI2pwW12WzueShID8aoJKH X-Received: by 2002:a17:903:25d5:b0:1ac:a661:a4bd with SMTP id jc21-20020a17090325d500b001aca661a4bdmr6485137plb.20.1683759727047; Wed, 10 May 2023 16:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683759727; cv=none; d=google.com; s=arc-20160816; b=Z7kvHnHlUa4hyYOARvzM7PTq3wuJmk3DkOIJxz6LyDs0tM/mvGaPBRwrSe5iwkr1EF 7oqUnUBcfeojnyBTPvlsWZRG5MpqOXeTSIeuKicn+xyVMxjyGVoL0l/sFBGQiqFEW8nN xdjlFUhPfbWNifdmxwZIgASnDakTFz4BZ2upDjOdfN3iT80jajkgpXOZtC6Zj1HdD/AX K51HsMdfZh7xQfBscKlYm8stz0uUy8brRua1RW5BZt3MzwdFZ+nQ4Hcqa9XklkT10ILM /KXSbLyWCFM1zIu8LP0sXKUQxW7K20cQnprqC+sILdZUprl1L9BC9L7YfI1zZNy1HiWW DMiQ== 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:to:from:date; bh=6qCndzjD/Ojhsa1S9OAfiPDCl5hixonzrj77+/sbsLo=; b=qeT54AOkEGrGMZWT2nQpHsnZZ1rpCISnEszNKhaX+bncpvY63SoM1BM0uhKfWJrCHx KPmqhqzbypQojI4MXdxZV/hAtVHC4kGCSg5HXQiZXg9UrzzkzFDYlaqyosL+1Ik0O7+Q UtmXy8xL0xjzmp8JbtSpntk7AKF0NIMLdg5tSpypbE8subNbPYgHuq/Zmmj6UahRK4Ey Huiz0e7KTIIMhWyDQvRuh8NDx3+AGqhKpyKlYcY6B2TaOo2M3JVGumlSsNJLk/mmzj20 xDYgrIu+pfl5s4UyYX3fqsqnoDiLFQaGAmMd10VNdm2qa8wygN2V3wBap7liS7hj/6FL Ckpg== 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 l2-20020a170902d34200b001a05d12eeb3si4811498plk.189.2023.05.10.16.01.53; Wed, 10 May 2023 16:02:07 -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 S231468AbjEJW52 (ORCPT + 99 others); Wed, 10 May 2023 18:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232030AbjEJW5Z (ORCPT ); Wed, 10 May 2023 18:57:25 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F8ED4690; Wed, 10 May 2023 15:57:17 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pwskF-0004Qx-2b; Wed, 10 May 2023 22:57:16 +0000 Date: Thu, 11 May 2023 00:55:11 +0200 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , AngeloGioacchino Del Regno Subject: [PATCH net-next 3/8] net: phy: realtek: use genphy_soft_reset for 2.5G PHYs Message-ID: <0c1e578a5b02fe49e1114ea75e3c6282eb230ad3.1683756691.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?1765550039266623628?= X-GMAIL-MSGID: =?utf-8?q?1765550039266623628?= 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 4a2c1ad02d48..0cf7846c9812 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", @@ -1051,6 +1052,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", @@ -1061,6 +1063,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", @@ -1072,6 +1075,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", @@ -1083,6 +1087,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", @@ -1094,6 +1099,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",