From patchwork Thu Mar 9 15:56:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13167760 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 C6E25C64EC4 for ; Thu, 9 Mar 2023 15:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbjCIP4Y (ORCPT ); Thu, 9 Mar 2023 10:56:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbjCIP4U (ORCPT ); Thu, 9 Mar 2023 10:56:20 -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 2CDEBE825E for ; Thu, 9 Mar 2023 07:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=z9GquP129NQj/ctO0X6qgRKAXW660qD4AAuqTvtd4s4=; b=PCMdTdTmPTtG5ChXYXDhDVdQhP y7DH3i93ZkskpBvTo9MnjKmHhDfoKj1Lg2kQS4tcX/afEGLbREzUgCIG3CAc0slf4zmbyOfPwnvRb RXdHthHGUrCqom0Op4JqRXEvnvVOZf3ZhoNdVs5JfP4ED3rbJKAQAslXYcb3Mfm4FU4gRdWCOuIVq tgVviTC2D1C1CfjS2bKm+5lZDnwNrdUuC3IBfJGMzs7IlybCKhDx/V8rUZ3/3nnRWq/Cc9z6bXBJB svUD62LDeAa1zxKqcxMCkIUNy40Xd/nCKVx3kJVGgKb6WeVwrw4DM2Z6yOXFaxfI1LCcn5GR6Ld2A 5WOWDrJw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54602) 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 1paIcp-0004yv-G1; Thu, 09 Mar 2023 15:56:15 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1paIco-0003mo-2e; Thu, 09 Mar 2023 15:56:14 +0000 Date: Thu, 9 Mar 2023 15:56:14 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 0/2] Rework SFP A2 access conditionals Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Hi, This series reworks the SFP A2 (diagnostics and control) access so we don't end up testing a variable number of conditions in several places. This also resolves a minor issue where we may have a module indicating that it is not SFF8472 compliant, doesn't implement A2, but fails to set the enhanced option byte to zero, leading to accesses to the A2 page that fail. The first patch adds a new flag "have_a2" which indicates whether we should be accessing the A2 page, and uses this for hwmon. The conditions are kept the same. The second patch extends the check for soft-state polling and control by using this "have_a2" flag (which effectively augments the check to include some level of SFF8472 compliance.) drivers/net/phy/sfp.c | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-)