All of lore.kernel.org
 help / color / mirror / Atom feed
* igb: acknowledging time sync interrupts
@ 2013-05-26 10:39 Richard Cochran
  2013-05-28 15:20 ` Vick, Matthew
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Cochran @ 2013-05-26 10:39 UTC (permalink / raw)
  To: Matthew Vick; +Cc: e1000-devel, netdev

Matt,

In igb_main.c you have ISR code like:

	if (icr & E1000_ICR_TS) {
		u32 tsicr = rd32(E1000_TSICR);

		if (tsicr & E1000_TSICR_TXTS) {
			/* acknowledge the interrupt */
			wr32(E1000_TSICR, E1000_TSICR_TXTS);
			/* retrieve hardware timestamp */
			schedule_work(&adapter->ptp_tx_work);
		}
	}

In the datasheet for the 82580 and the i210, for TSICR it says,

   Note: Once ICR.Time_Sync is set, the internal value of this
         register should be cleared by writing 1b to all bits
         or cleared by a read to enable receiving an additional
         ^^^^^^^^^^^^^^^^^^^^
         ICR.Time_Sync interrupt.

and that implies that your write to acknowledge the interrupt is
superfluous, since you already read the TSICR.

Is this an error in the datasheets, or is the code doing extra,
unneeded work?

Thanks,
Richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: igb: acknowledging time sync interrupts
  2013-05-26 10:39 igb: acknowledging time sync interrupts Richard Cochran
@ 2013-05-28 15:20 ` Vick, Matthew
  2013-05-28 16:06   ` Richard Cochran
  0 siblings, 1 reply; 4+ messages in thread
From: Vick, Matthew @ 2013-05-28 15:20 UTC (permalink / raw)
  To: Richard Cochran; +Cc: e1000-devel, netdev

On 5/26/13 3:39 AM, "Richard Cochran" <richardcochran@gmail.com> wrote:

>Matt,
>
>In igb_main.c you have ISR code like:
>
>	if (icr & E1000_ICR_TS) {
>		u32 tsicr = rd32(E1000_TSICR);
>
>		if (tsicr & E1000_TSICR_TXTS) {
>			/* acknowledge the interrupt */
>			wr32(E1000_TSICR, E1000_TSICR_TXTS);
>			/* retrieve hardware timestamp */
>			schedule_work(&adapter->ptp_tx_work);
>		}
>	}
>
>In the datasheet for the 82580 and the i210, for TSICR it says,
>
>   Note: Once ICR.Time_Sync is set, the internal value of this
>         register should be cleared by writing 1b to all bits
>         or cleared by a read to enable receiving an additional
>         ^^^^^^^^^^^^^^^^^^^^
>         ICR.Time_Sync interrupt.
>
>and that implies that your write to acknowledge the interrupt is
>superfluous, since you already read the TSICR.
>
>Is this an error in the datasheets, or is the code doing extra,
>unneeded work?
>
>Thanks,
>Richard

Richard,

Good catch--and you're correct--but I had issues with the read of TSICR
not clearing like it should on the 82580 (but it would work fine on the
I350 and I210). I decided the cleaner implementation would be to
explicitly acknowledge the interrupt across the board. I haven't had the
time to follow up with the hardware team, but my suspicion is that it's an
errata with the 82580.

I'll start some internal discussion to see if I can get an official answer
on the 82580.

Cheers,
Matthew


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: igb: acknowledging time sync interrupts
  2013-05-28 15:20 ` Vick, Matthew
@ 2013-05-28 16:06   ` Richard Cochran
  2013-05-29 17:42     ` Vick, Matthew
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Cochran @ 2013-05-28 16:06 UTC (permalink / raw)
  To: Vick, Matthew; +Cc: e1000-devel, netdev

On Tue, May 28, 2013 at 03:20:10PM +0000, Vick, Matthew wrote:
> 
> I'll start some internal discussion to see if I can get an official answer
> on the 82580.

Okay, that sounds good. I just posted a patch that removes the wr32(),
and I can report that it does work on the i210. If the 82580 needs
this workaround, then I can add it back in again.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: igb: acknowledging time sync interrupts
  2013-05-28 16:06   ` Richard Cochran
@ 2013-05-29 17:42     ` Vick, Matthew
  0 siblings, 0 replies; 4+ messages in thread
From: Vick, Matthew @ 2013-05-29 17:42 UTC (permalink / raw)
  To: Richard Cochran; +Cc: e1000-devel, netdev

On 5/28/13 9:06 AM, "Richard Cochran" <richardcochran@gmail.com> wrote:

>On Tue, May 28, 2013 at 03:20:10PM +0000, Vick, Matthew wrote:
>> 
>> I'll start some internal discussion to see if I can get an official
>>answer
>> on the 82580.
>
>Okay, that sounds good. I just posted a patch that removes the wr32(),
>and I can report that it does work on the i210. If the 82580 needs
>this workaround, then I can add it back in again.
>
>Thanks,
>Richard

Following up internally, we got confirmation 82580 does have an issue with
the read of TSICR not clearing it. Please do add the wr32 back in and keep
an eye out for updated documentation.

Cheers,
Matthew

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-29 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-26 10:39 igb: acknowledging time sync interrupts Richard Cochran
2013-05-28 15:20 ` Vick, Matthew
2013-05-28 16:06   ` Richard Cochran
2013-05-29 17:42     ` Vick, Matthew

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.