[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200506.150404.807895268973641753.davem@davemloft.net>
Date: Wed, 06 May 2020 15:04:04 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: olteanv@...il.com
Cc: richardcochran@...il.com, f.fainelli@...il.com,
vivien.didelot@...il.com, andrew@...n.ch, christian.herber@....com,
yangbo.lu@....com, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: dsa: sja1105: the PTP_CLK extts input reacts
on both edges
From: Vladimir Oltean <olteanv@...il.com>
Date: Wed, 6 May 2020 20:48:13 +0300
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> It looks like the sja1105 external timestamping input is not as generic
> as we thought. When fed a signal with 50% duty cycle, it will timestamp
> both the rising and the falling edge. When fed a short pulse signal,
> only the timestamp of the falling edge will be seen in the PTPSYNCTS
> register, because that of the rising edge had been overwritten. So the
> moral is: don't feed it short pulse inputs.
>
> Luckily this is not a complete deal breaker, as we can still work with
> 1 Hz square waves. But the problem is that the extts polling period was
> not dimensioned enough for this input signal. If we leave the period at
> half a second, we risk losing timestamps due to jitter in the measuring
> process. So we need to increase it to 4 times per second.
>
> Also, the very least we can do to inform the user is to deny any other
> flags combination than with PTP_RISING_EDGE and PTP_FALLING_EDGE both
> set.
>
> Fixes: 747e5eb31d59 ("net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Applied.
Powered by blists - more mailing lists