LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-25-2020, 03:43 AM   #1
TurboBlaze
Member
 
Registered: Jan 2018
Location: Russian Federation, Lipetsk region, Dankov
Distribution: Porteus
Posts: 196

Rep: Reputation: Disabled
hwclock iopl() port access failed: function not implemented [SOLVED]


Anybody knows how to fix this issue at boot up
Code:
hwclock iopl() port access failed: function not implemented
I use Kernel 5.7.0-rc2
Code:
grep -i rtc 64bit.config | grep ^CONFIG
CONFIG_HPET_EMULATE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_DRV_RX8010=m
CONFIG_RTC_I2C_AND_SPI=y
CONFIG_RTC_DRV_CMOS=y
CONFIG_INTEL_SMARTCONNECT=m
I took from git 79ef974 commit https://github.com/karelzak/util-linux and builded util-linux-2.35.1-x86_64-4.txz
Quote:
NOTE. Python2 (why not Python3 ???) is stubbornly required for building util-linux.
but it does not help to solve this issue.

Thanks.

Last edited by TurboBlaze; 04-26-2020 at 01:16 PM.
 
Old 04-25-2020, 01:20 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by TurboBlaze View Post
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.

Code:
--with-python=3
 
Old 04-26-2020, 04:20 AM   #3
TurboBlaze
Member
 
Registered: Jan 2018
Location: Russian Federation, Lipetsk region, Dankov
Distribution: Porteus
Posts: 196

Original Poster
Rep: Reputation: Disabled
Code:
--with-python=3
is the same error >>> https://cdn3.radikalno.ru/uploads/20...f0342-full.jpg
Code:
# 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
https://cateee.net/lkddb/web-lkddb/X86_IOPL_IOPERM.html
Probably need to enable CONFIG_X86_IOPL_IOPERM ?

I tried kernel with CONFIG_X86_IOPL_IOPERM but forgot about CAP_SYS_RAWIO - can't to find this option in make menuconfig
Code:
/sbin/setcap cap_sys_rawio=ep /sbin/hwclock
does not help too.

Last edited by TurboBlaze; 04-26-2020 at 06:50 AM.
 
Old 04-26-2020, 09:22 AM   #4
Xsane
Member
 
Registered: Jan 2014
Posts: 186

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by TurboBlaze View Post
Anybody knows how to fix this issue at boot up
Code:
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.

What is the output of:
grep rtc /proc/ioports
 
2 members found this post helpful.
Old 04-26-2020, 10:36 AM   #5
TurboBlaze
Member
 
Registered: Jan 2018
Location: Russian Federation, Lipetsk region, Dankov
Distribution: Porteus
Posts: 196

Original Poster
Rep: Reputation: Disabled
Xsane thanks to point at --directisa
Now is ok!

Code:
hwclock --directisa --systohc
hwclock: iopl() port access failed: function not implemented
"hwclock --directisa" in rc.S and rc.6

As guest:
Code:
# grep rtc /proc/ioports
  0000-0000 : rtc0
As root:
Code:
# cat /proc/ioports
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0064-0064 : keyboard
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
    00f0-00f0 : PNP0C04:00
  03c0-03df : vga+
  0400-041f : iTCO_wdt
  0680-069f : pnp 00:01
  0800-087f : pnp 00:02
  0a00-0a0f : pnp 00:00
  0a10-0a1f : pnp 00:00
  0a20-0a2f : pnp 00:00
  0a30-0a3f : pnp 00:00
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  164e-164f : pnp 00:01
  1800-18fe : pnp 00:01
    1800-1803 : ACPI PM1a_EVT_BLK
    1804-1805 : ACPI PM1a_CNT_BLK
    1808-180b : ACPI PM_TMR
    1850-1850 : ACPI PM2_CNT_BLK
    1854-1857 : pnp 00:04
    1880-189f : ACPI GPE0_BLK
  2000-2fff : PCI Bus 0000:02
  e000-efff : PCI Bus 0000:01
    e000-e0ff : 0000:01:00.0
  f000-f01f : 0000:00:1f.4
    f000-f01f : i801_smbus
  f020-f03f : 0000:00:17.0
    f020-f03f : ahci
  f040-f043 : 0000:00:17.0
    f040-f043 : ahci
  f050-f057 : 0000:00:17.0
    f050-f057 : ahci
  ff00-fffe : pnp 00:07
  ffff-ffff : pnp 00:01
    ffff-ffff : pnp 00:01
      ffff-ffff : pnp 00:01
Code:
# 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
Code:
# ls -l /dev/rtc*
lrwxrwxrwx 1 root root      4 апр 26 18:34 /dev/rtc -> rtc0
crw-r--r-- 1 root root 252, 0 апр 26 18:34 /dev/rtc0

Last edited by TurboBlaze; 04-26-2020 at 01:17 PM.
 
Old 04-26-2020, 03:08 PM   #6
Xsane
Member
 
Registered: Jan 2014
Posts: 186

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by TurboBlaze View Post
Xsane thanks to point at --directisa
Now is ok!
What did you change? Why was the rc.S ioports test failing for you before?
You've marked the thread solved, it needs a solution for future readers.
 
1 members found this post helpful.
Old 04-27-2020, 10:33 AM   #7
TurboBlaze
Member
 
Registered: Jan 2018
Location: Russian Federation, Lipetsk region, Dankov
Distribution: Porteus
Posts: 196

Original Poster
Rep: Reputation: Disabled
I tweaked /etc/rc.d/rc.S
Code:
-# 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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"IOPL not enabled" error trying to run Wine bjharker Linux - Software 4 03-02-2011 12:42 PM
startx fails on Slack 11 - "Failed to set IOPL for I/O" oopsdude Slackware 1 06-13-2007 11:54 AM
xf86EnableIOPorts: Failed to set IOPL for I/O krustylicious Fedora 2 02-06-2007 08:33 PM
Failed to connect to SDP server ...Function not implemented triona Linux - Software 2 03-24-2006 10:03 AM
cdrecord: Function not implemented. shmget failed rksanders Debian 3 12-10-2004 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration