Re: [PATCH] net: sfp: cope with SFPs that set both LOS normal and LOS inverted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 12, 2021 at 06:28:33PM +0200, Pali Rohár wrote:
> From: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
> 
> [ Upstream commit 624407d2cf14ff58e53bf4b2af9595c4f21d606e ]
> 
> 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 <rmk+kernel@xxxxxxxxxxxxxxx>
> Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
> Link: https://lore.kernel.org/r/E1kyYQa-0004iR-CU@xxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> ---
> Please apply this commit to all stable releases where was already
> backported commit f0b4f847673299577c29b71d3f3acd3c313d81b7
> ("net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant")
> as it depends on this commit. The Ubiquiti U-Fiber Instant SFP GPON
> module has set both LOS_NORMAL and LOS_INVERTED bits so without this
> commit it does not work. If I checked it correctly patch should go
> into 5.10 and 5.11 releases.
> ---
>  drivers/net/phy/sfp.c | 36 ++++++++++++++++++++++--------------
>  1 file changed, 22 insertions(+), 14 deletions(-)

Now queued up, thanks.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux