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)
Wed, Oct 15, 3:34 AM
Unknown Object (File)
Tue, Oct 14, 7:55 PM
Unknown Object (File)
Tue, Oct 14, 7:55 PM
Unknown Object (File)
Tue, Oct 14, 9:34 AM
Unknown Object (File)
Thu, Oct 9, 3:21 PM
Unknown Object (File)
Thu, Oct 2, 9:13 PM
Unknown Object (File)
Tue, Sep 30, 4:10 AM
Unknown Object (File)
Mon, Sep 29, 3:11 AM
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