Subject: Re: [PATCH net-next 1/2] mlx4_en: Add PTP hardware clock

From: Richard Cochran <[email-masked]>
Date: Wed, 25 Dec 2013 12:49:36 +0100

On Tue, Dec 24, 2013 at 05:38:35PM +0200, Hadar Hen Zion wrote:
> 
> The spin lock is needed when reading hardware registers.

Or when using a structure of fields that act together as one object.

> My suggestion is to stay with spin locks in all the places
> protecting timecounter_read()/timecounter_init() and just remove the
> spin lock from timecounter_cyc2time()

If you look at the implementation of timecounter_cyc2time, you will
see that locks are, in fact, needed.

See also the comments in clocksource.h.

Thanks,
Richard