From mboxrd@z Thu Jan 1 00:00:00 1970 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 B2B17C64EC4 for ; Thu, 9 Mar 2023 15:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjCIP5Y (ORCPT ); Thu, 9 Mar 2023 10:57:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbjCIP5V (ORCPT ); Thu, 9 Mar 2023 10:57:21 -0500 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 806A5F4010 for ; Thu, 9 Mar 2023 07:57:20 -0800 (PST) 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=ZkLQ1xyU/Xhxn3J0EmvFEmjUuj62tWObazx8x4dvOZc=; b=p9Ie4HmMzioVhFiGCxBrqBZ54b 6lw+IeKcUHZv9xqjKg6H4G486nCqVsrVr5h+GTHYrspJ3DzLjgLmPm/LHvCF1rRrE8UB7fq6YEatJ 0dJG7Y/7L3pK9yx/nEY1jlE7Ubd87qaDomnG0G0Xo11M/PBqUVb1O+jDrj3UzPjKUHMCF6LBeP5TD JnF5YVduNFZBSzYkSdBGtmb0qiZCe2gnc2iem0GPdj3wetih1ZQtbRympdK2nyf/JlsmEsWp9d06/ wiveH/ndFk24G4AQ8cSPzov0cHN6mjjdUmwsKGYzG52Y5IZFFYRPTJ6hkO3W/3DNoiGVwx29Otgba l9M/7bcg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:43816 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 1paIdo-0004zN-Sn; Thu, 09 Mar 2023 15:57:16 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1paIdo-00DUP7-92; Thu, 09 Mar 2023 15:57:16 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 2/2] net: sfp: only use soft polling if we have A2h access MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Thu, 09 Mar 2023 15:57:16 +0000 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The soft state bits are stored in the A2h memory space, and require SFF-8472 compliance. This is what our have_a2 flag tells us, so use this to indicate whether we should attempt to use the soft signals. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/sfp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 4ff07b5a5590..39e3095796d0 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -2284,7 +2284,11 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event) sfp->sm_dev_state != SFP_DEV_UP) break; - if (!(sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE)) + /* Only use the soft state bits if we have access to the A2h + * memory, which implies that we have some level of SFF-8472 + * compliance. + */ + if (sfp->have_a2) sfp_soft_start_poll(sfp); sfp_module_tx_enable(sfp); -- 2.30.2