On Fri, Sep 09, 2016 at 10:42:15PM +0100, Kieran Tyrrell wrote:
> @@ -5638,17 +5638,29 @@ static void igb_tsync_interrupt(struct igb_adapter
> *adapter)
> }
>
> if (tsicr & TSINTR_TT0) {
> - spin_lock(&adapter->tmreg_lock);
> - ts = timespec64_add(adapter->perout[0].start,
> - adapter->perout[0].period);
> - /* u32 conversion of tv_sec is safe until y2106 */
> - wr32(E1000_TRGTTIML0, ts.tv_nsec);
> - wr32(E1000_TRGTTIMH0, (u32)ts.tv_sec);
> - tsauxc = rd32(E1000_TSAUXC);
> - tsauxc |= TSAUXC_EN_TT0;
> - wr32(E1000_TSAUXC, tsauxc);
> - adapter->perout[0].start = ts;
> - spin_unlock(&adapter->tmreg_lock);
> + if (adapter->timer_enabled) {
> + /* disable timer */
> + spin_lock(&adapter->tmreg_lock);
> + igb_tt0_timer_enable(adapter, false);
> + spin_unlock(&adapter->tmreg_lock);
> + event.type = PTP_CLOCK_ALARM;
> + event.index = 0;
> + ptp_clock_event(adapter->ptp_clock, &event);
The functional interface between the PHC layer and the driver should
allow an immediate reprogramming of the HW's interrupt control
registers, don't you think?
Thanks,
Richard
> + }
> + else {
> + /* this is a periodic output interrupt */
> + spin_lock(&adapter->tmreg_lock);
> + ts = timespec64_add(adapter->perout[0].start,
> + adapter->perout[0].period);
> + /* u32 conversion of tv_sec is safe until y2106 */
> + wr32(E1000_TRGTTIML0, ts.tv_nsec);
> + wr32(E1000_TRGTTIMH0, (u32)ts.tv_sec);
> + tsauxc = rd32(E1000_TSAUXC);
> + tsauxc |= TSAUXC_EN_TT0;
> + wr32(E1000_TSAUXC, tsauxc);
> + adapter->perout[0].start = ts;
> + spin_unlock(&adapter->tmreg_lock);
> + }
> ack |= TSINTR_TT0;
> }
------------------------------------------------------------------------------
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel