From: Keller, Jacob E <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next 2/3] ptp: igb: Use the high resolution frequency method.
Date: Tue, 8 Nov 2016 22:02:22 +0000 [thread overview]
Message-ID: <1478642533.7545.38.camel@intel.com> (raw)
In-Reply-To: <b1d732324e0b1960b294e90ca5eb2a31b6559188.1478526333.git.richardcochran@gmail.com>
On Tue, 2016-11-08 at 22:49 +0100, Richard Cochran wrote:
> The 82580 and related devices offer a frequency resolution of about
> 0.029 ppb.??This patch lets users of the device benefit from the
> increased frequency resolution when tuning the clock.
>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
> ?drivers/net/ethernet/intel/igb/igb_ptp.c | 16 ++++++++--------
> ?1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c
> b/drivers/net/ethernet/intel/igb/igb_ptp.c
> index a7895c4..c30eea8 100644
> --- a/drivers/net/ethernet/intel/igb/igb_ptp.c
> +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
> @@ -226,7 +226,7 @@ static int igb_ptp_adjfreq_82576(struct
> ptp_clock_info *ptp, s32 ppb)
> ? return 0;
> ?}
> ?
> -static int igb_ptp_adjfreq_82580(struct ptp_clock_info *ptp, s32
> ppb)
> +static int igb_ptp_adjfine_82580(struct ptp_clock_info *ptp, long
> scaled_ppm)
> ?{
> ? struct igb_adapter *igb = container_of(ptp, struct
> igb_adapter,
> ? ???????ptp_caps);
> @@ -235,13 +235,13 @@ static int igb_ptp_adjfreq_82580(struct
> ptp_clock_info *ptp, s32 ppb)
> ? u64 rate;
> ? u32 inca;
> ?
> - if (ppb < 0) {
> + if (scaled_ppm < 0) {
> ? neg_adj = 1;
> - ppb = -ppb;
> + scaled_ppm = -scaled_ppm;
> ? }
> - rate = ppb;
> - rate <<= 26;
> - rate = div_u64(rate, 1953125);
> + rate = scaled_ppm;
> + rate <<= 13;
> + rate = div_u64(rate, 15625);
> ?
I'm curious how you generate the new math here, since this can be
tricky, and I could use more examples in order to port to some of the
other drivers implementations. I'm not quit sure how to handle the
value when the lower 16 bits are fractional.
Thanks,
Jake
> ? inca = rate & INCVALUE_MASK;
> ? if (neg_adj)
> @@ -1103,7 +1103,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
> ? adapter->ptp_caps.max_adj = 62499999;
> ? adapter->ptp_caps.n_ext_ts = 0;
> ? adapter->ptp_caps.pps = 0;
> - adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
> + adapter->ptp_caps.adjfine = igb_ptp_adjfine_82580;
> ? adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
> ? adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
> ? adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
> @@ -1131,7 +1131,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
> ? adapter->ptp_caps.n_pins = IGB_N_SDP;
> ? adapter->ptp_caps.pps = 1;
> ? adapter->ptp_caps.pin_config = adapter->sdp_config;
> - adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
> + adapter->ptp_caps.adjfine = igb_ptp_adjfine_82580;
> ? adapter->ptp_caps.adjtime = igb_ptp_adjtime_i210;
> ? adapter->ptp_caps.gettime64 = igb_ptp_gettime_i210;
> ? adapter->ptp_caps.settime64 = igb_ptp_settime_i210;
WARNING: multiple messages have this Message-ID (diff)
From: "Keller, Jacob E" <jacob.e.keller@intel.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"richardcochran@gmail.com" <richardcochran@gmail.com>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
"Manfred.Rudigier@omicron.at" <Manfred.Rudigier@omicron.at>,
"ulrik.debie-os@e2big.org" <ulrik.debie-os@e2big.org>,
"stefan.sorensen@spectralink.com"
<stefan.sorensen@spectralink.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"john.stultz@linaro.org" <john.stultz@linaro.org>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>
Subject: Re: [PATCH net-next 2/3] ptp: igb: Use the high resolution frequency method.
Date: Tue, 8 Nov 2016 22:02:22 +0000 [thread overview]
Message-ID: <1478642533.7545.38.camel@intel.com> (raw)
In-Reply-To: <b1d732324e0b1960b294e90ca5eb2a31b6559188.1478526333.git.richardcochran@gmail.com>
On Tue, 2016-11-08 at 22:49 +0100, Richard Cochran wrote:
> The 82580 and related devices offer a frequency resolution of about
> 0.029 ppb. This patch lets users of the device benefit from the
> increased frequency resolution when tuning the clock.
>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
> drivers/net/ethernet/intel/igb/igb_ptp.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c
> b/drivers/net/ethernet/intel/igb/igb_ptp.c
> index a7895c4..c30eea8 100644
> --- a/drivers/net/ethernet/intel/igb/igb_ptp.c
> +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
> @@ -226,7 +226,7 @@ static int igb_ptp_adjfreq_82576(struct
> ptp_clock_info *ptp, s32 ppb)
> return 0;
> }
>
> -static int igb_ptp_adjfreq_82580(struct ptp_clock_info *ptp, s32
> ppb)
> +static int igb_ptp_adjfine_82580(struct ptp_clock_info *ptp, long
> scaled_ppm)
> {
> struct igb_adapter *igb = container_of(ptp, struct
> igb_adapter,
> ptp_caps);
> @@ -235,13 +235,13 @@ static int igb_ptp_adjfreq_82580(struct
> ptp_clock_info *ptp, s32 ppb)
> u64 rate;
> u32 inca;
>
> - if (ppb < 0) {
> + if (scaled_ppm < 0) {
> neg_adj = 1;
> - ppb = -ppb;
> + scaled_ppm = -scaled_ppm;
> }
> - rate = ppb;
> - rate <<= 26;
> - rate = div_u64(rate, 1953125);
> + rate = scaled_ppm;
> + rate <<= 13;
> + rate = div_u64(rate, 15625);
>
I'm curious how you generate the new math here, since this can be
tricky, and I could use more examples in order to port to some of the
other drivers implementations. I'm not quit sure how to handle the
value when the lower 16 bits are fractional.
Thanks,
Jake
> inca = rate & INCVALUE_MASK;
> if (neg_adj)
> @@ -1103,7 +1103,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
> adapter->ptp_caps.max_adj = 62499999;
> adapter->ptp_caps.n_ext_ts = 0;
> adapter->ptp_caps.pps = 0;
> - adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
> + adapter->ptp_caps.adjfine = igb_ptp_adjfine_82580;
> adapter->ptp_caps.adjtime = igb_ptp_adjtime_82576;
> adapter->ptp_caps.gettime64 = igb_ptp_gettime_82576;
> adapter->ptp_caps.settime64 = igb_ptp_settime_82576;
> @@ -1131,7 +1131,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
> adapter->ptp_caps.n_pins = IGB_N_SDP;
> adapter->ptp_caps.pps = 1;
> adapter->ptp_caps.pin_config = adapter->sdp_config;
> - adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82580;
> + adapter->ptp_caps.adjfine = igb_ptp_adjfine_82580;
> adapter->ptp_caps.adjtime = igb_ptp_adjtime_i210;
> adapter->ptp_caps.gettime64 = igb_ptp_gettime_i210;
> adapter->ptp_caps.settime64 = igb_ptp_settime_i210;
next prev parent reply other threads:[~2016-11-08 22:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 21:49 [Intel-wired-lan] [PATCH net-next 0/3] PHC frequency fine tuning Richard Cochran
2016-11-08 21:49 ` Richard Cochran
2016-11-08 21:49 ` [Intel-wired-lan] [PATCH net-next 1/3] ptp: Introduce a high resolution frequency adjustment method Richard Cochran
2016-11-08 21:49 ` Richard Cochran
2016-11-08 21:49 ` [Intel-wired-lan] [PATCH net-next 2/3] ptp: igb: Use the high resolution frequency method Richard Cochran
2016-11-08 21:49 ` Richard Cochran
2016-11-08 22:02 ` Keller, Jacob E [this message]
2016-11-08 22:02 ` Keller, Jacob E
2016-11-09 13:11 ` [Intel-wired-lan] " Richard Cochran
2016-11-09 13:11 ` Richard Cochran
2016-11-09 21:40 ` [Intel-wired-lan] " Keller, Jacob E
2016-11-09 21:40 ` Keller, Jacob E
2016-11-08 22:04 ` [Intel-wired-lan] " Keller, Jacob E
2016-11-08 22:04 ` Keller, Jacob E
2016-11-09 13:15 ` [Intel-wired-lan] " Richard Cochran
2016-11-09 13:15 ` Richard Cochran
2016-11-08 21:49 ` [Intel-wired-lan] [PATCH net-next 3/3] ptp: dp83640: " Richard Cochran
2016-11-08 21:49 ` Richard Cochran
2016-11-08 21:56 ` [Intel-wired-lan] [PATCH net-next 0/3] PHC frequency fine tuning Keller, Jacob E
2016-11-08 21:56 ` Keller, Jacob E
2016-11-10 2:20 ` [Intel-wired-lan] " David Miller
2016-11-10 2:20 ` David Miller
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=1478642533.7545.38.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.