| From | Sent On | Attachments |
|---|
| Subject: | no way to force AC state if current one is none | |
|---|---|---|
| From: | Rui Paulo (rpa...@FreeBSD.org) | |
| Date: | Feb 15, 2008 6:09:30 pm | |
| List: | org.freebsd.freebsd-acpi | |
Refine Search
| From | Sent On | Attachments |
|---|---|---|
| Andriy Gapon | Feb 1, 2008 8:13 am | |
| Andriy Gapon | Feb 11, 2008 1:29 pm | |
| Nate Lawson | Feb 12, 2008 12:28 am | |
| Nate Lawson | Feb 15, 2008 3:34 pm | |
| Rui Paulo | Feb 15, 2008 6:09 pm | |
| Andriy Gapon | Feb 16, 2008 1:41 am |
| Subject: | no way to force AC state if current one is none | |
|---|---|---|
| From: | Rui Paulo (rpa...@FreeBSD.org) | |
| Date: | Feb 15, 2008 6:09:30 pm | |
| List: | org.freebsd.freebsd-acpi | |
On Feb 15, 2008, at 11:34 PM, Nate Lawson wrote:
Andriy Gapon wrote:
on 01/02/2008 18:13 Andriy Gapon said the following:
I noticed that I can force AC state change via sysctl if current state is none/-1. Typo above, it should read "I can not". acpi_tz_monitor() has the following lines:
/* Handle user override of active mode */ if (sc->tz_requested != TZ_ACTIVE_NONE && sc->tz_requested < newactive) newactive = sc->tz_requested;
If say tz_requested is 1, but auto-calculated newactive is -1 (none), then this check fails and tz_requested is ignored.
Small extra note: this is because the "none" state (least/zero cooling activity) has code -1, while other states are arranged so that the lower the number the higher cooling activity is. So there is an exclusion from normal integer comparison.
It seems there should be a check that newactive is not -1: if (sc->tz_requested != TZ_ACTIVE_NONE && (newactive == TZ_ACTIVE_NONE || sc->tz_requested < newactive))
What do you think ?
This is also correct as per the similar code block above.
I committed it. Thanks Andriy.
Regards.
-- Rui Paulo

