From patchwork Tue Feb 16 19:07:10 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: 12090525 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 X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C5C3C433E9 for ; Tue, 16 Feb 2021 19:09:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 072F864E28 for ; Tue, 16 Feb 2021 19:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231277AbhBPTJm (ORCPT ); Tue, 16 Feb 2021 14:09:42 -0500 Received: from mail-bn8nam12on2058.outbound.protection.outlook.com ([40.107.237.58]:51168 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231236AbhBPTJf (ORCPT ); Tue, 16 Feb 2021 14:09:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNN6xXsRpxSXzYU8y9sRr8v2gXbXu6EVNQ/NjTUdk6DrASc+gPIr3M/Ol10iKl1v5Pr9+Qe+0wJQ+O9h9WVMpTPj0Z8xEYHWg/+uJjPl8Ioeg683wW8FWL2y9+n7J62h2oz7Ad0ZX1x9NCJ17G7CnRBjhLuhCVtkZWEBAxoHru6HIuXUsgCXoscLffV6eU7WZCgT/107XxS4d2uPjoo04PEWjHC5u7XLyvAWtZ0BK2d9ISg1DMKIcCYTzA95bgGJ9m2aWne1Pcohk6jY8JbJrWk4ys1JXD1nBxiCpVgCjkg2T5KJ6xxIjeh6YFGfHK5c5qPyPf/cHRIl8JtAKezj9Q== 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-SenderADCheck; bh=v0LNsyiMZVZ4TKwsOk1oNTqslbwWUaCQ7+gv+tx3T6Y=; b=h3anAlbO6A5+33SuLfcrympldpIP+i7GjM6OstkYEO3YC3FA+gsNFhERQ8BR23hYvEDUn3M8NIFIYjkkkvpzd7WE8Qlkx/e2yd5R6W38206HoFI6eie7ByMhLh4Eq0U7fcLzDvoBEEupvMoK+wSeY9y6KVVif0guxfvipfJ33EOzT5QA7o0dq3FJChc/JRhSV6Csmt/KeQjY2T4Sq0oFvNc/kPhIJ8rvxk3hHiT313rBWnXXmu6BWodkbut59jNcGCWVhFaESAteMg06tUsssdjVbuJczBQn6RRCG+2qFbO8mXRVKDZgcWVKpPe/JsvynoVplx1/NI4Ms1PpkAOC0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=v0LNsyiMZVZ4TKwsOk1oNTqslbwWUaCQ7+gv+tx3T6Y=; b=Rvg3L3/h4mkEmJ74W8/V8SD9jy6JKYJrXoqfhSn8K8ZNt0MfxWyRLQvUN1UKl785hqCzYLKlwXNMuZi2awN/QHhFzGaymDW7/fek+Wm/cxgrfIR/IvPCvcwQJzJ4BIXf5IjQ0SKMOi+pNbIizgieSsfGYv+1t4UwjDKtaJc4FdM= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from BL0PR12MB2484.namprd12.prod.outlook.com (2603:10b6:207:4e::19) by MN2PR12MB4112.namprd12.prod.outlook.com (2603:10b6:208:19a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Tue, 16 Feb 2021 19:08:22 +0000 Received: from BL0PR12MB2484.namprd12.prod.outlook.com ([fe80::5883:dfcd:a28:36f2]) by BL0PR12MB2484.namprd12.prod.outlook.com ([fe80::5883:dfcd:a28:36f2%6]) with mapi id 15.20.3846.031; Tue, 16 Feb 2021 19:08:22 +0000 From: Shyam Sundar S K To: Tom Lendacky , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Sudheesh.Mavila@amd.com, Shyam Sundar S K , Sudheesh Mavila Subject: [net,v2, 4/4] net: amd-xgbe: Fix network fluctuations when using 1G BELFUSE SFP Date: Wed, 17 Feb 2021 00:37:10 +0530 Message-Id: <20210216190710.2911856-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210216190710.2911856-1-Shyam-sundar.S-k@amd.com> References: <20210216190710.2911856-1-Shyam-sundar.S-k@amd.com> X-Originating-IP: [165.204.156.251] X-ClientProxiedBy: MAXPR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::16) To BL0PR12MB2484.namprd12.prod.outlook.com (2603:10b6:207:4e::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jatayu.amd.com (165.204.156.251) by MAXPR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Tue, 16 Feb 2021 19:08:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 45ff2d9e-0107-4d30-6471-08d8d2ae3a63 X-MS-TrafficTypeDiagnostic: MN2PR12MB4112: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7RRB9f6k7JCnlvNlW6NMTaKPO5fIN6QDOGixKOloHZq4c5/6El8dkmHXIky58Wj8ujqdUVrcDlwvAjNGqr2uENtmNYt6W9rdLXD22WTrf8i2dU74+EXVxHuNlignWIqamTICE2GI+UFi1rAsSc0aKnX4opmoikCKm2jAUQ0ve/8f/Dw6W48iQN3PgtLIhBmnh1ZUUKhsOxJ6NW0u/bEqB++jpPxCZZcbPtf0/8IsZaL1u92gonDHlmkblEhjif9SwRFGuwnDaRejtyyJzi7+jU/yC4k/cT8gLTYv4ldohq8WDNA8epjnEt97v+5ZBDxjh5njrlFHZoZ/vkZI7Ir79MubGWDO6wk30OxARYFbZ1r33Df3UwSYu4vwHNrwiFZdhclAYBK49IwGP+YNn/lHGJjkkhhC8GAEdw04M35bjwPwp121uvQ14GQyMvMUE5DWRn01xxxbTQJOcsOYI4ZjhzWYGAkM42ewiBOAW+LApbJHqoS+7frP5XTtWafPC6ICoJgtrkMSp3uPeEBuwwxu8w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB2484.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(39860400002)(376002)(366004)(136003)(396003)(7696005)(54906003)(1076003)(83380400001)(8936002)(86362001)(6666004)(66476007)(2906002)(4326008)(8676002)(52116002)(5660300002)(478600001)(110136005)(186003)(26005)(956004)(66946007)(2616005)(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YznyTTdk3E2omEnXJCUIE8rMUbPPARoXGi2948e6vn0i8Q4H//sYpEW1CPs78zIMuWEAIUgXkPHXLYNEj6dLXC4s7i2A8gtHT1Z8ehdhtxVAsCv5PoXdBBbaOmNT8XFxZ+Bq7t7xeo4uSCzt8upu9miypTfFcbNvCzjGuvbeSRTJr4DFim/eV1vhUdWWZPmlXEuXwhfsnRQa46C1FIpHwbbQ//VeEK5xxWYQq68XWoJz0xkvGG1WilZHTcCGV2YWISxoIaRziU7bdLs8UJlBhRlA4xZATqxrNrwvIJ+5rxsm9foUIEHeLJX6ABwrnpR+givUxDydc8LzFCzNu8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45ff2d9e-0107-4d30-6471-08d8d2ae3a63 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB2484.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2021 19:08:22.3157 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZltXnej/4LCDYnO0yeAaSmHq8zplwqs0LyJL/5h/QlAIHGfWE9r49ieaP0I9H/FlHvcqpgRjBRWQy5cDhPB1MA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4112 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Frequent link up/down events can happen when a Bel Fuse SFP part is connected to the amd-xgbe device. Try to avoid the frequent link issues by resetting the PHY as documented in Bel Fuse SFP datasheets. Fixes: e722ec82374b ("amd-xgbe: Update the BelFuse quirk to support SGMII") Co-developed-by: Sudheesh Mavila Signed-off-by: Sudheesh Mavila Signed-off-by: Shyam Sundar S K Acked-by: Tom Lendacky --- v1->v2: - Add Co-Developed-by: and Fixes: tag - Use genphy_soft_reset() as suggested by Florian. drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index d3f72faecd1d..18e48b3bc402 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -922,6 +922,9 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata) if ((phy_id & 0xfffffff0) != 0x03625d10) return false; + /* Reset PHY - wait for self-clearing reset bit to clear */ + genphy_soft_reset(phy_data->phydev); + /* Disable RGMII mode */ phy_write(phy_data->phydev, 0x18, 0x7007); reg = phy_read(phy_data->phydev, 0x18);