Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4061574rwb; Sun, 9 Oct 2022 17:05:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SVCabX+sTGDhSOdI3J5CrstOFgvrqipWbKqpienCaghcir/bmvF1bDYL3fXF7/SIb9hQR X-Received: by 2002:a05:6a00:230f:b0:53e:2c2c:5c03 with SMTP id h15-20020a056a00230f00b0053e2c2c5c03mr17106239pfh.11.1665360322865; Sun, 09 Oct 2022 17:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665360322; cv=none; d=google.com; s=arc-20160816; b=h2kTQzgHfoGrxAnwEE0DoEkL/9jpcJgf/JG4kUhWMnY9C2iuEE4/H9AfDT199X5/jn 1K0Nd3kr6YjM8r1Zpg+hK3h7d13UU/ng9yhIGW4S/TRXvk6LCjTqAr0hEnAUVfECiOpR j9zetQdogO1V0gjGa0BV6ZP2JKyOJm8DE/glBk7Zvse02u1366bdyi0JO6usgvbj7E8g /lHkzl8cbVxo81vQjKVsBor6BTw5vHhCRFuSS+J5ofv2refsANd5gZ9zFOw4SBWFZ76f 0fwKgYhGaNPG8FBXjsHKS2FfT/3zbahEI6yTEW1XMplVtH2417tmh6SGXBoILpE4aJbY U5lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7aGezW6kXRb2v4+PKdB8IPWT1pqBYjp7bWxsgW/IliM=; b=ZalT2usjoA5LpjQ/u8wwKNdWeJ6HFMbqu2DCzgos8vvduAhLEbh1mVU+dzV0/mfMF7 IJReu5y1zV1zKtNtRP4JvF0yL87UII6Wv1LmDAWVizX1vp6fR12zjIHKq1Ke0CDIQ7AT 4TEe1ao8TTd5UeaiVLmHqDUuCFF+TpB42WFTlD9LG7t26LpTrC4IV07NZ+oMCY7DqoWh M0T3AKvcx1SULA/71Qz4EZOxP46QeGX63CiYc2MHBfx9jm89wO7e7BFOKqaFUz1WeBeb wAi+P50U87y0KeEJxZBQK6RGniEe9Vgwv0kyYLJ1N/Dp+ut1vwZyK7+9O/Vfae253ZkG le8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FnYe3DWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a170902c94100b00172e069021dsi10733191pla.469.2022.10.09.17.05.11; Sun, 09 Oct 2022 17:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FnYe3DWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbiJIWZC (ORCPT + 99 others); Sun, 9 Oct 2022 18:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbiJIWXn (ORCPT ); Sun, 9 Oct 2022 18:23:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68DA439B9E; Sun, 9 Oct 2022 15:18:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C67060C6F; Sun, 9 Oct 2022 22:18:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FBBDC433D6; Sun, 9 Oct 2022 22:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353881; bh=aGxvfCn8+L1kZr0Tc76loZ7zjmdxCDoOWaiyeubO5cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnYe3DWmTRbl26VCq2mVX1IqFbY5cOqa2FliRSiBta8CIHhF7L08xEXjQdgevTDJr ExUmnQ3sreYtW2YdUzciIwm+byxM3UGyTM3mIHcOl0E5zk4YBKUeFNFla3VIR3iCMK 2fjTRA5RYL2VT5h8EseFNGps7sdKCloRjgkQLGJuVLVPbD3xR732ZWL8TA6Jce6FWB RevPamxYWkzghTEDkd1yEFEAX2iPZKSDrqHYcMiQaqsaRbCEEhrIFhBKnb3ETaYOlZ oV0MfaLJeeZFAJ9k1jIiUI6vUHnxwM9+uevqfiupL9PFWp0hlcp5HxDLLHSViuqbHN rqtlAByZLLpNw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Russell King (Oracle)" , 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 5.19 51/73] net: sfp: move Alcatel Lucent 3FE46541AA fixup Date: Sun, 9 Oct 2022 18:14:29 -0400 Message-Id: <20221009221453.1216158-51-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009221453.1216158-1-sashal@kernel.org> References: <20221009221453.1216158-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Russell King (Oracle)" [ Upstream commit 275416754e9a262c97a1ad6f806a4bc6e0464aa2 ] Add a new fixup mechanism to the SFP quirks, and use it for this module. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/sfp.c | 14 +++++++++----- drivers/net/phy/sfp.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 1b35cf0ac02a..38ce6c579ee3 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -311,6 +311,11 @@ static const struct of_device_id sfp_of_match[] = { }; MODULE_DEVICE_TABLE(of, sfp_of_match); +static void sfp_fixup_long_startup(struct sfp *sfp) +{ + sfp->module_t_start_up = T_START_UP_BAD_GPON; +} + static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, unsigned long *modes) { @@ -341,6 +346,7 @@ static const struct sfp_quirk sfp_quirks[] = { .vendor = "ALCATELLUCENT", .part = "3FE46541AA", .modes = sfp_quirk_2500basex, + .fixup = sfp_fixup_long_startup, }, { // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd // NRZ in their EEPROM @@ -2052,11 +2058,7 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report) if (sfp->gpio[GPIO_LOS]) sfp->state_hw_mask |= SFP_F_LOS; - if (!memcmp(id.base.vendor_name, "ALCATELLUCENT ", 16) && - !memcmp(id.base.vendor_pn, "3FE46541AA ", 16)) - sfp->module_t_start_up = T_START_UP_BAD_GPON; - else - sfp->module_t_start_up = T_START_UP; + sfp->module_t_start_up = T_START_UP; if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) && !memcmp(id.base.vendor_pn, "MA5671A ", 16)) @@ -2065,6 +2067,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report) sfp->tx_fault_ignore = false; sfp->quirk = sfp_lookup_quirk(&id); + if (sfp->quirk && sfp->quirk->fixup) + sfp->quirk->fixup(sfp); return 0; } diff --git a/drivers/net/phy/sfp.h b/drivers/net/phy/sfp.h index 03f1d47fe6ca..7ad06deae76c 100644 --- a/drivers/net/phy/sfp.h +++ b/drivers/net/phy/sfp.h @@ -10,6 +10,7 @@ struct sfp_quirk { const char *vendor; const char *part; void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes); + void (*fixup)(struct sfp *sfp); }; struct sfp_socket_ops { -- 2.35.1