Subject: Re: [PATCH] net: sfp: workaround GPIO input signals bounce

From: Baruch Siach <[email-masked]>
Date: Tue, 13 Sep 2022 12:54:26 +0300

Hi Russell,

On Tue, Sep 13 2022, Russell King (Oracle) wrote:
> On Tue, Sep 13, 2022 at 10:43:38AM +0300, Baruch Siach wrote:
>> From: Baruch Siach <[email-masked]>
>> 
>> Add a trivial debounce to avoid miss of state changes when there is no
>> proper hardware debounce on the input signals. Otherwise a GPIO might
>> randomly indicate high level when the signal is actually going down,
>> and vice versa.
>> 
>> This fixes observed miss of link up event when LOS signal goes down on
>> Armada 8040 based system with an optical SFP module.
>
> NAK. This needs more inteligent handling. For systems where we poll,
> your code introduces a 100us delay each time we poll and there has
> been no change.

I think we can avoid delay in the poll case by skipping the delay loop
when sfp->need_poll is true.

I'll send v2 with that fixed tomorrow.

Thanks for reviewing,
baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email-masked] - tel: +972.52.368.4656, http://www.tkos.co.il -