[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190605174025.uwy2u7z55v3c2opm@localhost>
Date: Wed, 5 Jun 2019 10:40:25 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Shalom Toledo <shalomt@...lanox.com>
Cc: Ido Schimmel <idosch@...sch.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
Jiri Pirko <jiri@...lanox.com>,
Petr Machata <petrm@...lanox.com>, mlxsw <mlxsw@...lanox.com>,
Ido Schimmel <idosch@...lanox.com>
Subject: Re: [PATCH net-next 7/9] mlxsw: spectrum_ptp: Add implementation for
physical hardware clock operations
On Wed, Jun 05, 2019 at 11:44:21AM +0000, Shalom Toledo wrote:
> On 04/06/2019 17:28, Richard Cochran wrote:
> > Now I see why you did this. Nice try.
>
> I didn't try anything.
>
> The reason is that the hardware units is in ppb and not in scaled_ppm(or ppm),
> so I just converted to ppb in order to set the hardware.
Oh, I thought you were adapting code for the deprecated .adjfreq method.
> But I got your point, I will change my calculation to use scaled_ppm (to get a
> more finer resolution) and not ppb, and convert to ppb just before setting the
> hardware. Is that make sense?
So the HW actually accepts ppb adjustment values? Fine.
But I don't understand this:
> >> + if (ppb < 0) {
> >> + neg_adj = 1;
> >> + ppb = -ppb;
> >> + }
> >> +
> >> + adj = clock->nominal_c_mult;
> >> + adj *= ppb;
> >> + diff = div_u64(adj, NSEC_PER_SEC);
> >> +
> >> + spin_lock(&clock->lock);
> >> + timecounter_read(&clock->tc);
> >> + clock->cycles.mult = neg_adj ? clock->nominal_c_mult - diff :
> >> + clock->nominal_c_mult + diff;
> >> + spin_unlock(&clock->lock);
You have a SW time counter here
> >> + return mlxsw_sp1_ptp_update_phc_adjfreq(clock, neg_adj ? -ppb : ppb);
and a hardware method here?
Why not choose one or the other?
Thanks,
Richard
Powered by blists - more mailing lists