From patchwork Tue Oct 12 18:04:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 12553437 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C89A9C433EF for ; Tue, 12 Oct 2021 18:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A91E260D07 for ; Tue, 12 Oct 2021 18:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231739AbhJLSG5 (ORCPT ); Tue, 12 Oct 2021 14:06:57 -0400 Received: from mail-dm6nam10on2074.outbound.protection.outlook.com ([40.107.93.74]:23905 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230002AbhJLSG4 (ORCPT ); Tue, 12 Oct 2021 14:06:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=meSVLhq0UEH1zSW89UgOzQgEyl8MOraxjanrdVicFE2YmtC9gksR2iOaDBv37jC4Tm1/C3ReYuLXpA2uPPUR3BG0bGv3vqZkm+9crGdruUEQzpNq/6EocLVUa6zNQvXWbdr3tXaQVXUCY+MDQrjr6yatx1XAQYpFGEaDF2PGQlIhZfRhjsWOz/c8eDSGBN4prh3nPBETcQzd8HNvj5z8E0fhR/byLd3aPI00D7+vYaadl7tyMDul2KD3q+q/UBoNZeD6DLMNIdPIUwVJN7uFrvtVX72e3H5As3NrZPyq7ve6IBD6X/TOlZmynBxkYpZHZ99s4ld+b/mW/dWfyQn+7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jCQOuweJqFfoWSZaz03HcOFvWuwiimHH3AFKlYRZXE4=; b=UE9HUFysLtb9MLoOL+GekGum2DKqp0cH65kKL+MWqVQOq9k6qX+BfrEhEb0jFFNEa0nvtnIoIH7x4eAJtWjeEcgHJR+jgy1zvWd3M33En0NcD6wi1u8OqiP5m9rCjHyhCISvMnvpd8SGGKR8eydInOaAoGAlYqDQjp3/V0mq6I/as6WLl0pKHMUuHSTtQ4JlgWOomsWw24SpRhQpMVL1CTbAyDmRe056rYtc+MWEKAxoXzumQV2hJAg63lQTu8xz9q00yet99zHZd6mPPcld8WilRyqJ6qyssFj/Z1/YR/TUEzw3QztRAWesHlUTlfYIsjkFlrA78ynvxaY82gsI7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jCQOuweJqFfoWSZaz03HcOFvWuwiimHH3AFKlYRZXE4=; b=DGihh2JkDLGK7cxq9AIKaJ66Oe6c5W9R5lloTNTetHzCDO63l295fu78XVvFi+DhgZAJZO1bmuqFCfa9nva5QfuLs7oMzOkXKqItUDfud+KFK08eHCGdguH2L0P+wMxVB2BrjtMz43oOgPBBa4GlendWoSMbKbM6ZvjIazZMMm8= Received: from DM6PR03CA0088.namprd03.prod.outlook.com (2603:10b6:5:333::21) by DM5PR12MB2535.namprd12.prod.outlook.com (2603:10b6:4:b5::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 12 Oct 2021 18:04:52 +0000 Received: from DM6NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::fe) by DM6PR03CA0088.outlook.office365.com (2603:10b6:5:333::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19 via Frontend Transport; Tue, 12 Oct 2021 18:04:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT058.mail.protection.outlook.com (10.13.172.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 18:04:51 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 12 Oct 2021 13:04:48 -0500 From: Shyam Sundar S K To: Tom Lendacky , "David S . Miller" , Jakub Kicinski CC: , , Shyam Sundar S K , Sudheesh Mavila Subject: [PATCH v2 1/2] net: amd-xgbe: Toggle PLL settings during rate change Date: Tue, 12 Oct 2021 23:34:14 +0530 Message-ID: <20211012180415.3454346-1-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce65ea60-b79c-4e39-c264-08d98daac98a X-MS-TrafficTypeDiagnostic: DM5PR12MB2535: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uqnchcmg5KcpFH3YpiVd7/Rc60t4fPAJX2+hwp4iSHAGwd4zIxyzAuEQsYWiAQUhuppLZ5aTMtbwVQ7CWNglziFm7VNlapfzJGGZhg4SfBsdvjvQhLqtUSxfntNWoGr6JyMFKG53YYcmYasJye9d7dAoLoqmGl9lnnTPChpKrb2VGeqYef/VcVuFBNkFk5l1etbsQMz69ngFK4ctsPewP6aLJDM7K5gvKr7aX1ACV2NNRP8FzR7BfLOV4UuGnPqAWP8OJ2QU77RcAfVfIS4PaP4MLcHK0BVk0medKAbWe6v/5ejN6iPRC7fQc33Rr7YRSYF6SWrc5wWd8expQOr8Ixs/SG0RAgZ5myrTSYLax3Ut74ej/uCmRwUWPnQyqO1lCVQ5RjiIalJw/AjtwdZmq46fBFt9UjbT1PAas/d5SPErHUEK2cNmG4V5/udoMMM6xnFIrLtDSCdi/rKC+/ycr4cbMmpM6BEzutNJrJv8RFqnNbnZ+d4qMp3b2H+TJBOQoEIRT6LYXiLFWqQc/kV06+YDY1qguJd6uWXmzGUO4wluUE/6sTA4hmWwbf5rT+F/LyX7NSflFNheWGBjCOb2bnm9znTntVsge94OSmAC6xKfrZ6W5zJIY36CcUb1lRTj9YJFbpNco5BPiIWa4jP2tch9aJIsxa58la6234HgWFLAXjnah0+MCGrRg3qHfvPGPbArSvyyIRaqmEVgh8Kzz0aWZHUG3XEl+WVLAq4umRg= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(70206006)(81166007)(82310400003)(70586007)(508600001)(2906002)(316002)(356005)(7696005)(2616005)(1076003)(16526019)(8936002)(8676002)(186003)(26005)(86362001)(4326008)(5660300002)(47076005)(110136005)(336012)(426003)(6666004)(83380400001)(36756003)(54906003)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 18:04:51.4097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce65ea60-b79c-4e39-c264-08d98daac98a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2535 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org For each rate change command submission, the FW has to do phy power off sequence internally. For this to happen correctly, the PLL re-initialization control setting has to be turned off before sending mailbox commands and re-enabled once the command submission is complete. Co-developed-by: Sudheesh Mavila Signed-off-by: Sudheesh Mavila Signed-off-by: Shyam Sundar S K Acked-by: Tom Lendacky --- v2: add a missing Co-developed-by tag drivers/net/ethernet/amd/xgbe/xgbe-common.h | 8 ++++++++ drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 20 +++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h index b2cd3bdba9f8..3ac396cf94e0 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h @@ -1331,6 +1331,10 @@ #define MDIO_VEND2_PMA_CDR_CONTROL 0x8056 #endif +#ifndef MDIO_VEND2_PMA_MISC_CTRL0 +#define MDIO_VEND2_PMA_MISC_CTRL0 0x8090 +#endif + #ifndef MDIO_CTRL1_SPEED1G #define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100) #endif @@ -1389,6 +1393,10 @@ #define XGBE_PMA_RX_RST_0_RESET_ON 0x10 #define XGBE_PMA_RX_RST_0_RESET_OFF 0x00 +#define XGBE_PMA_PLL_CTRL_MASK BIT(15) +#define XGBE_PMA_PLL_CTRL_SET BIT(15) +#define XGBE_PMA_PLL_CTRL_CLEAR 0x0000 + /* Bit setting and getting macros * The get macro will extract the current bit field value from within * the variable diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 18e48b3bc402..4465af9b72cf 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1977,12 +1977,26 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata) } } +static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable) +{ + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0, + XGBE_PMA_PLL_CTRL_MASK, + enable ? XGBE_PMA_PLL_CTRL_SET + : XGBE_PMA_PLL_CTRL_CLEAR); + + /* Wait for command to complete */ + usleep_range(100, 200); +} + static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, unsigned int cmd, unsigned int sub_cmd) { unsigned int s0 = 0; unsigned int wait; + /* Clear the PLL so that it helps in power down sequence */ + xgbe_phy_pll_ctrl(pdata, false); + /* Log if a previous command did not complete */ if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) { netif_dbg(pdata, link, pdata->netdev, @@ -2003,7 +2017,7 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, wait = XGBE_RATECHANGE_COUNT; while (wait--) { if (!XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) - return; + goto reenable_pll; usleep_range(1000, 2000); } @@ -2013,6 +2027,10 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, /* Reset on error */ xgbe_phy_rx_reset(pdata); + +reenable_pll: + /* Re-enable the PLL control */ + xgbe_phy_pll_ctrl(pdata, true); } static void xgbe_phy_rrc(struct xgbe_prv_data *pdata) From patchwork Tue Oct 12 18:04:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 12553439 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D548CC433F5 for ; Tue, 12 Oct 2021 18:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5867610C9 for ; Tue, 12 Oct 2021 18:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230522AbhJLSHK (ORCPT ); Tue, 12 Oct 2021 14:07:10 -0400 Received: from mail-dm6nam12on2040.outbound.protection.outlook.com ([40.107.243.40]:2144 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231717AbhJLSHJ (ORCPT ); Tue, 12 Oct 2021 14:07:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l10LC5DdrX1CQ4GsWdxEm+9qCJ7q8+vqs4/Cb01BWkyFs4yomii/HPlhlQPMaxsxTqXElmKGo9iXZMT3QAybP9DdnVn61daT8DZ2IIpwdxNT4d77NSnoD5my+tfeaDCjM8Za+skV/JntELhYituSAr4jy/rcVIylMIcWFosskgVRS9DdSDzn+VZqxtORlVnETmzUP4TwJakWXjfeqqn1iMB8U0a3ABrGMYGMgmvd1620PQJqAmzH7HjHWlFWPd8OiHM9bT3MrctyAY4cLuR377+MpIH001THoo9ea+mdt4Xv7SBxpEAz3LWcydt5rNOdZG57oThk6/dduUrWubqNig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2PvId4TADbKNaXJvaQP7XnRUl1aoohCtMzQnaP11wdM=; b=nQRgc8hU66WMqXrOVhscJwXpTNOeLJ4DQhcTOJrIsc2Fh5jlIj2ZgEAEda0jCW7NDO3EBEeZbcSKtBOL6cdcV1tQXZkNbzQwcIy0uzkZaApe0IVGXcnl39rwKVXb/A2jQj5+5j0/fqd3B9d4G83o4aoSPKbfiOIj2ysnLuAGButJx6LR2/xnPh+d5AJnSFIbar2YBMuNPQDePNmkMUeq8Bt8I/DkXQFGXXvX6AonsBSBPmbu1E7eytFT7m7MnVRTdfbK0e4nRpsVNU/7UX1tQVwxK91FNEU0PJ1pf7R2UhvW9lpHXAJU7LRoe/8FdxUvwAVcCg4oVXb/Ej/9emjLtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2PvId4TADbKNaXJvaQP7XnRUl1aoohCtMzQnaP11wdM=; b=pkBM7fYbX2zxgiOJkUyHmI0IbSOWZjr05cRDgARJ78yRZe/c0vvqsbO6pdYPvp82LqObVrlaYoGEgMliGkzEcPxEUgfKFqJC0ciqiYIfU+5GN6Pg4BQsr6tJH0F5YGtVnS1f8/+3BFGv4d1tMAH1Lw1LopMZGJYy/tv7tbyPiXA= Received: from DM6PR08CA0041.namprd08.prod.outlook.com (2603:10b6:5:1e0::15) by DM5PR12MB2486.namprd12.prod.outlook.com (2603:10b6:4:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Tue, 12 Oct 2021 18:05:01 +0000 Received: from DM6NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::44) by DM6PR08CA0041.outlook.office365.com (2603:10b6:5:1e0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Tue, 12 Oct 2021 18:05:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT068.mail.protection.outlook.com (10.13.173.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 18:05:00 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 12 Oct 2021 13:04:57 -0500 From: Shyam Sundar S K To: Tom Lendacky , "David S . Miller" , Jakub Kicinski CC: , , Shyam Sundar S K , Sudheesh Mavila Subject: [PATCH v2 2/2] net: amd-xgbe: Enable RRC when auto-negotiation is enabled Date: Tue, 12 Oct 2021 23:34:15 +0530 Message-ID: <20211012180415.3454346-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211012180415.3454346-1-Shyam-sundar.S-k@amd.com> References: <20211012180415.3454346-1-Shyam-sundar.S-k@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 116e0232-f4b6-4839-0665-08d98daacefd X-MS-TrafficTypeDiagnostic: DM5PR12MB2486: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5ykoayJgGD7+xoCWRJOAWEivagiOjqWiBPuBHfJeHz7lYFfOjKo2CNcurENbSfaYqUrlUCdXq1WCzHWH1OxKG/H8RZZbe8025pklStqf1BueWbKGnXnpuiOO1xSwn1SgfwNfOQ/qthjwaPi2xFQvO9S8IybMQwUGBa+yh+mirhlopTmLFB9V/0S0XwqsGEqzRxDWXvTz/paYU9As13z0d6uY9BmWW/x1C5MRGbVn3/J9QXe1bPnVWXxBCnMUK7TCT3FBmb6+xOtCgUGoOi+eS5dUPQ70sBpBqhyYmyE82+Ow0Cs+lpi6FDp9078n3cn1QLzywT1DC4SUdsv1w2O7dcQ/U68HGEeNRptRIb/MnO5yKnv/iuuhrp+pUYpsKdoBTKO/qwWexuTtfIn99OmjzmrwZGgmkNdXtn5qDr/rB1Ttl4j0RMSos54Ko5mPXxRGqCag+0SCfCDp7XFFMkAk5Qis/UyaCBB/rltd9fbmOfdYpuJTd7c7ZdSwPKHU1ZwgwbhHgcsM4FraauLTdADNmwmOibf1/0upcSn6ymJJS4ERRdeUKmibPYIoW2VnU+CcjfgfqW19LD8/Zg4L+KUxgSkAXjS60SUqkDoECsPMNz8QK2YCWYIGje6ZVbfyZFy1drjy882ogescSqAmXGnae2hjIZ7dCX57PG1J8zIfMUZBr4gEHzuk9Z9kdaB3Igbak1gRfC3mVWafJj9xNbjykgTdMTlvBYjOGq/v/0nfrPY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(86362001)(54906003)(508600001)(8936002)(81166007)(7696005)(356005)(1076003)(70206006)(70586007)(36860700001)(8676002)(110136005)(4326008)(26005)(2616005)(336012)(5660300002)(426003)(2906002)(82310400003)(47076005)(36756003)(316002)(186003)(16526019)(83380400001)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 18:05:00.5461 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 116e0232-f4b6-4839-0665-08d98daacefd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2486 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Receiver Reset Cycle (RRC) is only required when the auto-negotiation is enabled. Co-developed-by: Sudheesh Mavila Signed-off-by: Sudheesh Mavila Signed-off-by: Shyam Sundar S K Acked-by: Tom Lendacky --- v2: no change drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 4465af9b72cf..1a11407e277c 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -2642,7 +2642,9 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) /* No link, attempt a receiver reset cycle */ if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) { phy_data->rrc_count = 0; - xgbe_phy_rrc(pdata); + /* RRC is required only if auto-negotiation is enabled */ + if (pdata->phy.autoneg == AUTONEG_ENABLE) + xgbe_phy_rrc(pdata); } return 0;