From patchwork Tue Sep 13 19:06:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12975164 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 96E91C6FA82 for ; Tue, 13 Sep 2022 19:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbiIMTGx (ORCPT ); Tue, 13 Sep 2022 15:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbiIMTGu (ORCPT ); Tue, 13 Sep 2022 15:06:50 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C1331EF1 for ; Tue, 13 Sep 2022 12:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ynokmYv7OrS8g8yvY9cAZ7WLV0jmFUvFd4Ycc9BWlz8=; b=yPkGU1OEdDS6AZyuD8kM8j832Z dm0lP4pq8fkvNkQm9vpd0hqI6iR9n7Uing/p9v0GYa0X5+9fsSW9oUFlhcNChzp/NOtQ0sXK8yqhj nah3DXeYdsy9zAIQjLaocHzbutIC/XOIaC2dUDO0qNsusfm1XxS4oNtD+hGIexmLYlEmitjiMTHxG 64oTYNnTFrX9Pi/bFnZyfQkg5ODbtwpDuhsLYInBltBqk5lsl75E4encBFmvNnS/kojc8ez8HfpO4 LMmhq36ljJ0PaLQ5JmO56ea0VJc1UfSXNTWm5GhJL5yHCkqGI//1oZ87zAuib8hHpNLI0wabozPm5 SenNCeJA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:51748 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oYBF5-0003RE-GO; Tue, 13 Sep 2022 20:06:43 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oYBF4-006kCK-Ti; Tue, 13 Sep 2022 20:06:42 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Josef Schlehofer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 4/5] net: sfp: move Huawei MA5671A fixup MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Tue, 13 Sep 2022 20:06:42 +0100 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Move this module over to the new fixup mechanism. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/sfp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 2ef7bb4c00d1..d2d66c691f97 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -316,6 +316,11 @@ static void sfp_fixup_long_startup(struct sfp *sfp) sfp->module_t_start_up = T_START_UP_BAD_GPON; } +static void sfp_fixup_ignore_tx_fault(struct sfp *sfp) +{ + sfp->tx_fault_ignore = true; +} + static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, unsigned long *modes) { @@ -353,6 +358,7 @@ static const struct sfp_quirk sfp_quirks[] = { .vendor = "HUAWEI", .part = "MA5671A", .modes = sfp_quirk_2500basex, + .fixup = sfp_fixup_ignore_tx_fault, }, { // Lantech 8330-262D-E can operate at 2500base-X, but // incorrectly report 2500MBd NRZ in their EEPROM @@ -2011,11 +2017,7 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report) sfp->module_t_start_up = T_START_UP; - if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) && - !memcmp(id.base.vendor_pn, "MA5671A ", 16)) - sfp->tx_fault_ignore = true; - else - sfp->tx_fault_ignore = false; + sfp->tx_fault_ignore = false; sfp->quirk = sfp_lookup_quirk(&id); if (sfp->quirk && sfp->quirk->fixup)