netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] option to use proper skew timings for Micrel KSZ9021
Date: Fri, 11 Nov 2022 20:35:32 +0100	[thread overview]
Message-ID: <Y26kBMCnoGFho5Ne@lunn.ch> (raw)
In-Reply-To: <f2dff077-8a0b-2164-404f-d9bf4ee40d76@mev.co.uk>

On Fri, Nov 11, 2022 at 07:03:08PM +0000, Ian Abbott wrote:
> On 11/11/2022 17:53, Andrew Lunn wrote:
> > > > And since you are adding more foot guns, please validate the values in
> > > > DT as strictly as possible, without breaking the existing binding.
> > > 
> > > Yes, some min/max clamping of skew values would be good.  The code for
> > > KSZ9131 does that already.
> > 
> > I would want much more strict checking than that. The old and the new
> > values probably don't intersect. So if you see an old value while
> > micrel,skew-equals-real-picoseconds is in force, fail the probe with
> > -EINVAL. It looks like the old binding silently preforms rounding to
> > the nearest delay. So you probably should not do the opposite, error
> > out for a new value when micrel,skew-equals-real-picoseconds is not in
> > force. But you can add range checks. A negative value is clearly wrong
> > for the old values and should be -EINVAL. You just need to watch out
> > for that the current code reads the values as u32, not s32, so you
> > won't actually see a negative value.
> 
> I'm not sure how to tell old values and new values apart (except for
> negative new values).  A divisibility test won't work for values that are
> divisible by 600 (lcm(120, 200)).

I might have this wrong, but i think they are:


 Old	New
===== ======
0	-840
200	-720
400	-600
600	-480
800	-360
1000	-240
1200	-120
1400	0
1600	120
1800	240
2000	360
2200	480
2400	600
2600	720
2800	840
3000	960

The only overlap is 0 and 600. You can just special case those two
values.

	Andrew

      reply	other threads:[~2022-11-11 19:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 12:50 [RFC] option to use proper skew timings for Micrel KSZ9021 Ian Abbott
2022-11-09 17:27 ` Andrew Lunn
2022-11-11 10:34   ` Ian Abbott
2022-11-11 14:25     ` Andrew Lunn
2022-11-11 17:34       ` Ian Abbott
2022-11-11 17:53         ` Andrew Lunn
2022-11-11 19:03           ` Ian Abbott
2022-11-11 19:35             ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y26kBMCnoGFho5Ne@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=abbotti@mev.co.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).