hwclock iopl() port access failed: function not implemented [SOLVED]
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
NOTE. Python2 (why not Python3 ???) is stubbornly required for building util-linux.
No clue with your overall problem, but I you can build util-linux with the following configure option. You might need to make some tweaks to the SlackBuild if it's defaulting to python2.
# hwclock -v
hwclock из util-linux 2.35.254-79ef9
System Time: 1587903894.722506
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Подразумевается, что аппаратные часы выставлены по UTC времени.
Ожидается тиканье часов...
...получено тиканье часов
Время, прочитанное с аппаратных часов: 2020/04/26 12:24:55
Аппаратное время: 2020/04/26 12:24:55 = 1587903895 секунд с 1969
Time since last adjustment is 1587903895 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2020-04-26 12:24:54.224400+00:00
Code:
grep -i iopl 64bit.config
# CONFIG_X86_IOPL_IOPERM is not set
hwclock iopl() port access failed: function not implemented
That is a misleading message, for reasons I won't go into.
The problem is that hwclock is trying to access the RTC directly; this should
never be happening. Direct access on modern multi-thread hardware can lock the rtc
bus and crash the system; that is why the rtc driver will only allow access by
one thread at a time. Pat needs to remove the ports test, that issue was fixed a
long time ago. Do not use --directisa.
# dmesg | grep rtc
[ 0.352139] rtc_cmos 00:03: RTC can wake from S4
[ 0.352623] rtc_cmos 00:03: registered as rtc0
[ 0.352749] rtc_cmos 00:03: setting system clock to 2020-04-26T18:34:44 UTC (1587926084)
[ 0.352750] rtc_cmos 00:03: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
Code:
# hwclock --verbose
hwclock from util-linux 2.35.254-79ef9
System Time: 1587927249.074804
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
The date of the last deviation correction is 1587927223 seconds after 1969
Last calibration date - 1587927223 seconds after 1969
The hardware clock is set to UTC time
It is understood that the hardware clock is set to UTC time.
A ticking clock is expected ...
... clock tick received
The time read from the hardware clock: 2020/04/26 18:54:10
Hardware time: 2020/04/26 18:54:10 = 1587927250 seconds from 1969
Time since last adjustment is 27 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2020-04-26 18:54:09.072468+00:00
-# Set the system time from the hardware clock.
-# Check for a broken motherboard RTC clock (where ioports for rtc are
-# unknown) to prevent hwclock causing a hang:
-grep -qw rtc /proc/ioports || CLOCK_OPT="--directisa"
-if grep -qw "^UTC" /etc/hardwareclock; then
- hwclock $CLOCK_OPT --utc -s &
-else
- hwclock $CLOCK_OPT --localtime -s &
+# Set the system time from the hardware clock using hwclock --hctosys.
+if [ -x /sbin/hwclock ]; then
+ # Check for a broken motherboard RTC clock (where ioports for rtc are
+ # unknown) to prevent hwclock causing a hang:
+ if ! grep -q " : rtc" /proc/ioports ; then
+ CLOCK_OPT="--directisa"
+ fi
+ if [ /etc/adjtime -nt /etc/hardwareclock ]; then
+ if grep -q "^LOCAL" /etc/adjtime ; then
+ echo -n "Setting system time from the hardware clock (localtime): "
+ else
+ echo -n "Setting system time from the hardware clock (UTC): "
+ fi
+ /sbin/hwclock $CLOCK_OPT --hctosys
+ elif grep -wq "^localtime" /etc/hardwareclock 2> /dev/null ; then
+ echo -n "Setting system time from the hardware clock (localtime): "
+ /sbin/hwclock $CLOCK_OPT --localtime --hctosys
+ else
+ echo -n "Setting system time from the hardware clock (UTC): "
+ /sbin/hwclock $CLOCK_OPT --utc --hctosys
+ fi
+ date
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.