* RFC hwclock: refactoring
@ 2014-11-22 21:20 JWP
2014-11-23 10:27 ` Benno Schulenberg
2014-11-23 13:31 ` Sami Kerola
0 siblings, 2 replies; 10+ messages in thread
From: JWP @ 2014-11-22 21:20 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
So, I noticed when *fdisk were rewritten that some antiquated
code was dropped. I would like some opinions on whether this
should be done when refactoring hwclock.
For example, do we need a workaround for the 1994 Award BIOS
bug? Do we need Alpha code? Is there a Linux distro that
still officially supports Alpha machines?
Any other ideas regarding this topic are welcome. Thank you in
advance for your time.
Here are some options up for discussion:
ALPHA ONLY
--getepoch
Print the kernel's Hardware Clock epoch value to standard out-
put. This is the number of years into AD to which a zero year
value in the Hardware Clock refers. For example, if you are
using the convention that the year counter in your Hardware
Clock contains the number of full years since 1952, then the
kernel's Hardware Clock epoch value must be 1952.
This epoch value is used whenever hwclock reads or sets the
Hardware Clock.
--setepoch
Set the kernel's Hardware Clock epoch value to the value speci-
fied by the --epoch option. See the --getepoch option for
details.
--epoch=year
Specifies the year which is the beginning of the Hardware
Clock's epoch, that is the number of years into AD to which a
zero value in the Hardware Clock's year counter refers. It is
used together with the --setepoch option to set the kernel's
idea of the epoch of the Hardware Clock, or otherwise to specify
the epoch for use with direct ISA access.
For example, on a Digital Unix machine:
hwclock --setepoch --epoch=1952
--arc This option is equivalent to --epoch=1980 and is used to specify
the most common epoch on Alphas with ARC console (but Ruffians
have epoch 1900).
--srm This option is equivalent to --epoch=1900 and is used to specify
the most common epoch on Alphas with SRM console.
--funky-toy
--jensen
These two options specify what kind of Alpha machine you have.
They are invalid if you don't have an Alpha and are usually
unnecessary if you do, because hwclock should be able to deter-
mine by itself what it's running on, at least when /proc is
mounted. (If you find you need one of these options to make
hwclock work, contact the maintainer to see if the program can
be improved to detect your system automatically. Output of
`hwclock --debug' and `cat /proc/cpuinfo' may be of interest.)
Option --jensen means you are running on a Jensen model. And
--funky-toy means that on your machine one has to use the UF bit
instead of the UIP bit in the Hardware Clock to detect a time
transition. "Toy" in the option name refers to the Time Of Year
facility of the machine.
AWARD BIOS BUG
--badyear
Indicate that the Hardware Clock is incapable of storing years
outside the range 1994-1999. There is a problem in some BIOSes
(almost all Award BIOSes made between 4/26/94 and 5/31/95)
wherein they are unable to deal with years after 1999. If one
attempts to set the year-of-century value to something less than
94 (or 95 in some cases), the value that actually gets set is 94
(or 95). Thus, if you have one of these machines, hwclock can-
not set the year after 1999 and cannot use the value of the
clock as the true time in the normal way.
To compensate for this (without your getting a BIOS update,
which would definitely be preferable), always use --badyear if
you have one of these machines. When hwclock knows it's working
with a brain-damaged clock, it ignores the year part of the
Hardware Clock value and instead tries to guess the year based
on the last calibrated date in the adjtime file, by assuming
that date is within the past year. For this to work, you had
better do a hwclock --set or hwclock --systohc at least once a
year!
Though hwclock ignores the year value when it reads the Hardware
Clock, it sets the year value when it sets the clock. It sets
it to 1995, 1996, 1997, or 1998, whichever one has the same
position in the leap year cycle as the true year. That way, the
Hardware Clock inserts leap days where they belong. Again, if
you let the Hardware Clock run for more than a year without set-
ting it, this scheme could be defeated and you could end up los-
ing a day.
hwclock warns you that you probably need --badyear whenever it
finds your Hardware Clock set to 1994 or 1995.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-22 21:20 RFC hwclock: refactoring JWP
@ 2014-11-23 10:27 ` Benno Schulenberg
2014-11-24 1:56 ` JWP
2014-11-23 13:31 ` Sami Kerola
1 sibling, 1 reply; 10+ messages in thread
From: Benno Schulenberg @ 2014-11-23 10:27 UTC (permalink / raw)
To: JWP; +Cc: Karel Zak, util-linux
Hello JWP,
On Sat, Nov 22, 2014, at 22:20, JWP wrote:
> For example, do we need a workaround for the 1994 Award BIOS
> bug?
In my opinion machines with that BIOS are too old. So no.
Also because I wondered a few times about this phrase:
> hwclock warns you that you probably need --badyear whenever it
> finds your Hardware Clock set to 1994 or 1995.
Nowhere in the source of hwclock can I find this warning. But it
has been there in 2000, because this user reports having gotten it:
https://groups.google.com/d/msg/alt.lang.basic/ilp_6HwLvZE/sE1nBoiD_LcJ
Since no one ever complained that the above phrase in the man page
is incorrect, it most likely means that no one uses such machines
any more.
Benno
--
http://www.fastmail.com - Choose from over 50 domains or use your own
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-23 10:27 ` Benno Schulenberg
@ 2014-11-24 1:56 ` JWP
0 siblings, 0 replies; 10+ messages in thread
From: JWP @ 2014-11-24 1:56 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Karel Zak, util-linux
On 11/23/2014 05:27 AM, Benno Schulenberg wrote:
>
> Hello JWP,
>
> On Sat, Nov 22, 2014, at 22:20, JWP wrote:
>> For example, do we need a workaround for the 1994 Award BIOS
>> bug?
>
> In my opinion machines with that BIOS are too old. So no.
> Also because I wondered a few times about this phrase:
>
>> hwclock warns you that you probably need --badyear whenever it
>> finds your Hardware Clock set to 1994 or 1995.
>
> Nowhere in the source of hwclock can I find this warning. But it
> has been there in 2000, because this user reports having gotten it:
> https://groups.google.com/d/msg/alt.lang.basic/ilp_6HwLvZE/sE1nBoiD_LcJ
>
> Since no one ever complained that the above phrase in the man page
> is incorrect, it most likely means that no one uses such machines
> any more.
>
> Benno
>
Thanks for your time and input Benno!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-22 21:20 RFC hwclock: refactoring JWP
2014-11-23 10:27 ` Benno Schulenberg
@ 2014-11-23 13:31 ` Sami Kerola
2014-11-23 15:32 ` Sami Kerola
2015-02-16 9:02 ` Mike Frysinger
1 sibling, 2 replies; 10+ messages in thread
From: Sami Kerola @ 2014-11-23 13:31 UTC (permalink / raw)
To: JWP; +Cc: Karel Zak, util-linux
On 22 November 2014 at 21:20, JWP <elseifthen@gmx.com> wrote:
> So, I noticed when *fdisk were rewritten that some antiquated
> code was dropped. I would like some opinions on whether this
> should be done when refactoring hwclock.
>
> For example, do we need a workaround for the 1994 Award BIOS
> bug?
I agree with Benno, it is time to say goodbye to that code.
> Do we need Alpha code? Is there a Linux distro that
> still officially supports Alpha machines?
I'm not sure if there is any up to date distribution for Alpha. Kernel
crew seems to still care alpha, so it is not completely dead.
http://marc.info/?t=140518903000002&r=1&w=2
Maybe the question should be rephrased. How about dropping the Alpha
cmos support? It looks like Alpha has rtc support.
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/alpha/kernel/rtc.c
> Any other ideas regarding this topic are welcome.
Removal of i386 references should be safe.
http://news.softpedia.com/news/Linux-Kernel-3-8-Says-Goodbye-to-i386-314293.shtml
Since there is no other than Alpha & i386 references to cmos code, all
of it is subject for removal.
--
Sami Kerola
http://www.iki.fi/kerolasa/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-23 13:31 ` Sami Kerola
@ 2014-11-23 15:32 ` Sami Kerola
2014-11-24 1:54 ` JWP
2015-02-16 9:02 ` Mike Frysinger
1 sibling, 1 reply; 10+ messages in thread
From: Sami Kerola @ 2014-11-23 15:32 UTC (permalink / raw)
To: JWP; +Cc: Karel Zak, util-linux
On 23 November 2014 at 13:31, Sami Kerola <kerolasa@iki.fi> wrote:
> On 22 November 2014 at 21:20, JWP <elseifthen@gmx.com> wrote:
>> So, I noticed when *fdisk were rewritten that some antiquated
>> code was dropped. I would like some opinions on whether this
>> should be done when refactoring hwclock.
>>
>> For example, do we need a workaround for the 1994 Award BIOS
>> bug?
>
> I agree with Benno, it is time to say goodbye to that code.
>
>> Do we need Alpha code? Is there a Linux distro that
>> still officially supports Alpha machines?
>
> I'm not sure if there is any up to date distribution for Alpha. Kernel
> crew seems to still care alpha, so it is not completely dead.
>
> http://marc.info/?t=140518903000002&r=1&w=2
>
> Maybe the question should be rephrased. How about dropping the Alpha
> cmos support? It looks like Alpha has rtc support.
>
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/alpha/kernel/rtc.c
>
>> Any other ideas regarding this topic are welcome.
>
> Removal of i386 references should be safe.
>
> http://news.softpedia.com/news/Linux-Kernel-3-8-Says-Goodbye-to-i386-314293.shtml
>
> Since there is no other than Alpha & i386 references to cmos code, all
> of it is subject for removal.
JWP,
It's a rainy day here, so I decided to make initial attempt to remove
cmos & --badyear. Maybe something like these are what you are thinking
of.
https://github.com/kerolasa/lelux-utiliteetit/commit/fa8825f77996dfad39bd09240729287706f6e72f
https://github.com/kerolasa/lelux-utiliteetit/commit/74edf1aa9c16d351e9fdb25a961ec1932c60c674
After a clean up like that there is still tons to do. For example this
snippet here
/*
* struct rtc_time is present since 1.3.99.
* Earlier (since 1.3.89), a struct tm was used.
*/
is screaming obsolete.
--
Sami Kerola
http://www.iki.fi/kerolasa/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-23 15:32 ` Sami Kerola
@ 2014-11-24 1:54 ` JWP
2014-11-24 10:14 ` Karel Zak
0 siblings, 1 reply; 10+ messages in thread
From: JWP @ 2014-11-24 1:54 UTC (permalink / raw)
To: kerolasa; +Cc: Karel Zak, util-linux
On 11/23/2014 10:32 AM, Sami Kerola wrote:
>> On 23 November 2014 at 13:31, Sami Kerola <kerolasa@iki.fi> wrote:
>>> On 22 November 2014 at 21:20, JWP <elseifthen@gmx.com> wrote:
>>> So, I noticed when *fdisk were rewritten that some antiquated
>>> code was dropped. I would like some opinions on whether this
>>> should be done when refactoring hwclock.
>>>
>>> For example, do we need a workaround for the 1994 Award BIOS
>>> bug?
>>
>> I agree with Benno, it is time to say goodbye to that code.
>>
>>> Do we need Alpha code? Is there a Linux distro that
>>> still officially supports Alpha machines?
>>
>> I'm not sure if there is any up to date distribution for Alpha. Kernel
>> crew seems to still care alpha, so it is not completely dead.
>>
>> http://marc.info/?t=140518903000002&r=1&w=2
>>
>> Maybe the question should be rephrased. How about dropping the Alpha
>> cmos support? It looks like Alpha has rtc support.
I intentionally did not include --directisa and hwclock-cmos.c in my
RFC, because my current position is that I2C access should remain in
hwclock for troubleshooting and testing purposes.
Your marc.info link seems to be broken.
>>
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/alpha/kernel/rtc.c
>>
>>> Any other ideas regarding this topic are welcome.
>>
>> Removal of i386 references should be safe.
>>
>> http://news.softpedia.com/news/Linux-Kernel-3-8-Says-Goodbye-to-i386-314293.shtml
>>
>> Since there is no other than Alpha & i386 references to cmos code, all
>> of it is subject for removal.
The __i386__ macro is set for all x86 platforms. They all support the ISA
architecture and therefore can use direct access methods to the persistent
clock. That includes x86_64, even though the current iteration of hwclock
does not allow it, which is one of many hwclock bugs I will be fixing.
>
> JWP,
>
> It's a rainy day here, so I decided to make initial attempt to remove
> cmos & --badyear. Maybe something like these are what you are thinking
> of.
>
> https://github.com/kerolasa/lelux-utiliteetit/commit/fa8825f77996dfad39bd09240729287706f6e72f
> https://github.com/kerolasa/lelux-utiliteetit/commit/74edf1aa9c16d351e9fdb25a961ec1932c60c674
>
> After a clean up like that there is still tons to do. For example this
> snippet here
>
> /*
> * struct rtc_time is present since 1.3.99.
> * Earlier (since 1.3.89), a struct tm was used.
> */
>
> is screaming obsolete.
>
All of the code will be changing, Karel ask me to refactor it outside
of the main development channel. I wanted to see if the Alpha and
Award code was somehow important to someone. My opinion is to remove
it, but maybe there is something I am unaware of.
Even the source for the aboot Alpha boot-loader, and the previous center
of all things Linux-Alpha, alphalinux.org is gone.
I do wonder why the kernel hasn't dropped it yet though.
I'm curious as to what Mr. Z's thoughts are going to be.
Thanks for your time and input Sami!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-24 1:54 ` JWP
@ 2014-11-24 10:14 ` Karel Zak
0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2014-11-24 10:14 UTC (permalink / raw)
To: JWP; +Cc: kerolasa, util-linux
On Sun, Nov 23, 2014 at 08:54:59PM -0500, JWP wrote:
> I intentionally did not include --directisa and hwclock-cmos.c in my
> RFC, because my current position is that I2C access should remain in
> hwclock for troubleshooting and testing purposes.
Sure, hwclock-cmos.c is still usable.
> of the main development channel. I wanted to see if the Alpha and
> Award code was somehow important to someone. My opinion is to remove
> it, but maybe there is something I am unaware of.
I think we don't have to care about Award workarounds at all.
Linux kernel provides RTC layer for Alpha, the question is usability,
but I think we can be optimistic and drop the alpha specific cmos code :-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2014-11-23 13:31 ` Sami Kerola
2014-11-23 15:32 ` Sami Kerola
@ 2015-02-16 9:02 ` Mike Frysinger
2015-02-16 11:37 ` J William Piggott
1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2015-02-16 9:02 UTC (permalink / raw)
To: kerolasa; +Cc: JWP, Karel Zak, util-linux
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
On 23 Nov 2014 13:31, Sami Kerola wrote:
> On 22 November 2014 at 21:20, JWP wrote:
> > Do we need Alpha code? Is there a Linux distro that
> > still officially supports Alpha machines?
>
> I'm not sure if there is any up to date distribution for Alpha.
Gentoo still produces up-to-date releases
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2015-02-16 9:02 ` Mike Frysinger
@ 2015-02-16 11:37 ` J William Piggott
2015-02-16 12:32 ` Mike Frysinger
0 siblings, 1 reply; 10+ messages in thread
From: J William Piggott @ 2015-02-16 11:37 UTC (permalink / raw)
To: Karel Zak, util-linux, Mike Frysinger
On 02/16/2015 04:02 AM, Mike Frysinger wrote:
> On 23 Nov 2014 13:31, Sami Kerola wrote:
>> On 22 November 2014 at 21:20, JWP wrote:
>>> Do we need Alpha code? Is there a Linux distro that
>>> still officially supports Alpha machines?
>>
>> I'm not sure if there is any up to date distribution for Alpha.
>
> Gentoo still produces up-to-date releases
> -mike
>
Hello Mike,
Yes, I contacted the two most authoritative Alpha people I could find,
Tobias Klausmann and Matt Turner. Matt requested that we continue to
maintain hwclock's Alpha code. I forgot to post a follow up here about
it, sorry.
William
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RFC hwclock: refactoring
2015-02-16 11:37 ` J William Piggott
@ 2015-02-16 12:32 ` Mike Frysinger
0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2015-02-16 12:32 UTC (permalink / raw)
To: J William Piggott; +Cc: Karel Zak, util-linux
[-- Attachment #1: Type: text/plain, Size: 861 bytes --]
On 16 Feb 2015 06:37, J William Piggott wrote:
> On 02/16/2015 04:02 AM, Mike Frysinger wrote:
> > On 23 Nov 2014 13:31, Sami Kerola wrote:
> >> On 22 November 2014 at 21:20, JWP wrote:
> >>> Do we need Alpha code? Is there a Linux distro that
> >>> still officially supports Alpha machines?
> >>
> >> I'm not sure if there is any up to date distribution for Alpha.
> >
> > Gentoo still produces up-to-date releases
>
> Yes, I contacted the two most authoritative Alpha people I could find,
> Tobias Klausmann and Matt Turner. Matt requested that we continue to
> maintain hwclock's Alpha code. I forgot to post a follow up here about
> it, sorry.
no worries. if people are interested in refactoring code and want to verify
alpha works (and qemu-system isn't doing it for them), we can get you access
to real alpha hardware :).
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-02-16 12:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-22 21:20 RFC hwclock: refactoring JWP
2014-11-23 10:27 ` Benno Schulenberg
2014-11-24 1:56 ` JWP
2014-11-23 13:31 ` Sami Kerola
2014-11-23 15:32 ` Sami Kerola
2014-11-24 1:54 ` JWP
2014-11-24 10:14 ` Karel Zak
2015-02-16 9:02 ` Mike Frysinger
2015-02-16 11:37 ` J William Piggott
2015-02-16 12:32 ` Mike Frysinger
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.