From: Keller, Jacob E <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl
Date: Fri, 15 Apr 2016 21:37:25 +0000 [thread overview]
Message-ID: <1460756245.13811.6.camel@intel.com> (raw)
In-Reply-To: <20160415201602.GA28093@hobbes.lan20.walshnetwork.net>
On Fri, 2016-04-15 at 16:16 -0400, Brian Walsh wrote:
> On Thu, Apr 14, 2016 at 04:29:24PM -0700, Jacob Keller wrote:
> >
> > The e1000e_config_hwtstamp function was incorrectly resetting the
> > SYSTIM
> > registers every time the ioctl was being run. If you happened to be
> > running ptp4l and lost the PTP connect (removing cable, or blocking
> > the
> > UDP traffic for example), then ptp4l will eventually perform a
> > restart
> > which involves re-requesting timestamp settings. In e1000e this has
> > the
> > unfortunate and incorrect result of resetting SYSTIME to the kernel
> > time. Since kernel time is usually in UTC, and PTP time is in TAI,
> > this
> > results in the leap second being re-applied.
> >
> > Fix this by extracting the SYSTIME reset out into its own function,
> > e1000e_ptp_reset, which we call during reset to restore the
> > hardware
> > registers. This function will (a) restart the timecounter based on
> > the
> > new system time, (b) restore the previous PPB setting, and (c)
> > restore
> > the previous hwtstamp settings.
> >
> > In order to perform (b), I had to modify the adjfreq ptp function
> > pointer to store the old delta each time it is called. This also
> > has the
> > side effect of restoring the correct base timinca register
> > correctly.
> > The driver does not need to explicitly zero the ptp_delta variable
> > since
> > the entire adapter structure comes zero-initialized.
> >
> > Reported-by: Brian Walsh <brian@walsh.ws>
> > Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> > ---
> My last attempt was on an older 4.1 kernel. I am seeing the same
> failure
> on the latest 4.6 rc3.
I've sent a v2 that should address that, I didn't realize e1000e_reset
was called prior to e1000e_ptp_init.
Thanks,
Jake
prev parent reply other threads:[~2016-04-15 21:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 23:29 [Intel-wired-lan] [PATCH] e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl Jacob Keller
2016-04-14 23:30 ` Keller, Jacob E
2016-04-15 17:22 ` Brian Walsh
2016-04-15 20:16 ` Brian Walsh
2016-04-15 21:37 ` Keller, Jacob E [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460756245.13811.6.camel@intel.com \
--to=jacob.e.keller@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.