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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1F38C433DB for ; Sun, 10 Jan 2021 16:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B453722B2A for ; Sun, 10 Jan 2021 16:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbhAJQs5 (ORCPT ); Sun, 10 Jan 2021 11:48:57 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:59910 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbhAJQs5 (ORCPT ); Sun, 10 Jan 2021 11:48:57 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kydt1-00HL0H-2Z; Sun, 10 Jan 2021 17:48:15 +0100 Date: Sun, 10 Jan 2021 17:48:15 +0100 From: Andrew Lunn To: Russell King Cc: Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, Jakub Kicinski Subject: Re: [PATCH net-next] net: sfp: cope with SFPs that set both LOS normal and LOS inverted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Jan 10, 2021 at 10:58:32AM +0000, Russell King wrote: > The SFP MSA defines two option bits in byte 65 to indicate how the > Rx_LOS signal on SFP pin 8 behaves: > > bit 2 - Loss of Signal implemented, signal inverted from standard > definition in SFP MSA (often called "Signal Detect"). > bit 1 - Loss of Signal implemented, signal as defined in SFP MSA > (often called "Rx_LOS"). > > Clearly, setting both bits results in a meaningless situation: it would > mean that LOS is implemented in both the normal sense (1 = signal loss) > and inverted sense (0 = signal loss). > > Unfortunately, there are modules out there which set both bits, which > will be initially interpret as "inverted" sense, and then, if the LOS > signal changes state, we will toggle between LINK_UP and WAIT_LOS > states. > > Change our LOS handling to give well defined behaviour: only interpret > these bits as meaningful if exactly one is set, otherwise treat it as > if LOS is not implemented. > > Signed-off-by: Russell King Reviewed-by: Andrew Lunn Andrew