From patchwork Thu Oct 6 13:54:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13000386 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1213C433F5 for ; Thu, 6 Oct 2022 13:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231386AbiJFN4A (ORCPT ); Thu, 6 Oct 2022 09:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbiJFNz6 (ORCPT ); Thu, 6 Oct 2022 09:55:58 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2041.outbound.protection.outlook.com [40.107.237.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC5388C00D for ; Thu, 6 Oct 2022 06:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jddrIGnPkDLKB50adU4ySoXG+gFjVGiqyK53cp/FCALtpW1jWVrPGo7LCEPk89bV5noBlOdRQamgPpAFavHgzY/3cwxR68N7UZyhDxNXhpd6oGnnBX/5e5JwDNudFbbgdGAmXpkZeoOJIXsJdAK8/yFUkODBL2eIwaccDfG2SfPvzk3UrG1qLrtrAovI2KDiIGQe1YLCTXw2g4QFbGA2KKJAgTpNZKrpGe7WiVe4CO8msev180lbpdP/4h76VKmKxyJkKICrjiGo1MrlV5GgaQZNe5Nk2khKqdhBnkDnnq4HGFdEX8Vl50/XdpC3hvjW9qm0drW1twcl/0rF2n4Q9Q== 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=khym6tocJO+MqHFAbIUCEuWpev7GPgSF8S0SJUpjlME=; b=htG6BmPZm4Bsb/3Y8RlFHL3606TDHj64kZ+FNj24YwNdJscY4HeAvunt68LB6PV0qfV92wNhMjD0A9baKIbE1IU9P35r88pNTSY0pe6JapkWJ1n7C8nWr8J4cbZkfD8+X7qxDH6zd5BJow3xlvwhlgCpFZAkcX6xnf54LyiACiMYwViVbRNFxlGZLH0TrcOoEo/SAY/JBgKVriZ/d3Sd9qJyx0URlIfG/1ZJ+NkW1qvcYelzG/oQgmIAbnq6gpq4+T9nIA6XNi7NIATK7C2oJLuhouCJquigwmDOLaYRbU3EG81IwddyG7XvroXkn7ZdCdUWh7In9dfubSGqERGxxA== 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=khym6tocJO+MqHFAbIUCEuWpev7GPgSF8S0SJUpjlME=; b=qc+CYIIFqVGQTIwAL+EAFlxYHX3WRSOfhNUts6Z9JIhMYQY+ys+rAOdPOBSJRcBCZjCsZBjxWpQr8QpHyT40ojZqdCJ06mH/bu1TC4N0zXvuQQNh64Gbk4XQwjJSW1Njm9iPjQHUpVSfB8KYLipr5uakOZs3kE+o4O3nOV3OOSU= Received: from BN8PR03CA0012.namprd03.prod.outlook.com (2603:10b6:408:94::25) by BL1PR12MB5995.namprd12.prod.outlook.com (2603:10b6:208:39b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31; Thu, 6 Oct 2022 13:55:53 +0000 Received: from BL02EPF0000C402.namprd05.prod.outlook.com (2603:10b6:408:94:cafe::c3) by BN8PR03CA0012.outlook.office365.com (2603:10b6:408:94::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.26 via Frontend Transport; Thu, 6 Oct 2022 13:55:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000C402.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.12 via Frontend Transport; Thu, 6 Oct 2022 13:55:53 +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.2375.28; Thu, 6 Oct 2022 08:55:50 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH net 1/3] amd-xgbe: Yellow carp devices do not need rrc Date: Thu, 6 Oct 2022 19:24:38 +0530 Message-ID: <20221006135440.3680563-2-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006135440.3680563-1-Raju.Rangoju@amd.com> References: <20221006135440.3680563-1-Raju.Rangoju@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-TrafficTypeDiagnostic: BL02EPF0000C402:EE_|BL1PR12MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 63afb30b-7e11-4972-803e-08daa7a27c43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cdgFy1Nj482eoFs7etoPKoiNW40yrN39VKvxiHFcdDQFc3M4bORN8aOuG4DwzUX/mPap7f7ryGwKqAbYC8ST8uu0ksCVhhT/Iu7Y5/antMb2MUJ8wpwgRV63hoKFTb8DJAOm5bHSxLRuUzwLkXpdRkUJFwuHHdA3NyqQEf1fJA3sQxc6kpArhg06R5qy46qt+cfgHhaT2bH+fq4p1UsG0UfFhQ94HUZUIxpbTc3adCeeHjqESyeULD6MsYpwFWu7xR7wAbWOTcuM/M7s4k1Fwq4uJh6y6VoaRmFCddn3MeVxlIbntXcQTWJ2Lugh17qDBM72paif6j+1cn05PFS2yUPH6h1vVsixso0DczG8k8adADjBPysSDikIEfPNjyJ/uyTX8F09LwlGtSPCEasl62mECd5yLwD6zOFQziqKasvGbJScHt53uMKlOIbj+eSoA666kDJgKRiunyskpbwNG7Jgjk3UPZE7v9zsMXNVe8gOfj1fzABsmTm9lzFigkwcDQBO0cEZRYkrNhnPxf2za3sjd/TQlO1hOCPW6/wrTcvYxPcoMkWBXjZUq0/nqG+ISpNVr/bXgY20PHOC+12yMI0cYFB0dCMndGAYcHszaA7orDG1imxD0WQi475EQOiWbvCieGalgobkiuF82qWHuTAmEcD6JFmdGBR0ge3RpkRGM9n7/3hTCgw98Htf2K4uMDad7KJJgxkHbO8BT19zfB+Mbuo+8sb5amNpNagDDWYPbp5UYO2vdaWCdQ6NQEX8f8GoVSlUFocE1Z+PnvnsHNtcMFa9CxbAW6EGPHJ119DxRGqT/i2XFI7WDMgOUAPX 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:(13230022)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199015)(40470700004)(36840700001)(46966006)(7696005)(81166007)(4326008)(54906003)(40460700003)(8676002)(478600001)(70206006)(70586007)(6666004)(41300700001)(110136005)(36860700001)(426003)(47076005)(82740400003)(83380400001)(8936002)(5660300002)(86362001)(336012)(26005)(1076003)(2616005)(2906002)(186003)(36756003)(316002)(82310400005)(16526019)(40480700001)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:55:53.6591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63afb30b-7e11-4972-803e-08daa7a27c43 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: BL02EPF0000C402.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5995 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Yellow carp devices disables the CDR workaround path, receiver reset cycle is not needed in such cases. Hence, avoid issuing rrc on Yellow carp platforms. Fixes: 47f164deab22 ("amd-xgbe: Add PCI device support") Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky --- drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 5 +++++ drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 2 +- drivers/net/ethernet/amd/xgbe/xgbe.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c index 2af3da4b2d05..f409d7bd1f1e 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c @@ -285,6 +285,9 @@ static int xgbe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* Yellow Carp devices do not need cdr workaround */ pdata->vdata->an_cdr_workaround = 0; + + /* Yellow Carp devices do not need rrc */ + pdata->vdata->enable_rrc = 0; } else { pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; @@ -483,6 +486,7 @@ static struct xgbe_version_data xgbe_v2a = { .tx_desc_prefetch = 5, .rx_desc_prefetch = 5, .an_cdr_workaround = 1, + .enable_rrc = 1, }; static struct xgbe_version_data xgbe_v2b = { @@ -498,6 +502,7 @@ static struct xgbe_version_data xgbe_v2b = { .tx_desc_prefetch = 5, .rx_desc_prefetch = 5, .an_cdr_workaround = 1, + .enable_rrc = 1, }; static const struct pci_device_id xgbe_pci_table[] = { diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 2156600641b6..19b943eba560 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -2640,7 +2640,7 @@ 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) { + if (pdata->vdata->enable_rrc && phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) { phy_data->rrc_count = 0; xgbe_phy_rrc(pdata); } diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h index b875c430222e..49d23abce73d 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h @@ -1013,6 +1013,7 @@ struct xgbe_version_data { unsigned int tx_desc_prefetch; unsigned int rx_desc_prefetch; unsigned int an_cdr_workaround; + unsigned int enable_rrc; }; struct xgbe_prv_data { From patchwork Thu Oct 6 13:54:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13000387 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36809C433FE for ; Thu, 6 Oct 2022 13:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbiJFN4h (ORCPT ); Thu, 6 Oct 2022 09:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbiJFN4e (ORCPT ); Thu, 6 Oct 2022 09:56:34 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2082.outbound.protection.outlook.com [40.107.237.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9C990830 for ; Thu, 6 Oct 2022 06:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cqsUHcGKr+8RsDCEdO7k8xVFAJ1Q12ADcj8Vp7WYkPOR+3jga8aiqvJD0adM3x5R9ZpsZAhzE+Kwii5eahOp7aYi11VO/VN5dkeKl1OilDM/k6XLFBXcj8N7auJEpcm1G2lKuWVaIeBTxYC33MgvvGaT31sLgnJqPLiVyxaAq+/88EvvQwyKWsr6vSsFJyNboIhhysTJk5C2LV++0SujETXZCLGisfoTJyrnO/ECCvOSQdrnW3v6fwQC0tHorYW5Ef6Vm2hDn44wz3un8dffsnhHUuleeOnMGODibVLDZHH/zJ7syX4/UXlhQhlV0O1NKYYKwsr58RG9oAmQT5Jebw== 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=RJTtWv/k7/+hxGHF0GtnNdwJLJdnkBq2kaXi1RVJy3k=; b=c5l/4E6ECZk390arAEBTTHT0Zwmndz7GIo1xZ8NAXY7sBVx9uI5suwskwlTSV/RyoloMlVuzaZRiKmmA9xK0d2iziBu6Hqrf5LYx6tvhKR5axr/O/z3Wlq9tqDVudpVw3im5VcwC3fJULItZDgqbdLsU/7R21ASI8ARaeTLXhyjwzugl4LSQGfmp08Dpe5w7HwXSVk5gh5eMm/mmNLCwvyEy1YkW8cVYg1vdGzmaTsgTazyBYVWJsMfxOLE1EaYNrqhKjOIodxSUXXNEIPS/AI1CYZqvuuBYPE2YUlkgjpaQKkOu3qdsfGcu5eHCR2VkJVl0D+QzZNM/BH3ifoNzEA== 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=RJTtWv/k7/+hxGHF0GtnNdwJLJdnkBq2kaXi1RVJy3k=; b=gDc0vKYlk8/VyasVAilZQHyV9oKLaCgtLJVX46ACArLRg3Cp/YjpS3PVC2bOjRFOqxnQlnMjGRha5b4L8X5t/w8zAMpohsPQ7Wcwxr7mZq/Ds2mm0C0XT4A2srNBWsCv0q8cHNPCvNIArbYP4hUyRI1xDLvHlTqK7s9TiUL6cTU= Received: from MN2PR15CA0030.namprd15.prod.outlook.com (2603:10b6:208:1b4::43) by BL1PR12MB5062.namprd12.prod.outlook.com (2603:10b6:208:313::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Thu, 6 Oct 2022 13:56:31 +0000 Received: from BL02EPF0000C407.namprd05.prod.outlook.com (2603:10b6:208:1b4:cafe::ff) by MN2PR15CA0030.outlook.office365.com (2603:10b6:208:1b4::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.34 via Frontend Transport; Thu, 6 Oct 2022 13:56:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000C407.mail.protection.outlook.com (10.167.241.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.13 via Frontend Transport; Thu, 6 Oct 2022 13:56:30 +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.2375.28; Thu, 6 Oct 2022 08:55:53 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH net 2/3] amd-xgbe: enable PLL_CTL for fixed PHY modes only Date: Thu, 6 Oct 2022 19:24:39 +0530 Message-ID: <20221006135440.3680563-3-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006135440.3680563-1-Raju.Rangoju@amd.com> References: <20221006135440.3680563-1-Raju.Rangoju@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-TrafficTypeDiagnostic: BL02EPF0000C407:EE_|BL1PR12MB5062:EE_ X-MS-Office365-Filtering-Correlation-Id: a4cb0aa4-2179-4340-53e2-08daa7a29253 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n2ERqHtpNciihdgsBURMJgJVIhcZlemSGVfV4wW3DcoQASHas3PfgzrIt9Jt+nNzTh5yZjDgksRtQzFnvLXf8i2rZJRcL33WWsUAWpJn6Hpm19AL2jnGKLW2ke9ofH80BonQmp/vO4QAoR8Fa8sZXVrtVTVXgtdPyVwz0HOKqhYK4LwalA3XfdpCVIuZnjK7trQ553GXqUcd1C+uqwuiBSLyq6OVUB+yVqqM5K8qliWUGvdC3PRFFQYirZTyJu18cawMUpcRqqKijowLuzc1bD/2xZ/rt/WIGhdFW3abxoYnxU/nhj/WPqAhETSERi8ZUYja4Rwt4klTgw31hVFMS3pt53tAvoQ+PDjya25/6UEneg3RAT/V9LjD7z1uzRDEc7yw+/UO2B1Iez/Gs/1fbja2DMCXVW/ttHM4B5ZE0s9HrAqQlG1YnN9o3mAHN9oRWxQPYymDSQkqExLXrazVL45ZlWz6MGip2FIvA0GnHLzkkRNXP7LwsP7s+4+HoxjJsWTCt3x9tntE3XZ/qkj1S/OjNCpx5I6dEEaELkUpDWcC2sp6SUhphZ3/jUzGxrklapIuAqrVajyMt8LGKRPh6aYQm/hyWbfwWYiTxxGYYw1VNb/X1DC9rf/Oorat08f/PC5AgiZjBNMmt2/NMT1nUTnpyaKxy3XjbWRmPHTUr+1dLOkJ+Ma8FW7uEMdFoOcuUCAV0XHdUM7U8Yf8mf+6/ZHUk1O8ejC7V41twJ9h0yKFzcdbL2WRnf5Lag6OtW5tzudzrjtXkEvbMMamx/+Fl5DwZwZ6lrlAM9gms3mVXzbDKUWHRvFaEQrkJFy4zzil 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:(13230022)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(2906002)(7696005)(36756003)(26005)(336012)(82740400003)(6666004)(40480700001)(86362001)(82310400005)(81166007)(5660300002)(478600001)(41300700001)(40460700003)(8936002)(356005)(47076005)(1076003)(186003)(426003)(2616005)(16526019)(36860700001)(83380400001)(316002)(70206006)(54906003)(110136005)(8676002)(4326008)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:56:30.7040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4cb0aa4-2179-4340-53e2-08daa7a29253 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: BL02EPF0000C407.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5062 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PLL control setting(HW RRCM) is needed only in fixed PHY configuration to fix the peer-peer issues. Without the PLL control setting, the link up takes longer time in a fixed phy configuration. Driver implements SW RRCM for Autoneg On configuration, hence PLL control setting (HW RRCM) is not needed for AN On configuration, and can be skipped. Also, PLL re-initialization is not needed for PHY Power Off and RRCM commands. Otherwise, they lead to mailbox errors. Added the changes accordingly. Fixes: daf182d360e5 ("net: amd-xgbe: Toggle PLL settings during rate change") Signed-off-by: Raju Rangoju --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 21 +++++++++++++-------- drivers/net/ethernet/amd/xgbe/xgbe.h | 10 ++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 19b943eba560..23fbd89a29df 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1979,13 +1979,16 @@ 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_ENABLE - : XGBE_PMA_PLL_CTRL_DISABLE); + /* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */ + if (pdata->phy.autoneg == AUTONEG_DISABLE) { + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0, + XGBE_PMA_PLL_CTRL_MASK, + enable ? XGBE_PMA_PLL_CTRL_ENABLE + : XGBE_PMA_PLL_CTRL_DISABLE); - /* Wait for command to complete */ - usleep_range(100, 200); + /* Wait for command to complete */ + usleep_range(100, 200); + } } static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, @@ -2029,8 +2032,10 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, xgbe_phy_rx_reset(pdata); reenable_pll: - /* Enable PLL re-initialization */ - xgbe_phy_pll_ctrl(pdata, true); + /* Enable PLL re-initialization, not needed for PHY Power Off cmd */ + if (cmd != XGBE_MAILBOX_CMD_POWER_OFF && + cmd != XGBE_MAILBOX_CMD_RRCM) + xgbe_phy_pll_ctrl(pdata, true); } static void xgbe_phy_rrc(struct xgbe_prv_data *pdata) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h index 49d23abce73d..c7865681790c 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h @@ -611,6 +611,16 @@ enum xgbe_mdio_mode { XGBE_MDIO_MODE_CL45, }; +enum XGBE_MAILBOX_CMD { + XGBE_MAILBOX_CMD_POWER_OFF = 0, + XGBE_MAILBOX_CMD_SET_1G = 1, + XGBE_MAILBOX_CMD_SET_2_5G = 2, + XGBE_MAILBOX_CMD_SET_10G_SFI = 3, + XGBE_MAILBOX_CMD_SET_10G_KR = 4, + XGBE_MAILBOX_CMD_RRCM = 5, + XGBE_MAILBOX_CMD_UNKNOWN = 6 +}; + struct xgbe_phy { struct ethtool_link_ksettings lks; From patchwork Thu Oct 6 13:54:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13000388 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10D90C433FE for ; Thu, 6 Oct 2022 13:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbiJFN4m (ORCPT ); Thu, 6 Oct 2022 09:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiJFN4j (ORCPT ); Thu, 6 Oct 2022 09:56:39 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271239D50E for ; Thu, 6 Oct 2022 06:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PKsMo67ZL7H3Kcg6iVcmIpKKFjGJ5QobMloaxcqBWjjtwCBfSV52My9ZL8DQ2LbM8UI+2gdpDFzOLe94xZVnD26T/4Oujf6v4AiArZQo4+diLFihbJ62yKzp8ZClRI2XLwGxvK4AqWigPneEDs8X0410dEcaxq3deOZhiEWOxpCnk19NkXHUNJ3FznIQ/sYCh488sosnGfDsqngQ459Cc8BG/FUSXOp3A0gwrQbt1phL6h1lANyRuCGDsaMcGFRgrCAfu38jdO0Nh44Fls1iGqsPMgdFQRSkITt2NWScggapa1mxDnJMZn1uk/xISLo91C5NqWESAoGsKVRPTNCULg== 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=vEKS6qlYdqBtALbsSV3/yAqZCdHs8i61rltlw5FIVtY=; b=VA8G+djhRpw54kh0T0JJ+odnNnstT1C/k7GFjVGkVQJhJ4+Xabm5ErG2WXnM3tZps+FTWfpg4DVy0fCF9lMMvREtru3tISuveysMoWTFQgovQyz8Cyi7ybzOKbhXsoK/SvNFcpWtFm+qMI9/9ucjLyPyRDWYOOfTkdCz1FNtAJmvM65U8gwUu9cv2HA7A9ylLV+eLtNaPfjKk0v/EbBd/dhi4d/0RB9zMMjl2x7E8X29txIEJ6XSQHNPAifN5PztvjKVirYhMVRoCiv3Z0WaZ2ke3ySMHHeicv0pNqGe/clZIXkD0S/lEWbCaWFh0fT47N+x+aJKp7okPlklokhs+w== 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=vEKS6qlYdqBtALbsSV3/yAqZCdHs8i61rltlw5FIVtY=; b=HPrVR++c8KDB5IN3Al0aRbH/34KaQ470WZ/iF/Is8+Hi+E3+3WEAOjv8/BWO5xUlJbCU6Eztikx0uH1xQvrM2V5LNO+unswLwXXnBoK+AF//mgjtUE+obBNut1Xq8fjAPDaClJYNmnTbufH2HcQ1rj8T8Zz107jT4+z87ZBrMuU= Received: from BL0PR02CA0017.namprd02.prod.outlook.com (2603:10b6:207:3c::30) by DM4PR12MB7622.namprd12.prod.outlook.com (2603:10b6:8:109::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Thu, 6 Oct 2022 13:56:33 +0000 Received: from BL02EPF0000C403.namprd05.prod.outlook.com (2603:10b6:207:3c:cafe::87) by BL0PR02CA0017.outlook.office365.com (2603:10b6:207:3c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Thu, 6 Oct 2022 13:56:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000C403.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.13 via Frontend Transport; Thu, 6 Oct 2022 13:56:33 +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.2375.28; Thu, 6 Oct 2022 08:56:30 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH net 3/3] amd-xgbe: fix the SFP compliance codes check for DAC cables Date: Thu, 6 Oct 2022 19:24:40 +0530 Message-ID: <20221006135440.3680563-4-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006135440.3680563-1-Raju.Rangoju@amd.com> References: <20221006135440.3680563-1-Raju.Rangoju@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-TrafficTypeDiagnostic: BL02EPF0000C403:EE_|DM4PR12MB7622:EE_ X-MS-Office365-Filtering-Correlation-Id: e872ddbe-0727-42a7-a795-08daa7a293c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RpTPGoeIQECn218nOI2HSSE46jL+KxIulShZm9EXshT1tfxMwBOTI7GXCMwNq4tdcX5OnrJ9ELN32V7YE7VbMF7vVdx4N0N3tRD0S7dEtgKMcXU5dTzeY8VBnKOkflEgeWNPIdeixPja1QL7MDEuUu2P/Vwguw5W6RBCEAPaFhIPt+J3XDDg0z13Aa/mudrt2ubW2YwFaaVYIJAZk/oMijLHrMfQWZx5UDbPIuScfXelfmUTk/D+t2QdAoH74LpTZyorWxc/dwdRAy9vEy+WyvZcF7ekmSPr3VYIT/oakeX1nIw2kVgtFRUkVY3ndiq8m6KXfht0AXosa+5rNCmM8EJCbqasZT9Oj5MHp9CQbsaD4x02D8hbJ/Sr7BQLSbCF5b3r+bdqxK84DNAhyFo7Nu4zRiw+9AYhS7SRJIPfIlD4WPVT2UjJjWg5VgGzyJXkRDmKJWw+Jf5z3+fQ/RpB/EcM6EZDmbmDfSGJylDwELlnmLoYej05HZVGUuUhd/jyyMX3BPz5MrfB2IDGGLZNEWRl9kw2PhZ/kasfA+RVcp0u7yqBJMTXJM1Qfji6sSPag0cLGQrbQXdXqx8FVYb5DHEjpD4GWI3T39bYicTU5EPZOgwuvD+0YR+XYcmCLmPr11PPLK9ocrVvU/iszPA022NSI/YVFtA0EwDlfPnL02hG+xLhCixeen02VD3nVBnowSBf/jQwRIbmqyvU1qC95+qus3tPUaSdwJBq6V4TDQ7XzoCxXApEjA14oXdFZ8liNBma5op9GepoWOP9v+5T2GTm3X8Z0pssmU16M+BO11M= 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:(13230022)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199015)(46966006)(40470700004)(36840700001)(83380400001)(186003)(426003)(1076003)(336012)(16526019)(47076005)(2616005)(82740400003)(81166007)(36860700001)(356005)(2906002)(5660300002)(40460700003)(8936002)(110136005)(41300700001)(86362001)(40480700001)(70206006)(7696005)(316002)(26005)(478600001)(8676002)(4326008)(70586007)(54906003)(82310400005)(6666004)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 13:56:33.1047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e872ddbe-0727-42a7-a795-08daa7a293c1 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: BL02EPF0000C403.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7622 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The current XGBE code assumes that offset 3 and 6 of EEPROM SFP DAC (passive) cables are NULL. It also assumes the offset 12 is in the range 0x64 to 0x68. However, some of the cables (the 5 meter and 7 meter molex passive cables have non-zero data at offset 3 and 6, also a value 0x78 at offset 12. So, fix the sfp compliance codes check to ignore those offsets. Also extend the macro XGBE_SFP_BASE_BR_10GBE range to 0x78. Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Raju Rangoju --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 23fbd89a29df..0387e691be68 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -238,7 +238,7 @@ enum xgbe_sfp_speed { #define XGBE_SFP_BASE_BR_1GBE_MIN 0x0a #define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d #define XGBE_SFP_BASE_BR_10GBE_MIN 0x64 -#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68 +#define XGBE_SFP_BASE_BR_10GBE_MAX 0x78 #define XGBE_SFP_BASE_CU_CABLE_LEN 18 @@ -1151,7 +1151,10 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) } /* Determine the type of SFP */ - if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR) + if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE && + xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000)) + phy_data->sfp_base = XGBE_SFP_BASE_10000_CR; + else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR) phy_data->sfp_base = XGBE_SFP_BASE_10000_SR; else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_LR) phy_data->sfp_base = XGBE_SFP_BASE_10000_LR; @@ -1167,9 +1170,6 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) phy_data->sfp_base = XGBE_SFP_BASE_1000_CX; else if (sfp_base[XGBE_SFP_BASE_1GBE_CC] & XGBE_SFP_BASE_1GBE_CC_T) phy_data->sfp_base = XGBE_SFP_BASE_1000_T; - else if ((phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE) && - xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000)) - phy_data->sfp_base = XGBE_SFP_BASE_10000_CR; switch (phy_data->sfp_base) { case XGBE_SFP_BASE_1000_T: