Page MenuHomeFreeBSD

atrtc.c: handle _STA object indcate it is not functional.
Needs ReviewPublic

Authored by takawata on Jan 14 2022, 6:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 23, 3:41 PM
Unknown Object (File)
Sun, Nov 23, 3:36 PM
Unknown Object (File)
Sun, Nov 23, 3:30 PM
Unknown Object (File)
Sun, Nov 16, 7:44 PM
Unknown Object (File)
Oct 30 2025, 12:37 PM
Unknown Object (File)
Oct 15 2025, 3:34 AM
Unknown Object (File)
Oct 14 2025, 7:55 PM
Unknown Object (File)
Oct 14 2025, 7:55 PM
Subscribers
None

Details

Reviewers
wulf
imp
jhb
Summary

Enable cmos register access from ACPI only and relux register access restriction when RTC _STA object indicate not functional. This is needed for upcoming ACPI000E device (I name it acpi_rtc.) for some implementation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43923
Build 40811: arc lint + arc unit

Event Timeline

takawata created this revision.
sys/x86/isa/atrtc.c
508

blank line is missed

510
- if (acpi_rtc_is_present){
+ if (acpi_rtc_is_present) {
514
- }else{
+ } else {
534

blank line is missed

535
- if(sc->is_active)
+ if (sc->is_active)
sys/x86/isa/atrtc.c
298

I do not understand what !acpi_rtc_is_present check does here.
This code opens a lot of RTC registers for write if execution of _STA method returned 'Not present'.
To make region handler dummy, if it is required, !acpi_rtc_is_present check should be moved to atrtc_acpi_cmos_handler() and should return AE_OK on success.
P.S. soft context is available in atrtc_acpi_cmos_handler(), so acpi_rtc_is_present global variable may be converted to sc->is_present