powerd never initializes the variable that keeps the status of the line status. This variable defaults to 0 (with the compiler? with the arch?) and results in powerd using the AC profile. This is a problem, since at start it says it is in unkown status, but doesn't respect the -n argument. Note: since the variable is not initialized, it can lead to other unexpected behaviour. Fix: Initialize the variable How-To-Repeat: This should use the "adaptive" profile specified by -n, but uses hiadaptive # /usr/sbin/powerd -i 50 -r 80 -M 1800 -v -p 1000 -n adaptive powerd: unable to determine AC line status CPU frequency is above user-defined maximum; changing frequency to 1795 MHz load 15%, current freq 1795 MHz ( 0), wanted freq 2094 MHz
I suspect this is correct, but cc'ing acpi@ to see if anyone there has any comments. -- John Baldwin
Responsible Changed From-To: freebsd-amd64->freebsd-bugs reclassify.
Author: brueffer Date: Tue Feb 11 15:16:49 2014 New Revision: 261773 URL: http://svnweb.freebsd.org/changeset/base/261773 Log: In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez <loox at e-shell.net> Reviewed by: jhb MFC after: 2 weeks Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Tue Feb 11 13:33:03 2014 (r261772) +++ head/usr.sbin/powerd/powerd.c Tue Feb 11 15:16:49 2014 (r261773) @@ -279,6 +279,7 @@ static void acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Committed. thanks! Sorry for the long waiting time.
Responsible Changed From-To: freebsd-bugs->brueffer MFC reminder.
Author: brueffer Date: Tue Feb 25 07:55:03 2014 New Revision: 262474 URL: http://svnweb.freebsd.org/changeset/base/262474 Log: MFC: r261773 In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez <loox at e-shell.com> Reviewed by: jhb Modified: stable/10/usr.sbin/powerd/powerd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/powerd/powerd.c ============================================================================== --- stable/10/usr.sbin/powerd/powerd.c Tue Feb 25 07:40:37 2014 (r262473) +++ stable/10/usr.sbin/powerd/powerd.c Tue Feb 25 07:55:03 2014 (r262474) @@ -279,6 +279,7 @@ static void acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: brueffer Date: Tue Feb 25 07:57:17 2014 New Revision: 262475 URL: http://svnweb.freebsd.org/changeset/base/262475 Log: MFC: r261773 In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez <loox at e-shell.com> Reviewed by: jhb Modified: stable/9/usr.sbin/powerd/powerd.c Directory Properties: stable/9/usr.sbin/powerd/ (props changed) Modified: stable/9/usr.sbin/powerd/powerd.c ============================================================================== --- stable/9/usr.sbin/powerd/powerd.c Tue Feb 25 07:55:03 2014 (r262474) +++ stable/9/usr.sbin/powerd/powerd.c Tue Feb 25 07:57:17 2014 (r262475) @@ -278,6 +278,7 @@ static void acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: brueffer Date: Tue Feb 25 07:59:33 2014 New Revision: 262476 URL: http://svnweb.freebsd.org/changeset/base/262476 Log: MFC: r261773 In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez <loox at e-shell.com> Reviewed by: jhb Modified: stable/8/usr.sbin/powerd/powerd.c Directory Properties: stable/8/usr.sbin/powerd/ (props changed) Modified: stable/8/usr.sbin/powerd/powerd.c ============================================================================== --- stable/8/usr.sbin/powerd/powerd.c Tue Feb 25 07:57:17 2014 (r262475) +++ stable/8/usr.sbin/powerd/powerd.c Tue Feb 25 07:59:33 2014 (r262476) @@ -274,6 +274,7 @@ static void acline_init() { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: patched->closed Merge to stable branches done.