From: David Miller <davem@davemloft.net>
To: B38611@freescale.com
Cc: richardcochran@gmail.com, netdev@vger.kernel.org, B20596@freescale.com
Subject: Re: [PATCH net-next 1/1] net: fec: ptp: correct the ENET_ATCOR value
Date: Sun, 07 Jun 2015 15:31:04 -0700 (PDT) [thread overview]
Message-ID: <20150607.153104.632430918032409604.davem@davemloft.net> (raw)
In-Reply-To: <1433496128-3102-1-git-send-email-B38611@freescale.com>
From: Fugang Duan <B38611@freescale.com>
Date: Fri, 5 Jun 2015 17:22:08 +0800
> From: Fugang Duan <b38611@freescale.com>
>
> The current driver adjust freq formula is:
> fe * diff = ppb * pc
> Note:
> fe: ENET ref clock frequency in Hz
> diff = inc_corr - inc: difference between default increment and correction increment
> ppb: parts per billion adjustment from base
> pc: correction period (in number of fe clock cycles)
>
> The correction increment will be used after N cycles of regular increments,
> not every N cycles (with N being the correction period). For example, set ENET_ATCOR=4,
> INC=8, INC_CORR=9, there will be 4 increments of 8 (ENET_ATINC[INC]) , followed by 1
> increment of 9 (ENET_ATINC[INC_CORR]).
>
> So, the correct formula is:
> fe * diff = ppb * (pc + 1)
>
> For ENET_ATCOR, a value 0 disables the correction counter and no corrections occur.
> So base on the origin formula, set pc = pc > 1 ? pc - 1 : pc.
>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Signed-off-by: Frank Li <Frank.Li@freescale.com>
Applied, thank you.
prev parent reply other threads:[~2015-06-07 22:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 9:22 [PATCH net-next 1/1] net: fec: ptp: correct the ENET_ATCOR value Fugang Duan
2015-06-07 22:31 ` David Miller [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=20150607.153104.632430918032409604.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=B20596@freescale.com \
--cc=B38611@freescale.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).