[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:22964] Re: hwclock can't terminate some PC(was Re: Re: unable to complete shutdown, problem of hwclock?)



佐野@浜松です。

In article <200006251603.BAA18492@xxxxxxxxxxxxxxxxxxxxx>,
  at "Mon, 26 Jun 2000 01:03:26 +0900',
   with "Re: hwclock can't terminate some PC(was  Re: Re: unable to complete shutdown, problem of hwclock?)",
 MATSUDA Yoh-ichi / 松田陽一 <matsuda@xxxxxxxxxxxx> さん writes:

> 今しがた、先週の木曜日の夜にカーネル 2.2.15 に戻した件のマシンにて、
> 試してみました。

> このように、正常に hwclock を実行できたところを鑑みるに、カーネル 2.2.16
> のバグの可能性が高いと思われます。
> まだ断言できませんが…。

 2.2.15 と 2.2.16 で kernel の config は同じ内容のはずなんですよね ?
なにか 2.2.16 で新規追加された設定項目はありませんか ?

> > 今日見た RCB list には

> >   62688  hwclock sets the time incorrectly if RTC is in local time

> > というのがあるみたいですが、62688 は関係あるのでしょうか。
> 
> いえ、このレポートは、マシンが local time に設定されている場合に
> hwclock を実行すると間違った日時を設定する、という内容ですよね?

今日 62688 の内容を確認しました。全然違う状況ですね。ごめんなさい。

> 私の場合、 hwclock が正常終了すれば、上述のログのように、 local time
> に設定されていても正しい時刻が書き込まれます。
> あくまでも「正常終了すれば」の話ですが。

もしかして 9 時間待ってみたら終了するとかいうことではないんですよね ?

 (って、それを試しに確認してみるのも大変だよなあ)

谷川さんから RTC を UTC で使っていれば 2.2.16 + SMP でも問題無いと
いうレポートがあったので、もしかするとカーネル内部で RTC を扱う場合
にデフォルト UTC にするという設定か何かあって、そのへんが hwclock の
 RTC が localtime だという前提と食い違っておかしくなるのかな、とか
想像したもので。

2.2.15 で CONFIG_APM_RTC_IS_GMT が使われているのは i386/kernel/apm.c だけ
みたいですが、2.2.16 だと他の場所でも使われているとか、あるいは SMP の
場合もう UTC を使う前提しか考えられていない、とか。いや、でも今ちょっと
 2.2.15-2.2.16 のパッチを眺めたところではそうでも無いみたいだな。

直接関係の無いところで 2.2.16 のコードに何か RTC の値を変化させてしまう
ものがあるのかも。やっぱり hwclock --show を起動時のいろんなところに
入れて、どこで変化するのか調べるのが早いかもしれない。

あとちょっと前の話ですが

> ところで…
> hwclock って、ハードウェアクロックが余りにもずれていると、修正できない
> 代物なのでしょうか?

こっちは arch/i386/kernel/time.c を読むと

/*
 * In order to set the CMOS clock precisely, set_rtc_mmss has to be
 * called 500 ms after the second nowtime has started, because when
 * nowtime is written into the registers of the CMOS clock, it will
 * jump to the next second precisely 500 ms later. Check the Motorola
 * MC146818A or Dallas DS12887 data sheet for details.
 *
 * BUG: This routine does not handle hour overflow properly; it just
 *      sets the minutes. Usually you'll only notice that after reboot!
 */

        /*
         * since we're only adjusting minutes and seconds,
         * don't interfere with hour overflow. This avoids
         * messing with unknown time zones but requires your
         * RTC not to be off by more than 15 minutes
         */

などと書かれているので、すくなくとも i386 上では時間単位のズレは
無視するし、また RTC と system time のズレが 15 分以内であること
を必要とするみたいです。コメントだけを見ての判断なので実際のコード
とはもしかしたら違うかもしれませんが。

-- 
     # (わたしのおうちは浜松市、「夜のお菓子」で有名さ。)
    <kgh12351@xxxxxxxxxxx> : Taketoshi Sano (佐野 武俊)