hwclock should not access the x86 RTC using I/O instructions unless explicitly
requested from the command line (--directisa). This issue was encountered
while debugging a boot time race when hwclock.sh was run in parallel.
Addresses-Ubuntu-Bug: 274402
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
if (!ur)
ur = probe_for_kd_clock();
+ /*
+ * This final clause is a really bad idea on x86/AT PCs. You run the
+ * risk of a race condition with another copy of hwclock
+ * that already has /dev/rtc open. The fallback case on
+ * x86 is to then raise I/O priviledge level and access
+ * the RTC CMOS directly using I/O instructions. Simultaneous
+ * access like that can really hose the RTC.
+ */
+#if !defined(__i386__)
if (!ur && !user_requests_ISA)
ur = probe_for_cmos_clock();
+#endif
if (debug) {
if (ur)