Re: (tiny) patch review: return if RTC diag fails

Manuel Bouyer <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Thu, Feb 13, 2025 at 06:39:06AM +0100, Emile `iMil' Heitor wrote:
> 
> Currently in sys/arch/x86/isa/clock.c startrtclock(), the function
> continues to call tc_init() even when mc146818_read(NULL, NVRAM_DIAG)
> fails. This causes the system to hang on qemu/microvm when rtc=on is
> not specified.
> 
> My proposal is to return if RTC BIOS diagnostic fails:

I think it's not right: mc146818_read(NULL, NVRAM_DIAG) returning a non--0
value doens't means that is fails. Usually the RTC BIOS diagnostic has some
error because the chip lost track of date/time (maybe because of a bad
battery). In this case you still want to use the RTC.

Did you check what value is returned in your case ?

-- 
Manuel Bouyer <[email protected]>
     NetBSD: 26 ans d'experience feront toujours la difference
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.