> On 13 Sep 2016, at 20:00, Richard Cochran <richardcoch...@gmail.com> wrote:
> 
> On Tue, Sep 13, 2016 at 09:32:39AM +0100, Kieran Tyrrell wrote:
>> Should the ptp capabilities (in the igb case) state the number of
>> alarms as 2? (even though only one can be enabled at a time, and in
>> fact you can create hundreds of posix timers off a single hardware
>> alarm?
> 
> Looking back, it is unfortunate that the ptp_clock_caps.n_alarm field
> is named like that.  We only need one bit to tell the user that a
> driver supports timers.
> 
> In addition to that, there should some indication of the number of
> interrupt sources (i210 has 2) and their connection to the timer,
> periodic output, and pps features, if any.  Something like
> PTP_PIN_GETFUNC/_SETFUNC.
> 
>> Just want to get it straight with you before I start coding, thanks!
> 
> I haven't given it much thought, and I am open to creative
> suggestions.  My only requirement is that the user will be able to
> query the capabilities and dial what he wants.  For the other features
> we advertise the number of feature channels and the number of pins.
> The user decides which channel to use on each pin.  If there are fewer
> pins than channels, then it is clear that he can't have everything at
> once.
> 
> For now, if you would rather concentrate on the actual timer code,
> just set i210's caps to n_alarm=1 and n_per_out=1 and leave the rest
> as a todo.

I wouldn’t be comfortable removing one of the periodic outputs from igb in case 
anyone is using both. I’ve added an ioctl to enable/disable the timer 
functionality on either of the two channels (TT0/TT1). Of course you can only 
set it on one at a time.
Personally I preferred the approach of posix timer_create() allocating the 
hardware required when the first timer was created, but the ioctl fulfils the 
requirement of putting the user in control. We now have the situation though 
that timer_create() will succeed, but timer_settime() can fail, as the PTP 
subsystem isn’t allocating the hardware timer any more, the user is. Also the 
user could now disable the hardware timer while posix timers are created and 
active, leaving them hanging.

I’ll post a patch containing my latest code (sorry ptp and igb will be mixed 
together in this patch) and if it looks ok I’ll separate out the ptp and igb 
parts for a proper patch.

Thanks, Kieran.



------------------------------------------------------------------------------
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to