From patchwork Sat Jan 6 16:29:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josua Mayer X-Patchwork-Id: 13512750 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2073.outbound.protection.outlook.com [40.107.15.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1291AC12A; Sat, 6 Jan 2024 16:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=solid-run.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=solid-run.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=solidrn.onmicrosoft.com header.i=@solidrn.onmicrosoft.com header.b="CTcsUydT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx5Yluv0Ar7BXVlFQblaOMcZT9g/R6pSnt+oIl+Yp1O/6DTOu8+0BqS9BfVAVLpCFiu1tRZYqJ+1OHg+/tporCexeMMdy00dV6mMJzxgkgwx/kJpF1drcL90PBEUonwFJUFOAuWJf0s+An80A3Rse/Zny9cJn5ADKBTlkufGnIy0hXERgjh3SGAneoTKuESsXHOcre153uXke4lsxvVCY1dKnkL4BTxQEMex2bVnXbGisVjn103Td9s+tArY3IvTyTB6hn2NtRXYLoJVqWfBZVF3bZXylDgKm2UjABGgXrHX8/1c7Yn7GU6K4No332QrfH4usBq8eBp9vkdWjXDcBQ== 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=C6yTUm7MTX2gUH9a3AkDi4lA8c3/2xWhvLKLFJRvfjw=; b=a2puCL9YakJcAlon94DIk4XBMzWvjtZ22e3QO96Oxj4MyJTZUe0PX/8jmjYE4qV01oViKUhsJAhSjeQAPymz2Fr/ddj4nn4/kQtwwteLRsvHS/JAdeldJfd4hmdwEsJiucBmWPfafnEJfJiXKI1TfKFVdtAxKyPlxAJZuuTrjw6fZt+3GPKGxwB6H1UwClgS4z+jjUwirQJ+0+fFxT/PaTg3gSqaDEBPkVxnbhCQLgRG/TCnk0ya3mAvmkA35sMIJoNnSq+HNq3h2d9baX3JcnRroa6+LkRNIGEYn0cmautQNS7y6WL1ozTlHQ3Wc2c9Ozxxfzvqvs+RTn0YYkxw/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=solid-run.com; dmarc=pass action=none header.from=solid-run.com; dkim=pass header.d=solid-run.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solidrn.onmicrosoft.com; s=selector1-solidrn-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C6yTUm7MTX2gUH9a3AkDi4lA8c3/2xWhvLKLFJRvfjw=; b=CTcsUydTHunn0WfJgJVpXxSrlkEVaNbwOC6sfyMdyf3vw3umqTEKiMopRtilT5r7flsGOYqxDmGLAkQXr/gJoNpCCTKaxW1yhRQQCsn1cJZetLjvLdJN988HNkwJdcbqudQpIHR47vv//9nze/rEDTF7y+pUSk9s/6mIq+yZHVk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=solid-run.com; Received: from AS8PR04MB8963.eurprd04.prod.outlook.com (2603:10a6:20b:42e::18) by AS1PR04MB9429.eurprd04.prod.outlook.com (2603:10a6:20b:4db::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14; Sat, 6 Jan 2024 16:30:08 +0000 Received: from AS8PR04MB8963.eurprd04.prod.outlook.com ([fe80::daf2:8c54:d469:793d]) by AS8PR04MB8963.eurprd04.prod.outlook.com ([fe80::daf2:8c54:d469:793d%6]) with mapi id 15.20.7159.018; Sat, 6 Jan 2024 16:30:08 +0000 From: Josua Mayer Date: Sat, 06 Jan 2024 17:29:56 +0100 Subject: [PATCH] net: sfp: add fixup for tplink 2.5gbase-t rj45 modules Message-Id: <20240106-tplink-25gbaset-sfp-fixup-v1-1-8d26696bd2f4@solid-run.com> X-B4-Tracking: v=1; b=H4sIAAOAmWUC/x2MywqEMAwAf0VyNhDr+sBfEQ9dTTUotTQqgvjvW /Y4DDMPKEdhhS57IPIlKrtPUOQZjIv1M6NMicGQ+VBBNR5hE7+iqeavVT5QXUAn9xmQeLTGta6 pSoLUh8hJ/N/98L4/SMtVUmsAAAA= To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Josua Mayer X-Mailer: b4 0.12.4 X-ClientProxiedBy: FR4P281CA0060.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cc::20) To AS8PR04MB8963.eurprd04.prod.outlook.com (2603:10a6:20b:42e::18) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8963:EE_|AS1PR04MB9429:EE_ X-MS-Office365-Filtering-Correlation-Id: f830f1bf-9e6f-4611-9564-08dc0ed4beee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FsWJHfameDa/oMwvu8kuwFJ9xpqhG7+S5OivZ6tJYIEe0YdkhtrRXO7cvKSX9nT2H1sNvxEZ/u8CBo65S/qnxipI37eqj2aI1aWgsKRGQmn+5z1GYWO9wiPQ3u5PPjiCOviA+op0eh/6fCc9jMQpKilVgQ1zdJtDp6IF+JxNKJYy5cVZgLlD7DHuR8hsuxdybzDy7jXnVwaJWF1Kd0iDjwvqzHrbX7kvrU0Wc7rJtJe50Sxdgv6+FWy83OJkUfs+UQHrQWVaj7scyqvZ7HqViz9bcJ4vZJo7rtb+EbcmEuZZi2IWxKGn/jyZckH1H90mYd8UjxEseBqrcPG+oDKp3itbsclb3hi3v349tAlQxmgsVeQqOaaOCegvjm2vhxI6MZNFusFWjqkyLPGEAo/MyrL+wSymxY7zIgTuFoBd4Oga+ktp3FRiYXRDLl1cKUTPkq7StiPaWsow/QCAuuzOB1rAr/Z78ihDCtp9j0Y8aMDH2C2zqaZr4fbmVm2lhzMD+vVPG6IWhuv8S986nlEZENkg/kgvO1ZU8SYKRRW+eGP+qJlbZq3Es3Y1IoFQbPtnYQiDdmei/m4hrh8Gq7whsnPdgODurHMObo2iHk0ZlIXbB9Ona1F00KqPrdjZHUKv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8963.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(136003)(396003)(376002)(39830400003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(36756003)(38100700002)(38350700005)(86362001)(6506007)(8936002)(6512007)(107886003)(2616005)(8676002)(6486002)(316002)(66946007)(66556008)(4326008)(66476007)(478600001)(110136005)(6666004)(52116002)(26005)(41300700001)(5660300002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0CZjbI0Lqpcn7NTj1bTv0WjzFNgu?= =?utf-8?q?GXdB7Abb6Q0keFSK2UF89qU/+6m7437O61YsYTfdunawDe0rrSO7k14AyiO4XA6eO?= =?utf-8?q?ZZ1bUsCRCrxCc6TQmCclLeS4EC2kaXgeoYZ2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Ep5ZYrd?= =?utf-8?q?4TzviNiYgwEDnqRlnQaGdnWkQ+htlIhH7BX/Shsp/aoiP0Zsb3L4J4QBoGskBZF3A?= =?utf-8?q?2wtb5m6U2bRrbE/IWu+qwFofQVPLSO7X0f+/TcJZJoCj9p0gKam8SrZg1ezR7mVft?= =?utf-8?q?viRC+qDqReujwkzfLrMQNxNpegNlxXKjFwmGPvfzkfjHy0GGKP2M63XgbDrBoyoI2?= =?utf-8?q?5vFm2FKfu5Bi6Tni3rrJVcRKNL8FVfBDRYciVTvNjskoGLq2OSJudWAounK9azvdL?= =?utf-8?q?fQ19RYkmn3aNLMpLHxXoYH5ldYFDy7dCF6rKrnA2eyb+/raISVpsv564ZTmb7O3BC?= =?utf-8?q?IoR9LO2Ecw59m6khJMOyq4VJS65bqNmkBvoNGe/YDUiaLQHvFjeBWBjK5lzNVrB80?= =?utf-8?q?onI2WvYi5dNqvCJaSfYwpBx0XmG4YiEDysyTA7JNuqG4prY8dpUGhTB5Y+qAA4nM7?= =?utf-8?q?T4V/eDRjeC1CsR7InAoYNPOXKEvVNxAuZFdrH5vW9Xw7z9EJyrpVTIZSCCdjiE+bP?= =?utf-8?q?3zwCrfDCmhX0?= X-OriginatorOrg: solid-run.com X-MS-Exchange-CrossTenant-Network-Message-Id: f830f1bf-9e6f-4611-9564-08dc0ed4beee X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8963.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2024 16:30:08.0169 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a4a8aaf3-fd27-4e27-add2-604707ce5b82 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aPIFi+3e4/dgqC42WZxSK7OEE0LOOi564eWRcNKVO4i7+aZfLOh+3gJWiLOQM3DEWKrQ22sCdtvXs1K++4Vm3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9429 X-Patchwork-Delegate: kuba@kernel.org TP-Link TL-SM410U modules are single-rate 2.5GBase-T RJ45 SFP modules. The EEPROM data is lying about connector and extended cc, reporting 25Gbps fiber. Add fixup for these specific modules forcing RJ45 @ 2.5Gbase-T. For reference original eeprom data dump from ethtool: Identifier : 0x03 (SFP) Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID) Connector : 0x07 (LC) Transceiver codes : 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 Transceiver type : FC: Twisted Pair (TP) Encoding : 0x01 (8B/10B) BR, Nominal : 3100MBd Rate identifier : 0x00 (unspecified) Length (SMF,km) : 0km Length (SMF) : 0m Length (50um) : 0m Length (62.5um) : 0m Length (Copper) : 0m Length (OM3) : 0m Laser wavelength : 0nm Vendor name : TP-LINK Vendor OUI : 00:00:00 Vendor PN : TL-SM410U Vendor rev : 1.0 Option values : 0x00 0x18 Option : TX_FAULT implemented Option : TX_DISABLE implemented BR margin, max : 0% BR margin, min : 0% Vendor SN : 12154J6001608 Date code : 210611 Signed-off-by: Josua Mayer --- drivers/net/phy/sfp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 change-id: 20240106-tplink-25gbaset-sfp-fixup-0eca2f8f7530 Sincerely, diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 5468bd209fab..a5bb9d569381 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -340,6 +340,12 @@ static const struct of_device_id sfp_of_match[] = { }; MODULE_DEVICE_TABLE(of, sfp_of_match); +static void sfp_fixup_2500baset(struct sfp *sfp) +{ + sfp->id.base.connector = SFF8024_CONNECTOR_RJ45; + sfp->id.base.extended_cc = SFF8024_ECC_2_5GBASE_T; +} + static void sfp_fixup_long_startup(struct sfp *sfp) { sfp->module_t_start_up = T_START_UP_BAD_GPON; @@ -503,6 +509,10 @@ static const struct sfp_quirk sfp_quirks[] = { SFP_QUIRK_F("OEM", "RTSFP-10G", sfp_fixup_rollball_cc), SFP_QUIRK_F("Turris", "RTSFP-10", sfp_fixup_rollball), SFP_QUIRK_F("Turris", "RTSFP-10G", sfp_fixup_rollball), + + // tp-link 2.5Gbase-T modules wrongly report 25Gbps fiber connector + // in their EEPROM + SFP_QUIRK_F("TP-LINK", "TL-SM410U", sfp_fixup_2500baset), }; static size_t sfp_strlen(const char *str, size_t maxlen)