public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
To: Kurt Roeckx <Q@ping.be>
Cc: linux-kernel@vger.kernel.org
Subject: Re: adjtimex/ppskit
Date: Mon, 09 Dec 2002 09:07:35 +0100	[thread overview]
Message-ID: <3DF45D39.24443.3D7228@localhost> (raw)
In-Reply-To: <20021207151404.A3627@ping.be>

On 7 Dec 2002 at 15:14, Kurt Roeckx wrote:

> I have this problem with the ntp/adjtimex.  Ntpd sets the freq
> field to a value outside the valid range.  According to Dave
> Mills, the kernel is supposed to clamp the frequency.  I see that
> in the PPSkit this is done properly ...
> 
> Would it be possible to integrate the PPSkit in the kernel soon?
> 
> If not, could you atleast get parts of it in the kernel, so it
> works correctly with ntpd?

I see: The code used in v2.4.10 of the kernel reads like this:

            if (txc->modes & ADJ_FREQUENCY) {   /* p. 22 */
                if (txc->freq > MAXFREQ || txc->freq < -MAXFREQ) {
                    result = -EINVAL;
                    goto leave;
                }
                time_freq = txc->freq - pps_freq;
            }

The PPSkit code reads like this:

                if (txc->modes & MOD_FREQUENCY) {       /* p. 22 */
                        long freq;              /* frequency ns/s) */
                        freq = txc->freq / SCALE_PPM;
                        if (freq > MAXFREQ) {
                                result = -EINVAL;
                                freq = MAXFREQ;
                        } else if (freq < -MAXFREQ) {
                                result = -EINVAL;
                                freq = -MAXFREQ;
                        }
                        L_LINT(time_freq, freq);
#ifdef CONFIG_NTP_PPS
                        pps.freq = time_freq;
#endif

(So just limit the argument in addition to returning -EINVAL; the other 
differences are because of the modified clock model and nanoseconds)

Returning "-EINVAL" is a subject to discussion, so it could be left out.
I don't have the time to make a proper patch at the moment, but I think 
everyone could fix it until a proper patch is available.

Regards,
Ulrich


> 
> 
> Kurt
> 



       reply	other threads:[~2002-12-09  8:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20021207151404.A3627@ping.be>
2002-12-09  8:07 ` Ulrich Windl [this message]
2002-12-15 10:57   ` adjtimex/ppskit Kurt Roeckx

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=3DF45D39.24443.3D7228@localhost \
    --to=ulrich.windl@rz.uni-regensburg.de \
    --cc=Q@ping.be \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox