NetBSD-Bugs archive

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

port-amd64/57821: On some machines, NetBSD/amd64 cannot get correct century data



>Number:         57821
>Category:       port-amd64
>Synopsis:       On some machines, NetBSD/amd64 cannot get correct century data
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 05 21:55:00 +0000 2024
>Originator:     Ryo ONODERA
>Release:        NetBSD 10.99.10
>Organization:
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
>Environment:
	
	
System: NetBSD castella 10.99.10 NetBSD 10.99.10 (DTRACE9) #0: Fri Jan 5 17:36:29 JST 2024 ryoon@castella:/usr/world/10.99/amd64/obj/sys/arch/amd64/compile/DTRACE9 amd64
Architecture: x86_64
Machine: amd64
>Description:
On HP Envy 13 ay1000, HP Pavilion Aero 13 be2000 and Hyper-V V2 virtual
machine on Microsoft Windows 11, NetBSD/amd64-current show as follows:

WARNING: NVRAM century is 51 but RTC year is 2024

The number, 51 may vary every boot.
	
>How-To-Repeat:
Boot NetBSD/amd64-current on the machines.
	
>Fix:
	
Apply the following patch:

Index: sys/arch/x86/isa/rtc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/isa/rtc.c,v
retrieving revision 1.2
diff -u -r1.2 rtc.c
--- sys/arch/x86/isa/rtc.c	30 Dec 2022 21:40:20 -0000	1.2
+++ sys/arch/x86/isa/rtc.c	4 Jan 2024 13:12:22 -0000
@@ -275,7 +275,7 @@
 
 	s = splclock();
 #if NACPICA > 0
-	if (acpi_active)
+	if (acpi_active && AcpiGbl_FADT.Century)
 		cmoscentury = mc146818_read(NULL,
 		    (centb = AcpiGbl_FADT.Century));
 	else


On these machines, AcpiGbl_FADT.Century is always 0.
And cmoscentury = mc146818_read(NULL, 0) returns undefined value.
If AcpiGbl_FADT.Century == 0, mc146818_read(NULL, NVRAM_CENTURY)
should be used for cmoscentury.

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index