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
F108695820: D33896.diff
Mon, Jan 27, 9:13 AM
Unknown Object (File)
Thu, Jan 23, 2:26 AM
Unknown Object (File)
Sep 24 2024, 4:02 AM
Unknown Object (File)
Sep 23 2024, 3:52 AM
Unknown Object (File)
Sep 20 2024, 12:11 AM
Unknown Object (File)
Sep 17 2024, 10:58 PM
Unknown Object (File)
Sep 14 2024, 5:28 PM
Unknown Object (File)
Sep 10 2024, 2:42 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