Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2085274lqb; Mon, 27 May 2024 07:26:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaW6uJtExyRrYgJr1seAKu/oVqAqMw7KtKZcm1RY+oHWlV/FkFk0Z2vi9zhfwnflueI/KCRdoFct+5hDkkZYgCPjqSXP4MxaLl5wZffQ== X-Google-Smtp-Source: AGHT+IE/rkPCHOadKbCaOoMsmZ3ZEseIkeuufPQOlyx+uuNtsNptiQRBaMyLmAYkAd+j+hL5MraW X-Received: by 2002:a05:6102:2129:b0:47e:f6f4:ff55 with SMTP id ada2fe7eead31-48a385cb654mr8960573137.20.1716819969546; Mon, 27 May 2024 07:26:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716819969; cv=pass; d=google.com; s=arc-20160816; b=Mgaawq03nUMk1yirDz/zawKBD/EK40PcVpGUIYos8YWOlscmYv6CAP0Q6CJbbn6bMc 9y+UllRd0DBRrmhOtgLEOHHKQpPRIOne1KV6DrhxYMy6Qub98wkak5ujnBJvMj8iHG3j DKljJVnckOTu6/kF7jJwdPV02F0tsV5tF+oIV8tQJyCtjrD4wv65WSJYD3lQKjDg9ivV +yQP/HDUCIxVDakcXdrwoqGZb5kGS2GPHRxQiFm6cPzyJ4AZjXVDHKXtjksR4l5KiQ1H HgKzQ3ark+YuR8x2lJwzgIS8nmzeSBkdEOWzafaveT6fDmam3DvCnu5ffsBBhP0GPXcg uSWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ycpdzuvlaGwk9s4PJN/xx5lCunggoy2xUW7HdzaesMo=; fh=ob1NcVS6jmh8jXNV1SbPxNsow0rrO4wnqkKE6cs0hSM=; b=RFCLGu3kgP8TcQSF5DI2ulcJHGHK037veejOf+uqKEV2H0U3eWGm8gprJ8vgG3YTA/ VQoFTpPNYJctO/oMfnm8XksQUUuKWkUWJtMvcw1GtQj+QvEc3YHCtbAbqIXs6Ou1OPUR avqUu47xp+XHDtUqKX6ZIaPj8LU3E5UpNUfTfx/3ZA1Dm5XYCkHjuV3Z3G/JbF86T67S /KxmIUjNi1JViJc17bKkBLg/kTTbYK4liRH4Ca2/ofCv/U1Y2dpFIIzSmO3aVz/NO/po IiGaWHxAm48lpmqD4RN2mM4YRKn0/c6ftQip81MQxCAztH/o3it5Fm0KBX8TBfO6hE4Q YJWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EYr11NEl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48a3a2f06bdsi1471802137.293.2024.05.27.07.26.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EYr11NEl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 312911C21A05 for ; Mon, 27 May 2024 14:26:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42A3E176FA2; Mon, 27 May 2024 14:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EYr11NEl" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 67828174EE5; Mon, 27 May 2024 14:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819285; cv=none; b=CCD2XZuGYsBMIvSjqDHs6NLukv7QwrEAfHtJtyGzFR7i1iN8mbfpXZflxrjLny9As3XoSvvHwdCPtMKrdynLvVSaPwiT2Jv0J1Aiy7xNV6TRojKMPZGO9mn+tJ/xcitZNYN1Seg2S0NuAUCio3yKrfmkW4pxyAJbz+qo/weQ8lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819285; c=relaxed/simple; bh=etjAyQemO/7YnJLLdqANw2A3NWliFralIXkWEsiy8S4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BnPEX37wljiPfyfUWOV9BaGstTgOYTjLPtiKRjnv2gVK89do0/p3MwQlTriOkSHdSGWdjgzM1yIoHiw1uuPerj/TiFp9cPAuk/YKnt39W68EowKfPX4k1jqB/kJiFc+2nuTiGLTLv64Kv0BT/wkDG2mufR++dISYpxxHnxokSoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EYr11NEl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDCB6C4AF08; Mon, 27 May 2024 14:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716819285; bh=etjAyQemO/7YnJLLdqANw2A3NWliFralIXkWEsiy8S4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EYr11NEli6Vy9EUhePAZVhv6wVoYTl7dSr1DKtkMSCHs/OR97Fw3ZAqOqQPIdqSQb lmZX4+6Kc3zu06qGnse/3IvwrIJdpscG0BJKT2Kbz78ayq3pOn85Z2tZDkaF0EQDMp nSig4na3ncncMqMOc2+vb743BJ2Gh+snMPKGX1g8g4C/zItTdd6jLiHmPCnPMQWFFY U4DFl5gsn1th+U4TRCLzYoPafUTkIcQ2X3JJgE1z11OWG7KABkD5WUj2oPFZh5/pm0 iottgvg18c2WJ0nLZsL9woyXQGd/YFf8QZupErtZsPxj/qrK6PpL3b6kVwXBtV6oYs VfHskPB/4xPIA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , Jiri Pirko , Jakub Kicinski , Sasha Levin , linux@armlinux.org.uk, andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 14/30] net: sfp: enhance quirk for Fibrestore 2.5G copper SFP module Date: Mon, 27 May 2024 10:13:23 -0400 Message-ID: <20240527141406.3852821-14-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240527141406.3852821-1-sashal@kernel.org> References: <20240527141406.3852821-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.11 Content-Transfer-Encoding: 8bit From: Marek BehĂșn [ Upstream commit cd4a32e60061789676f7f018a94fcc9ec56732a0 ] Enhance the quirk for Fibrestore 2.5G copper SFP module. The original commit e27aca3760c0 ("net: sfp: add quirk for FS's 2.5G copper SFP") introducing the quirk says that the PHY is inaccessible, but that is not true. The module uses Rollball protocol to talk to the PHY, and needs a 4 second wait before probing it, same as FS 10G module. The PHY inside the module is Realtek RTL8221B-VB-CG PHY. The realtek driver recently gained support to set it up via clause 45 accesses. Signed-off-by: Marek BehĂșn Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20240423085039.26957-2-kabel@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/sfp.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 6e7639fc64ddc..44c47d34a5c68 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -385,18 +385,23 @@ static void sfp_fixup_rollball(struct sfp *sfp) sfp->phy_t_retry = msecs_to_jiffies(1000); } -static void sfp_fixup_fs_10gt(struct sfp *sfp) +static void sfp_fixup_fs_2_5gt(struct sfp *sfp) { - sfp_fixup_10gbaset_30m(sfp); sfp_fixup_rollball(sfp); - /* The RollBall fixup is not enough for FS modules, the AQR chip inside + /* The RollBall fixup is not enough for FS modules, the PHY chip inside * them does not return 0xffff for PHY ID registers in all MMDs for the * while initializing. They need a 4 second wait before accessing PHY. */ sfp->module_t_wait = msecs_to_jiffies(4000); } +static void sfp_fixup_fs_10gt(struct sfp *sfp) +{ + sfp_fixup_10gbaset_30m(sfp); + sfp_fixup_fs_2_5gt(sfp); +} + static void sfp_fixup_halny_gsfp(struct sfp *sfp) { /* Ignore the TX_FAULT and LOS signals on this module. @@ -472,6 +477,10 @@ static const struct sfp_quirk sfp_quirks[] = { // Rollball protocol to talk to the PHY. SFP_QUIRK_F("FS", "SFP-10G-T", sfp_fixup_fs_10gt), + // Fiberstore SFP-2.5G-T uses Rollball protocol to talk to the PHY and + // needs 4 sec wait before probing the PHY. + SFP_QUIRK_F("FS", "SFP-2.5G-T", sfp_fixup_fs_2_5gt), + // Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd // NRZ in their EEPROM SFP_QUIRK("FS", "GPON-ONU-34-20BI", sfp_quirk_2500basex, @@ -488,9 +497,6 @@ static const struct sfp_quirk sfp_quirks[] = { SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex, sfp_fixup_ignore_tx_fault), - // FS 2.5G Base-T - SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g), - // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), -- 2.43.0