From patchwork Wed May 10 22:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 9175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3978116vqo; Wed, 10 May 2023 16:08:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x3j/t73qThMJPNPfLlMIx+lEVyHXdMQB4OcrgJksY+GzGZuM46gXkO8HIxHjgr/vP1+9O X-Received: by 2002:a05:6a00:2e8f:b0:63d:254a:3900 with SMTP id fd15-20020a056a002e8f00b0063d254a3900mr25575439pfb.5.1683760087546; Wed, 10 May 2023 16:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683760087; cv=none; d=google.com; s=arc-20160816; b=ALyXqdhbnvyXLU9rcQNXw3ZSt4b6xBXJZFhY2UwwA2h/6TVxhNnx2o0NQfGAWbhvTW SoOy4toQOMpQFvPk1YXgXG8QwK9uPPZIAfy6fCfhu6wARj3zSXC+41qod5fyU+nB2bOl grqWk+1rQAc6khinoll0fbDhVNS4ldd9DhE59wtLf4Q4ntfx2hdK9zszWgHcYTF3lgRc BHiKw9NIbmBrHxJKkbhvPe5gaMH7015nk/xWHJy/ge2M2Z12ovBcQpezXQ5pXeiT6+EG hOnCRwYmNOqy1CLwXwLcxJ7JyXRaBZPJ8iyW60XNk92DOrISeLZfxMmN4JdwyoToC957 OGzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=lXvHmYkYhWOmDfgz0ITycoUiB5vRzGmeujegcN0emew=; b=xPfrihPhZRqk+D9uRz0h4oR+1dfJNAHo+Gyz968ocWsGFxRvZ8sL3v51/lEW3pNzSX tKll15ozpRX+J0Z91QmYLZSZk5gwlO8BMjskjPFEXcX3uCq20HgPtRDxoJZDJ89ceknA jV1V3b8PdulMGv9XzYBOTh0LBmj7s4bBn9MICdEwx92UpiynR3mCwcRI2+YXww7WTxGZ rnwEE9G0eF+Vj9LKxVv3aP0PmxZ6wTT+j7qYpRYTzoM1VBETYgCO2tGfHKCdz7Ez9mOJ MKWNV8HF9LvGItBBYiUa0NpFcWfdIuwh6M2+KD7eDryl1fj0AMI20M0uaWkZ5plRt2Nc s31g== 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 y16-20020aa79430000000b006436002d796si6293579pfo.1.2023.05.10.16.07.53; Wed, 10 May 2023 16:08: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 S236531AbjEJWzV (ORCPT + 99 others); Wed, 10 May 2023 18:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232395AbjEJWzT (ORCPT ); Wed, 10 May 2023 18:55:19 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E4C140DC; Wed, 10 May 2023 15:55:18 -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 1pwsiJ-0004P1-27; Wed, 10 May 2023 22:55:15 +0000 Date: Thu, 11 May 2023 00:53:22 +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 0/8] Improvements for RealTek 2.5G Ethernet PHYs Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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?1765550417361602156?= X-GMAIL-MSGID: =?utf-8?q?1765550417361602156?= Improve support for RealTek 2.5G Ethernet PHYs (RTL822x series). The PHYs can operate with Clause-22 and Clause-45 MDIO. When using Clause-45 it is desireable to avoid rate-adapter mode and rather have the MAC interface mode follow the PHY speed. The PHYs support 2500Base-X for 2500M, and Cisco SGMII for 1000M/100M/10M. Also prepare support for proprietary RealTek HiSGMII mode which will be needed for situations when used with RealTek switch or router SoCs such as RTL839x or RTL93xx. Add support for Link Down Power Saving Mode (ALDPS) which is already supported for older RTL821x series 1GbE PHYs. Make sure that link-partner advertised modes are only used if the advertisement can be considered valid. Otherwise we are seeing false-positives warning about downscaling eventhough higher speeds are not actually advertised by the link partner. While at it, use helper function for paged operation and make sure to use use locking for that as well. Changes since RFC: * Turns out paged read used to identify the PHY needs to be hardcoded for the simple reason that the function pointers for paged operations have not yet been populated at this point. Hence keep open-coding it, but use helper function and make sure it happening while the MDIO bus mutex is locked. Alexander Couzens (1): net: phy: realtek: rtl8221: allow to configure SERDES mode Chukun Pan (1): net: phy: realtek: switch interface mode for RTL822x series Daniel Golle (6): net: phy: realtek: use genphy_soft_reset for 2.5G PHYs net: phy: realtek: disable SGMII in-band AN for 2.5G PHYs net: phy: realtek: make sure paged read is protected by mutex net: phy: realtek: use inline functions for 10GbE advertisement net: phy: realtek: check validity of 10GbE link-partner advertisement net: phy: realtek: setup ALDPS on RTL8221B drivers/net/phy/realtek.c | 161 ++++++++++++++++++++++++++++++++------ 1 file changed, 138 insertions(+), 23 deletions(-)