From patchwork Wed Oct 19 18:20:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13012254 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 1989DC4332F for ; Wed, 19 Oct 2022 18:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbiJSSVt (ORCPT ); Wed, 19 Oct 2022 14:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbiJSSVs (ORCPT ); Wed, 19 Oct 2022 14:21:48 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2057.outbound.protection.outlook.com [40.107.212.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D691B94ED for ; Wed, 19 Oct 2022 11:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDv+9mDbFNmacNiTOQLZyfgP7bPA5yvTCsqFYYzi2GLPQKAe5NyEFi0RwqpPqplEoL4xeEw3PkCcDzCst0+u+kHKcrgxpcZ+VojCxNzOeWE3RqnOTkwI9x3AHhQx9LM3qPYPHd9Dpqv4OJ6Fj2tLyoW98vK85vt3Z6Gc3U7Ve3pZwhnWVeVokSt5EWPPj7HuxjU5QHwRsw9RhE1DnQOgxnXFQloxhywwc2NkjEueZQ26P3pn+AiROnVrFMCAcCYcZpyJrWuGIaXjk6X0X0CnhfPyQxSiPwmrFe5nwBnAWZASAkQGiIKQ3ErJpZojlVBJYaoAudeXSnSKXxsjbr8kbQ== 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=i2u0j5NaN1BtHwhcTaOHNhBL/HukfFzknnMzjDa5YZ8=; b=OSr92p358q7u3TewITJqBWSQmNnri7ApUTov1fubZoa3QGUCbDFjh78sObYl0dyNujCtD3+B1XxkY+wceaBz+xWz9vS2u7vjp3PELQqF41HvbGp8jTFN+bjafhPxVE9NzKy62Xkt/3WT4IKPEaNnxwNHF4EX5SLhW7qzPKwF4/qgUdFMedzp1U6Oh5+EvLdZd04c/xHYeAIUMKbbPR11JxKLibkKBTw97w/YiGuhgsslwl2Ita0EvdPMg84uAfsqpigEfCVrQPg5fNAWhwYU/EA6Kak86FFhuwq58C5f27TKGTzJcy5+HDHtay1svUoKo5vUg3hBgs/1yCYyu2IjQA== 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=i2u0j5NaN1BtHwhcTaOHNhBL/HukfFzknnMzjDa5YZ8=; b=LoQW79TybbvSUhsdI8+6CfBybtWMls0fRWWhfIi5oFFee+cOP4FJeBoT21XopcpGlamzrj/grHcsdmdMtOBLn3WfZJgc5kkqgvtK4nx3969/I1i0F4hthYhVnpqP3GrzQ0FmPKjz9H3A9+JrJg5mHLzhv7dx6nIJSwNxS9+ScZA= Received: from MW4PR03CA0080.namprd03.prod.outlook.com (2603:10b6:303:b6::25) by SN7PR12MB6912.namprd12.prod.outlook.com (2603:10b6:806:26d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Wed, 19 Oct 2022 18:21:44 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::b0) by MW4PR03CA0080.outlook.office365.com (2603:10b6:303:b6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 18:21:44 +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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:21:44 +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.31; Wed, 19 Oct 2022 13:21:38 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH v2 net 1/5] amd-xgbe: Yellow carp devices do not need rrc Date: Wed, 19 Oct 2022 23:50:17 +0530 Message-ID: <20221019182021.2334783-2-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019182021.2334783-1-Raju.Rangoju@amd.com> References: <20221019182021.2334783-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: CO1NAM11FT082:EE_|SN7PR12MB6912:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c61cce5-0c97-4219-1344-08dab1fec6f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Ur7vKXsJduyieF33dn+XtG/Y4wIVrOtI7MhuH3xMQNk5qrF5Ha24IgoKaL6hbTEFtCEKhWLngsaEB8UvRiCACyw7Aj5EG8ULD0oVtYuGEhTV3WxQTcNWuQNY9Mam8/Qzd0y7e7SsSxdc5PJ2RaFe40GJ+aR9TVMoLg7UcsNcYn2siuf6MxzbiSpbCBL3qyHeEUnYYuv8o75nlekQDAShFeDbhVzF2ghsM6sgxHyqZ8kBakwmgCysOhYRYEqStv/7Z675a0p0TQpO0cMMJYMqXprLjQ5vnQR313agdV+P0Db0uKgnIfcMdu5ufDGzYu1nATC/gRLLLLlLj8F4n08bYc5PuM4+iHC3JwOiJJaD7FlSPadv7SFF6xUioAfzslpNjb7j0qXAUZqSVu6TWIZJHOHbgGpwbB+hsB/K+PtbmxbUQIzuRh/UxM24BLuuz8HFOo01gMwdbgZMCrInmfaC/wKeq0Usq8QuLRNzQv9ZH9wl1kKPZkPPtebdaS3mfJVRCFeFraoXh9q2yUAwxQ9fhxgsaRAfun1BmT5Uu0oAzoPpUlBqAGvagJwqFLXudRqe7AyIrXs8igSnrwcNwHjFTZKo4WGyaBcGETPgmrAgrMfjyb7yInR5ZVfI/a5JLbTpxJnKKjTOROKfdTLYOkGXmQWCThNe/YQZBGbleQd6kT9gaFO4bFXAktrdafesxlKa3heGYMO2+CzBooUrjVK5EK9IOKS9+VxLwNfe9wfaapo8PM04zU00/rS/21G54gYW/mrnnPAxVP8eCdy/SspClAjTPN5L58jLIxG9J2Mwl0= 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)(346002)(396003)(39860400002)(136003)(376002)(451199015)(46966006)(40470700004)(36840700001)(82740400003)(70206006)(36756003)(478600001)(8676002)(6666004)(6636002)(54906003)(70586007)(4326008)(41300700001)(7696005)(110136005)(40480700001)(1076003)(16526019)(82310400005)(336012)(26005)(2616005)(40460700003)(36860700001)(83380400001)(81166007)(426003)(47076005)(356005)(186003)(86362001)(5660300002)(316002)(8936002)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:21:44.2649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c61cce5-0c97-4219-1344-08dab1fec6f9 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6912 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Link stability issues are noticed on Yellow carp platforms when Receiver Reset Cycle is issued. Since the CDR workaround is disabled on these platforms, the Receiver Reset Cycle is not needed. So, avoid issuing rrc on Yellow carp platforms. Fixes: dbb6c58b5a61 ("net: amd-xgbe: Add Support for Yellow Carp Ethernet device") Signed-off-by: Raju Rangoju --- Changes since v1: - Use the correct fixes tag - Update the commit message 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 Wed Oct 19 18:20:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13012256 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 77314C4332F for ; Wed, 19 Oct 2022 18:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbiJSSVw (ORCPT ); Wed, 19 Oct 2022 14:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbiJSSVs (ORCPT ); Wed, 19 Oct 2022 14:21:48 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2080.outbound.protection.outlook.com [40.107.220.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598AA1BE416 for ; Wed, 19 Oct 2022 11:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YFKQVm5HUZP3es2B4yBG5Lfe70JG1Va6FktZIaffeeZ+gJ0XB0PzuJdrijAuCNk7bDZ39e5LUmBMhIpmbfTP+Vway3tZY39WUeOAYkUplrOJB9JfB0WPFZF9oVPsBIZJiKcFh4MO1eJYsiDmSgxp9YenyEIpuGEEtR7sAf6mpWwhADFxXrXl64Fzqez8O3lI0m0GIb0jzEFmxMNvZyCwPBgOVLL/9ovKYJvd5L4erOIPshve8+SNrKRsJxqEkLCJRGgISm5H+9EnSoD84itTqK7YdD1Bn1ym2pR3bV2XtlPqvSrfesb0r7WtTbdtF02F+1cp9uKkGL5jDbjNi6Uf1A== 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=yGlSxQPXyzrUzd+jYSzF6choFX6TtKm4HvOKGJ9qOf4=; b=AhQJgCqO3qebOxVmkksEHD9qUgAq/ClX1jPBmp0X6Bp9a+EhxZ3H8Y6TU9+yIvzxQAtupWZTP7zvTs/Cqkp+bB51gwLMSe0tUJ4Nl8J7MRsge9vdsyW8ylITlEB2jC4S+yAEtSnGc60MAnrWrnUe/W4OLAipI98IRHg+GVXX8eZfbO9HiMT099ieTWdGAk6Pm3LPYxNT81Q8f8aTNnpTSbWEMMoArFzUOUCL1DxJdlc5+9jcSEFuTmoPDJ5ixsO0j5qIzWeZ4p2OQE1ZPmaMFM25LxFUiHW8AhgMinvwGXSWaE3EveQs43zRKGZSQW5yECiwkIA6yry4GjV3sXgRtQ== 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=yGlSxQPXyzrUzd+jYSzF6choFX6TtKm4HvOKGJ9qOf4=; b=B7zib8316e1SpE7wo6V3aL5/d++EraNir3zF5PJbDOr//nK7CClN3/CG0iGU4S1hT8dfsggxX7huYTumoV/6EnmcU+86rjMq2Lc4NbjSf5ivZUaTr3TA0KF8yyLT+4ihntO23b0pr5Ofqdrwqeb7TES8Tv3R//4kJDtlBuFyAcA= Received: from MW4PR03CA0062.namprd03.prod.outlook.com (2603:10b6:303:b6::7) by DM4PR12MB6256.namprd12.prod.outlook.com (2603:10b6:8:a3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Wed, 19 Oct 2022 18:21:45 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::c4) by MW4PR03CA0062.outlook.office365.com (2603:10b6:303:b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 18:21:45 +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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:21:44 +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.31; Wed, 19 Oct 2022 13:21:41 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH v2 net 2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds Date: Wed, 19 Oct 2022 23:50:18 +0530 Message-ID: <20221019182021.2334783-3-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019182021.2334783-1-Raju.Rangoju@amd.com> References: <20221019182021.2334783-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: CO1NAM11FT082:EE_|DM4PR12MB6256:EE_ X-MS-Office365-Filtering-Correlation-Id: 721182cd-c77b-4d34-9709-08dab1fec75f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: smsnQQuuux/pPSZ3QV1x8JD9H7W0ye7nu24bdr2XK1ZZzHBnMF3U8i8k/ew0Y+P5ox81VQjcTejhVNSRsaKH1TxrMKswq2Rq+89TpbATMny7+nslOOhuB/vT+JSAbAL7CWrY585lwJ/U1INnqMy0bCxo6DBNqUuAXnB78Wt8ze0KlW8u9CROuEvhHDP/EYz+xo7b0TALXBZzZvlLr1Tbf8owPr5Xq+rSVK1LzFj3X6/6sYDvZZmx9bBgICiStxb+VCXwLeTyi+PYWFzXxEqgsVscomPWxLSpQjSmUy5i0gQkMGCjAbRkCHHAvq5VMFVXLPVUEJNLRs3l7XvMt8Dfrgpe0EGDsbVkZFMo3d2H52W6J4th27Zj8aDLQyrmtaZi9vsn2YnQNt++uHKU7gOda+tfGLWmAn1h5Gz3qiv0jbStHYMQRp6dg3utjTbulLcwUYvqZa2Z0BjkkX1e3oOEdIA0F4Q/OqN6l86VWn5v/1P0GP2dGPATXXyk53UEydH8Muquhn/l0N2IrNZ4/C17RgJ9a7iFzaXR/M4VoPZ3jpoOlXOcdCRvXUirrw0xAnt3N7MNh84hDzLo/LhhLvGZnlLbnbJfL85h3pZrtMaZ1hOwgnX4n16hJzBBgisKmm0Hj0bhbSqhN0QWgq7SYWCTjUpqRP1XK0qGYscLl0ZGrg4M5QHH63Hx6YbLXqKll2ycVjp1UI2UwEOMuvL3b7DnU3e0aAZds5S0zXvCxNPU8NFqYHD/912+lHpMVTfANfOydegSuRsrExgNdv1vgXPMGma0g1MFsVrjFuPFuaSepsMIP0alq2AY89mGa+Grjj9K 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)(136003)(396003)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(6636002)(186003)(2616005)(36860700001)(1076003)(83380400001)(7696005)(6666004)(426003)(47076005)(26005)(336012)(40460700003)(16526019)(2906002)(15650500001)(5660300002)(40480700001)(316002)(41300700001)(110136005)(82310400005)(8936002)(478600001)(8676002)(4326008)(70586007)(70206006)(54906003)(36756003)(86362001)(82740400003)(356005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:21:44.9367 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 721182cd-c77b-4d34-9709-08dab1fec75f 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6256 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Instead of using hardcoded values, use enumerations for mailbox command and sub commands. Signed-off-by: Raju Rangoju --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 29 ++++++++++++--------- drivers/net/ethernet/amd/xgbe/xgbe.h | 25 ++++++++++++++++++ 2 files changed, 41 insertions(+), 13 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..8cf5d81fca36 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1989,7 +1989,7 @@ static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable) } static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, - unsigned int cmd, unsigned int sub_cmd) + enum xgbe_mb_cmd cmd, enum xgbe_mb_subcmd sub_cmd) { unsigned int s0 = 0; unsigned int wait; @@ -2036,7 +2036,7 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, static void xgbe_phy_rrc(struct xgbe_prv_data *pdata) { /* Receiver Reset Cycle */ - xgbe_phy_perform_ratechange(pdata, 5, 0); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_RRC, XGBE_MB_SUBCMD_NONE); netif_dbg(pdata, link, pdata->netdev, "receiver reset complete\n"); } @@ -2046,7 +2046,7 @@ static void xgbe_phy_power_off(struct xgbe_prv_data *pdata) struct xgbe_phy_data *phy_data = pdata->phy_data; /* Power off */ - xgbe_phy_perform_ratechange(pdata, 0, 0); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_POWER_OFF, XGBE_MB_SUBCMD_NONE); phy_data->cur_mode = XGBE_MODE_UNKNOWN; @@ -2061,14 +2061,17 @@ static void xgbe_phy_sfi_mode(struct xgbe_prv_data *pdata) /* 10G/SFI */ if (phy_data->sfp_cable != XGBE_SFP_CABLE_PASSIVE) { - xgbe_phy_perform_ratechange(pdata, 3, 0); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, XGBE_MB_SUBCMD_ACTIVE); } else { if (phy_data->sfp_cable_len <= 1) - xgbe_phy_perform_ratechange(pdata, 3, 1); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, + XGBE_MB_SUBCMD_PASSIVE_1M); else if (phy_data->sfp_cable_len <= 3) - xgbe_phy_perform_ratechange(pdata, 3, 2); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, + XGBE_MB_SUBCMD_PASSIVE_3M); else - xgbe_phy_perform_ratechange(pdata, 3, 3); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, + XGBE_MB_SUBCMD_PASSIVE_OTHER); } phy_data->cur_mode = XGBE_MODE_SFI; @@ -2083,7 +2086,7 @@ static void xgbe_phy_x_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 1G/X */ - xgbe_phy_perform_ratechange(pdata, 1, 3); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX); phy_data->cur_mode = XGBE_MODE_X; @@ -2097,7 +2100,7 @@ static void xgbe_phy_sgmii_1000_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 1G/SGMII */ - xgbe_phy_perform_ratechange(pdata, 1, 2); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_SGMII); phy_data->cur_mode = XGBE_MODE_SGMII_1000; @@ -2111,7 +2114,7 @@ static void xgbe_phy_sgmii_100_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 100M/SGMII */ - xgbe_phy_perform_ratechange(pdata, 1, 1); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_100MBITS); phy_data->cur_mode = XGBE_MODE_SGMII_100; @@ -2125,7 +2128,7 @@ static void xgbe_phy_kr_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 10G/KR */ - xgbe_phy_perform_ratechange(pdata, 4, 0); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_KR, XGBE_MB_SUBCMD_NONE); phy_data->cur_mode = XGBE_MODE_KR; @@ -2139,7 +2142,7 @@ static void xgbe_phy_kx_2500_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 2.5G/KX */ - xgbe_phy_perform_ratechange(pdata, 2, 0); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_2_5G, XGBE_MB_SUBCMD_NONE); phy_data->cur_mode = XGBE_MODE_KX_2500; @@ -2153,7 +2156,7 @@ static void xgbe_phy_kx_1000_mode(struct xgbe_prv_data *pdata) xgbe_phy_set_redrv_mode(pdata); /* 1G/KX */ - xgbe_phy_perform_ratechange(pdata, 1, 3); + xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX); phy_data->cur_mode = XGBE_MODE_KX_1000; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h index 49d23abce73d..71f24cb47935 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h @@ -611,6 +611,31 @@ enum xgbe_mdio_mode { XGBE_MDIO_MODE_CL45, }; +enum xgbe_mb_cmd { + XGBE_MB_CMD_POWER_OFF = 0, + XGBE_MB_CMD_SET_1G, + XGBE_MB_CMD_SET_2_5G, + XGBE_MB_CMD_SET_10G_SFI, + XGBE_MB_CMD_SET_10G_KR, + XGBE_MB_CMD_RRC +}; + +enum xgbe_mb_subcmd { + XGBE_MB_SUBCMD_NONE = 0, + + /* 10GbE SFP subcommands */ + XGBE_MB_SUBCMD_ACTIVE = 0, + XGBE_MB_SUBCMD_PASSIVE_1M, + XGBE_MB_SUBCMD_PASSIVE_3M, + XGBE_MB_SUBCMD_PASSIVE_OTHER, + + /* 1GbE Mode subcommands */ + XGBE_MB_SUBCMD_10MBITS = 0, + XGBE_MB_SUBCMD_100MBITS, + XGBE_MB_SUBCMD_1G_SGMII, + XGBE_MB_SUBCMD_1G_KX +}; + struct xgbe_phy { struct ethtool_link_ksettings lks; From patchwork Wed Oct 19 18:20:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13012257 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 BDA22C4332F for ; Wed, 19 Oct 2022 18:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbiJSSWQ (ORCPT ); Wed, 19 Oct 2022 14:22:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiJSSWO (ORCPT ); Wed, 19 Oct 2022 14:22:14 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2056.outbound.protection.outlook.com [40.107.101.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13431183D92 for ; Wed, 19 Oct 2022 11:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Osibz9bDUJj7PpCSk0SKDj5lkxcehutba4OieI6m6kbQK+Gx8C8+6XXurOa2QJ/rlkheT5iFwrxUpw7z8yUQxcKJ2ppqPM/76hAOc1pCDGE9QPibUQ3hFs5qAPK/x/inrcKhgV032jziYrwiryMDpXc4GyXiRtOc1UVmvvhhgZcpo6a7VkSdDHU36OUyHL0YP/I91xuL0vMSrZuQsYJqOfI0GpwabsYiiUc+DGApNvoAy3EVPJSnQqwRySL2P5yiXThbm1CUhcISmUXVfnCQRd5rgilkmeaSjNS8pSwG91aOBQ5Y6eHcbNpr9kC0c0YVGwBGxUiY3So/Qpgi87o1pQ== 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=FmcoAN+AvWd7F5ynyTUMOjQjWTLt8+++vKix8oaSc5w=; b=L9U/dlHC2+k9rDaT2Vn48CitdASpaslWKTyeZs+VafylAQrCsm6VLvgUZBn8V2EEN447W3LfrNpsggM+wZ/iryXMzaii2cgg5xAmDUMSTh8OqpDoNGQE2we77+MJfWkj3esw1FXQrlU5AVNiREAtFU25Uky8Ku06vgkxCpp+gkMtn95cpAPKon/vUOzfJ/EQ1IZcQvcydBedymz9eo9Hoz1cRpToTCc/pmpSIEljjHmQdDiFuqyj8+MAMcpce911gQ/bYoc8nsAo8/gmqwyQN+yQZK3yCOaVObJV1b3f9hm9tcDleXhnjQ4nXeMuJx4mo0snkvAJyAtkNEnYwkhx5g== 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=FmcoAN+AvWd7F5ynyTUMOjQjWTLt8+++vKix8oaSc5w=; b=xOfmV93TW42YgGxPQAYEQImXnJD0TQMVpM5qHpaTgdrkfPZ1U/r9EtYbGddWwXX8Xi0+PuLva/gAslpPpx7qVH2I/4E5Ap+Wd3/CsekgecYCj+n7AG13gurWbUGbYupGZcN7IWsYU3vHDPp0jWX7kDcfTTP/UHE1PZGDon3x4vM= Received: from MW4PR03CA0077.namprd03.prod.outlook.com (2603:10b6:303:b6::22) by IA1PR12MB7685.namprd12.prod.outlook.com (2603:10b6:208:423::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Wed, 19 Oct 2022 18:22:12 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::a0) by MW4PR03CA0077.outlook.office365.com (2603:10b6:303:b6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 18:22:11 +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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:21:46 +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.31; Wed, 19 Oct 2022 13:21:43 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH v2 net 3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only Date: Wed, 19 Oct 2022 23:50:19 +0530 Message-ID: <20221019182021.2334783-4-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019182021.2334783-1-Raju.Rangoju@amd.com> References: <20221019182021.2334783-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: CO1NAM11FT082:EE_|IA1PR12MB7685:EE_ X-MS-Office365-Filtering-Correlation-Id: 794c4fe9-177e-4ed0-0b5b-08dab1fed71f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MVbN+zbXF7BODJxVQlck2OsmoIUsFTboHxCVCjptkV/uMfRWm5QrXah/IfVww5Mq4gX5sDIuiklwBj8wpdFaUByTqYsrnG6XWEkUayOA+DTAcSw/XFlEw1WD1wAW+mtqRBNMIyPAWCREt1ENtUFhZiabE29X5iMF0VZW0rHjmkfjqYFWwHLZ9YsYRVfETCOE3HSdjtNDVF5SZ1a2aAMrYsGOPuGHbhHpEd2xNgFq8hQThGqSCWAFfQ6NhR4Uruiuv/5t7V6Uj17bY6LRuHkEkKAhXe3hyemc6e24Lyq8dJpnSjpQrFHWdvUNwdwppALtkqTKCel+LsBfdZRNE4eyw0ySlUlAQ3IpgWDOYds6zFaLSnFFpKc8HBPImY7dsoRX/mkwDeM/zG5Sr9OnWMcMiNLdOGpCp+fgNYMneUx8kWfD+8ZqdY+PPwenJUpay+dVWM9Bq2tE0TctmF9/L1mBHpUjSuwVyUK0V2gmsPFVEhCP9y7/9M5O4AOPw+KBLLMcrjOW5jstQ9sG5ht9MZ230F1LVw3lXBWM5Inyai8cEFgj4MsT//0USZYnK1qabiztN9hk0w4fsKdoiNka/1NhTFuN4bKn9ewZSbG25HO6LDuy54hv7ZyXcmwaZHYdZFj8iwfdFjzdk+uCL+0v82oJ/aYDWfupgv69d8cN9VJIQgItPYk0MrSxafrG00nHOrOc8YYmonaEjB2NZp9tfPfGsZ9eC/OeRlvTO7b0AglTV3nimyynWonSnOAFnGqWLMJ2nVJb/anYebi1tJ9xqA96aG8jfT6AhYtK4ap293KGXS4Bp7gSQCdJ4OIwxNtuxsQZ 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)(346002)(396003)(39860400002)(136003)(376002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(40460700003)(7696005)(110136005)(26005)(356005)(82740400003)(86362001)(81166007)(4326008)(8676002)(5660300002)(2906002)(8936002)(41300700001)(70206006)(70586007)(83380400001)(47076005)(316002)(426003)(186003)(40480700001)(6636002)(54906003)(336012)(1076003)(2616005)(16526019)(478600001)(36860700001)(6666004)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:21:46.5460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 794c4fe9-177e-4ed0-0b5b-08dab1fed71f 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7685 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PLL control setting(RRC) 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 RRC for Autoneg On configuration, hence PLL control setting (RRC) 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 --- Changes since v1: - used enums for all mailxbox command and subcommands, pre-patch to this contains the enum updates - updated the comment section to include RRC command - updated the commit message to use RRC instead of RRCM drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 8cf5d81fca36..b9c65322248a 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1979,6 +1979,10 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata) static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable) { + /* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */ + if (pdata->phy.autoneg != AUTONEG_DISABLE) + return; + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0, XGBE_PMA_PLL_CTRL_MASK, enable ? XGBE_PMA_PLL_CTRL_ENABLE @@ -2029,8 +2033,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 and RRC cmds */ + 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) From patchwork Wed Oct 19 18:20:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13012259 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 B95E2C43217 for ; Wed, 19 Oct 2022 18:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230376AbiJSSWY (ORCPT ); Wed, 19 Oct 2022 14:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbiJSSWV (ORCPT ); Wed, 19 Oct 2022 14:22:21 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A30311C73CC for ; Wed, 19 Oct 2022 11:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCrtd0GXN98w/ASNIWreTsSC57r2C+EVTRbs47C0LvFXbtoHHdOiPbjKmpRtxhQYBeNmebs2xaS6R9Z8mi1L5iBDY0oxFTWvwLaVZnECWfk7X35ot9cuueghsVU8DYQFQPNFPO0ZyK1T4qp1yMXxH0UgJUnFHE+PQtqOR2GNBwqujvybKAfurHOfuzQZ1THg2k8eM0ZDtIOkxCKNVFExFC0DQpgtpvO5N2aUBt+lRTIQWG7MUPSagR6tuH0AIs+KdK9QKstTAFKMvs8qoGkBokSLUJe5ABymlBd4FLX7RNZ5ADhMCeb+QONPFasU8nVZYRUTZCRP7ZjFsH3RaP7xDQ== 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=3Fbh0Wp0xZU/4cIvHMaLUssSL7Zb/hyNx82Kl4jwkTU=; b=kov5qCSkJn92vwdCSptn75WpNuJIRbRseEp3OFdkGvStaxCuUbfsDBpHsd/pAv/lNVbzVXqHRi6JCNniSAlwiJndSJYX3V2xd97Wr6U6CoMhHbCOauqb5hWS+rrZK+qBBs/FstHZdUcW6gzBmzV1SNMDMtSqzFA2ZKk+yKk4dP1lCP7lstEnP9jpdP5ImcG3l5vNUdf/QsRlK5B08jc6q7tcdSgfDmxI82SuHpoox1ydo0sPcDOPb5dqSvbBMjHmtWW27TgyV+B49eIEDUF7bdfC4JUCclqLC+W2br7Wh7LFoNhzWBZDa0kNsXbAsGVEi6nwyY3X7pi9L97DT8U65w== 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=3Fbh0Wp0xZU/4cIvHMaLUssSL7Zb/hyNx82Kl4jwkTU=; b=b9AC6LaNz9i9DS5kUhGUKoN/fPl+H3VMEzxY+AenfjVk8ub+1WJ9Ss3cF+kaLibCsoG562CXsKts3TZRqMXaGd9ecy+GIm6B2pA1IzdQ7bkqexqUvHG1g8MGOv7u8puEXM5cLAyn5rZSe35aUVcsyjSC7K/V0xUGw0vqF2q8yEM= Received: from MW4PR03CA0079.namprd03.prod.outlook.com (2603:10b6:303:b6::24) by BL0PR12MB4930.namprd12.prod.outlook.com (2603:10b6:208:1c8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Wed, 19 Oct 2022 18:22:17 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::52) by MW4PR03CA0079.outlook.office365.com (2603:10b6:303:b6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32 via Frontend Transport; Wed, 19 Oct 2022 18:22:17 +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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:22:16 +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.31; Wed, 19 Oct 2022 13:21:46 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH v2 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables Date: Wed, 19 Oct 2022 23:50:20 +0530 Message-ID: <20221019182021.2334783-5-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019182021.2334783-1-Raju.Rangoju@amd.com> References: <20221019182021.2334783-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: CO1NAM11FT082:EE_|BL0PR12MB4930:EE_ X-MS-Office365-Filtering-Correlation-Id: f52cccf5-41f7-4261-692b-08dab1feda6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kWuXyiEGf863jvtQloMMO2sOL+koir/k80Ldn73bmwL4UldNdoV8030CLgwLPILCFLso43yNMbky7oR7kTunkiB65zsVLd4ldg6yNA/+64HSN0/+65xD9yNsWSV//nGFJGYRRd3nfqVzpZgNHHYA3hX9SbQU7CM4ns9Kgt30iijMnLLYRGhANZfZgoiHRP0HD4RGx/QSqUmkfeke2eHnpWPya8t9P4CFGQ1FwfXQPJpM/+y/eHIboNLR+LCUddKqYvdCgwT9zfHckmb+DPhsapE8P3ENJO926MtgutEkCni5dgQjhyq4Xbcci7WKkuoKr8XPZNek/gDYecSbgm18Phf2g8kNfqCBYuicsf5Q8q7OSB8YlBtSR0VqJNzEl3NaXqk9zIgypKYi7DE/QNduSZpXOM/TqVyynvOPsY59FfYqcAF7kpX8w5RgMEZwB8b42aP/yEeF4LbidN4O9U5BWBp8v0deKvtZq0+nj3sfmeDZPeXU1PncGwQW4lYmdBMIC/J0yrNhBpdMfsyet4PsttXvZ4Vcq0P9u+vq56lEJn9bqKCR4zP16bA63t+F1efYn+4makxf1neEDJwi0wL4gAu8jGTSQuqeEuqlRTmC3GqFRvlRVXwl2TkaT1Mm8ds8YnzsPYq6KG9JI60KqWyHj1b5aCjRqprpATgaIeuWes8QcKooYhd55K6gH8taTKC890zA0xX3VKwhFXD5KQbiv1ETdiPlP+6Iks7F55+9QRVDSrzxyVPUt0Jl2F1Q91h9cVR4FsHWwGLU65bgsXi/cAZIudi5uxlNBpC1is/+kUE= 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)(39860400002)(396003)(346002)(376002)(136003)(451199015)(46966006)(40470700004)(36840700001)(6636002)(110136005)(4326008)(70586007)(8676002)(54906003)(70206006)(6666004)(36860700001)(316002)(2616005)(16526019)(186003)(1076003)(5660300002)(40480700001)(86362001)(83380400001)(47076005)(2906002)(336012)(426003)(40460700003)(7696005)(26005)(41300700001)(36756003)(8936002)(81166007)(478600001)(356005)(82740400003)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:22:16.9040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f52cccf5-41f7-4261-692b-08dab1feda6d 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4930 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The current XGBE code assumes that offset 6 of EEPROM SFP DAC (passive) cables is NULL. However, some cables (the 5 meter and 7 meter Molex passive cables) have non-zero data at offset 6. Fix the logic by moving the passive cable check above the active so as not to be improperly identified as an active cable. This will fix the issue for any passive cable that advertises 1000Base-CX in offset 6. Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Raju Rangoju --- Changes since v1: - Split the changes into two patches. The next patch contains the Vendor specific quirk. - Add a vendor check for Molex cables before assigning bit rate ceiling drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index b9c65322248a..bd67a2a71048 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -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: From patchwork Wed Oct 19 18:20:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 13012258 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 AE96BC4332F for ; Wed, 19 Oct 2022 18:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231167AbiJSSWX (ORCPT ); Wed, 19 Oct 2022 14:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbiJSSWV (ORCPT ); Wed, 19 Oct 2022 14:22:21 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BADA1C906B for ; Wed, 19 Oct 2022 11:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LBdDNbYpFPI1y7cr2wO8hqL7AE5prnq3fgqcnd2CMaar5frE5u0Ra6O49xKDQkCFQHnhOUjDbFYGN3LxMwXEwf26Pzlq4HIetggIKOz9Z+lMpknnrLPjybiB4ePh0JQfH6xo9f85QF4m7qA7iwiVRUddVyQhEhoDx5H3OSaMIymUt2onAawT9hXwPZoUVgCNq4ahLjPM/F1JQaInhu8vm+JCHQUu3kqSkJlqToJsvoWna7mk/x0OBDa4nEsj4FOVanGUlqLHMaYN+B8NaQMtqePUUwfXAErmNdmFHIUar/lhMmjoS05Lgc0H601VW9LO/Jznn5aIaYgTTD+TjpUU2A== 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=bCkdroYUqIReXGY5YisInW6w9r3cj/e916G8RE0+J04=; b=jV/sRZx1alygj0KMryu8lM+1PdtmNU+zo+LagHnLDiKbJ7nuJhL+5lWeE+iBsMPiYKhnlE8JFLokzkAk192EByTr7IojeuoYZsra/lAsgrIrnBRUw7KLFNHHlyytjpC+B6F4YtBephVPs5Z/IpfXUwDSp0H+vMahNhHX9JlGv3KLcjg1ygBE1M9YRjf8f7ctLxL9IzCUYGSAUQBk2aDbMyjbecoiNqRfPp72BK+d1EbJLXsx9H6JSuqG4IOj3ZppMUP0DQhLyOXarkNEIaLauLou+kgNQv1qyXFnRIECO84SRcW4C+1V3wXuAuqKEgIo8hGH0SMUMy9HvnClXkUyzg== 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=bCkdroYUqIReXGY5YisInW6w9r3cj/e916G8RE0+J04=; b=bXlusTIyFSrcG/pXYefYfTo1ehpE8c54HC9oV1eGv7sEjG8MaAkOtWuENW8/he4wvHaip6mmlc+LMU58CVxVRDWaJT2QzAPpIGk/V5bOn98j/MOxZ+uqiYrdd55LK5VfEkQCXqMi8MAzBs2zwwMgqGa/XNzLyNYtqWbGUFrtYOM= Received: from MW4PR03CA0067.namprd03.prod.outlook.com (2603:10b6:303:b6::12) by IA0PR12MB7532.namprd12.prod.outlook.com (2603:10b6:208:43e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Wed, 19 Oct 2022 18:22:18 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::e8) by MW4PR03CA0067.outlook.office365.com (2603:10b6:303:b6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 18:22:17 +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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:22:17 +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.31; Wed, 19 Oct 2022 13:22:13 -0500 From: Raju Rangoju To: , , , CC: , , Raju Rangoju Subject: [PATCH v2 net 5/5] amd-xgbe: add the bit rate quirk for Molex cables Date: Wed, 19 Oct 2022 23:50:21 +0530 Message-ID: <20221019182021.2334783-6-Raju.Rangoju@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019182021.2334783-1-Raju.Rangoju@amd.com> References: <20221019182021.2334783-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: CO1NAM11FT082:EE_|IA0PR12MB7532:EE_ X-MS-Office365-Filtering-Correlation-Id: cb99ced6-7490-4fae-ece2-08dab1fedad3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KMp2aZqTcMDmcXz36M4+W7mC72oFU4sfai1sKGHSLY63xi0nOmSYJn/FuFPHqOW2iSyYDHf71OaKIA38k4ZjXHaanAVy+aJOvWwNesqQj1/QTEL7e2EByHaRGVznuRfk+5NA5xhb813L13v4Gn6l9ubeP0GhlN52YlcqSE7FhbWzREJ0QXgNw9x3vcY3KT3XgTOzsaRzYaoxYJ0n0wRNHGmO4O4irrDRiewyoF7GrVttWhX/+H21v2Sq6w5vPYQr4qyeEtf0/olcs4VkP0TyB23ht3/qmhxl/VgryLcAcVUUd/mreFvH/2w9HYNjsa2Hu5g1Szgncc7HBTjzhACzdfkpYkzXlLWp2eGx4+L18CgidZx6dxS5r5Tm2YoGjNDD3VKRJTuhVsjw3qTy+4JeCFlAT/ys0P2dSbQpZ9t4WxEJx55sv3aQji4xwUax0L9RhQw/EMHazHBM/GkHqrLQ4J+ynrxvBPaGz51lS9TPu1mVB/EWM8YHXcTnMjlIySEgfmJRLkfY7E3eDmcRRvzLa28HRcof7JhL+ZJmhV0Ns5pngqSvrtc0ZzqF8OibpAq3tbcC6R8pp7hEMVcqQS+7YyVHiwDGuDcWmW5nMIVM+jXD/swv7bGqNEIeMQ2KTjvbqBtGj0qUp32ImIW+bEegynN8W/QcqGueSK0t3+P+b+3tNYPmpbewuWrRFfMXGFEXSXGbM4M8senlw5lqzBWF1p2wnWG+XIs7nTZP270mQpsB52NTSOpxEH06K6BMaOGNOGo1OtWUd2x7kWDNXXeXoPyHtCDaIfS+AxeMJlW81Fo= 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)(346002)(39860400002)(376002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(16526019)(186003)(1076003)(2616005)(336012)(83380400001)(2906002)(40460700003)(26005)(36860700001)(8676002)(7696005)(41300700001)(4326008)(82740400003)(426003)(47076005)(86362001)(40480700001)(81166007)(356005)(82310400005)(36756003)(54906003)(6636002)(8936002)(5660300002)(316002)(70586007)(110136005)(6666004)(478600001)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:22:17.5759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb99ced6-7490-4fae-ece2-08dab1fedad3 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7532 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The offset 12 (bit-rate) of EEPROM SFP DAC (passive) cables is expected to be in the range 0x64 to 0x68. However, the 5 meter and 7 meter Molex passive cables have the rate ceiling 0x78 at offset 12. Add a quirk for Molex passive cables to extend the rate ceiling 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 | 9 ++++++++- 1 file changed, 8 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 bd67a2a71048..70cad8b36fc7 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -239,6 +239,7 @@ enum xgbe_sfp_speed { #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_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78 #define XGBE_SFP_BASE_CU_CABLE_LEN 18 @@ -284,6 +285,8 @@ struct xgbe_sfp_eeprom { #define XGBE_BEL_FUSE_VENDOR "BEL-FUSE " #define XGBE_BEL_FUSE_PARTNO "1GBT-SFP06 " +#define XGBE_MOLEX_VENDOR "Molex Inc. " + struct xgbe_sfp_ascii { union { char vendor[XGBE_SFP_BASE_VENDOR_NAME_LEN + 1]; @@ -834,7 +837,11 @@ static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom, break; case XGBE_SFP_SPEED_10000: min = XGBE_SFP_BASE_BR_10GBE_MIN; - max = XGBE_SFP_BASE_BR_10GBE_MAX; + if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME], + XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0) + max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX; + else + max = XGBE_SFP_BASE_BR_10GBE_MAX; break; default: return false;