Message ID | 20221108101527.612723-1-michael.wei.hong.sit@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2611443wru; Tue, 8 Nov 2022 02:19:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM51vtHFOzq9qALtKQOqUU5zPNkw69B0wGSq6l7uALpkA4mD2H5yi+amMZ4o7dMOAhpCSFqQ X-Received: by 2002:a62:820a:0:b0:56d:2b5f:20dd with SMTP id w10-20020a62820a000000b0056d2b5f20ddmr53190556pfd.66.1667902775679; Tue, 08 Nov 2022 02:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667902775; cv=none; d=google.com; s=arc-20160816; b=ETWbbHcMI6/x17WautzVxe/XaT3ZpCtHOtgKYmbcMOl5/EgqsPs/QjyRarTRBZuVqc vpAW2jpj2DGCP+AOUNSqf6c0AbFdGVIB1Ix5ESMkiqieNHLfEhUqplSh5IKkRfy3DqJa pTkhcV8pjHVqzEKdTLBUyciUXH3sA0SNT27kjNXcXvBiV50D593HP6TvV4+kgzu3sUH+ HFsQYwKU0BfS9hC+XHbEO689CIlqhYcDoMIWJNtqFwh/UNU98137RiNw4mg6QbvmRgeO Na0cfUki/4sWA7VGmhoh/LrSMZbuDWlkzw9LF9JJFd8HdfVOmXkfhtiiY0GpgWg5P55x EmGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=si17unMCzPrZa4ys3yDdn0xD+FavdNlbbGuceXGsRj4=; b=XiJccgnLum7QMvEg2lzZL6iL+3iSTcEskybK7HZeSJsGP8K+emnkrW0czI0cGqm50X TdvGCl4vClYKhQNMGwV3zTbGrMNOXN8vs2uD1YoaQLMQUqEmOjzFrYQYSpIvWdV6Q8M6 DWNEuZ4UUwBcO8bFAHFWO1eQ641JLd/Tu6CCGnSev8ykIoTmLYO3RNKT/fTGBN23pL0W sLGpDuCU9JcoxmeVk7yythyaZP8k8yTLtUoh+mpDFaPVhmWRtwzWA+k41cI7nh3Z7nQ2 pM/E01hbVXIZyZdiyyONrzabMU4xydJoXcHUcE0etPufIWJcxGsxVAYDv/saFrlhpPt0 u4ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K7+wpFoQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t190-20020a6381c7000000b0044034efb2aesi11979831pgd.869.2022.11.08.02.19.22; Tue, 08 Nov 2022 02:19:35 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=K7+wpFoQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233813AbiKHKQH (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Tue, 8 Nov 2022 05:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbiKHKQE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 8 Nov 2022 05:16:04 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3914FBF8; Tue, 8 Nov 2022 02:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667902563; x=1699438563; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7iE5y9/CL0SMSk1mAHJvny43HgcdVVS8SDYC0bUemas=; b=K7+wpFoQOgI1NFPKIpAfTaxnvSyNkPhFcNRZvt5pzss3Bn8VuDU8K9Te QQ+vmOC74jCJG2n9H1v0sUkKQ5qG2tjJxZffT1/LovV15nn8Ufc3Fo2RA EVYKMfxE7NKYOpYHXA6eW5ji8IHPpAv9kvox2AOHqOwwsB/wVA/s/eLRf AsP+gN4Ry15eA12/t5YBmGj18JXKcd1ma3uqtS/RQHRAlaEyyTlNL6NSF dl73qrKpbjToIxRpyXwGgLD8Q4EUcV0z/If5bSxvhsw65DMH8ofeWrnjI M6b67V5A749bJMHuCkFB3To1XIh1EuPowGK0Klb3leVR9e9YOX5e3G8+h w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="298175083" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="298175083" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 02:16:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="811187958" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="811187958" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga005.jf.intel.com with ESMTP; 08 Nov 2022 02:15:57 -0800 From: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Tan Tee Min <tee.min.tan@intel.com> Cc: Looi Hong Aun <hong.aun.looi@intel.com>, Voon Weifeng <weifeng.voon@intel.com>, Zulkifli Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>, Gan Yi Fang <yi.fang.gan@intel.com> Subject: [PATCH net-next 1/1] net: phy: dp83867: add TI PHY loopback Date: Tue, 8 Nov 2022 18:15:27 +0800 Message-Id: <20221108101527.612723-1-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748922820914003257?= X-GMAIL-MSGID: =?utf-8?q?1748922820914003257?= |
Series |
[net-next,1/1] net: phy: dp83867: add TI PHY loopback
|
|
Commit Message
Sit, Michael Wei Hong
Nov. 8, 2022, 10:15 a.m. UTC
From: Tan Tee Min <tee.min.tan@linux.intel.com> The existing genphy_loopback() is not working for TI DP83867 PHY as it will disable autoneg support while another side is still enabling autoneg. This is causing the link is not established and results in timeout error in genphy_loopback() function. Thus, based on TI PHY datasheet, introduce a TI PHY loopback function by just configuring BMCR_LOOPBACK(Bit-9) in MII_BMCR register (0x0). Tested working on TI DP83867 PHY for all speeds (10/100/1000Mbps). Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com> --- drivers/net/phy/dp83867.c | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On Tue, Nov 08, 2022 at 06:15:27PM +0800, Michael Sit Wei Hong wrote: > From: Tan Tee Min <tee.min.tan@linux.intel.com> > > The existing genphy_loopback() is not working for TI DP83867 PHY as it > will disable autoneg support while another side is still enabling autoneg. > This is causing the link is not established and results in timeout error > in genphy_loopback() function. > > Thus, based on TI PHY datasheet, introduce a TI PHY loopback function by > just configuring BMCR_LOOPBACK(Bit-9) in MII_BMCR register (0x0). > > Tested working on TI DP83867 PHY for all speeds (10/100/1000Mbps). > > Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Tue, 8 Nov 2022 18:15:27 +0800 you wrote: > From: Tan Tee Min <tee.min.tan@linux.intel.com> > > The existing genphy_loopback() is not working for TI DP83867 PHY as it > will disable autoneg support while another side is still enabling autoneg. > This is causing the link is not established and results in timeout error > in genphy_loopback() function. > > [...] Here is the summary with links: - [net-next,1/1] net: phy: dp83867: add TI PHY loopback https://git.kernel.org/netdev/net-next/c/13bd85580b85 You are awesome, thank you!
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 6939563d3b7c..350217a23b34 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -925,6 +925,12 @@ static void dp83867_link_change_notify(struct phy_device *phydev) } } +static int dp83867_loopback(struct phy_device *phydev, bool enable) +{ + return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, + enable ? BMCR_LOOPBACK : 0); +} + static struct phy_driver dp83867_driver[] = { { .phy_id = DP83867_PHY_ID, @@ -951,6 +957,7 @@ static struct phy_driver dp83867_driver[] = { .resume = genphy_resume, .link_change_notify = dp83867_link_change_notify, + .set_loopback = dp83867_loopback, }, }; module_phy_driver(dp83867_driver);