Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Fix the previous commit properly: we need to se...



details:   https://anonhg.NetBSD.org/src/rev/bba272333afc
branches:  trunk
changeset: 753294:bba272333afc
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Mon Mar 22 15:08:35 2010 +0000

description:
Fix the previous commit properly: we need to set all sensor-flags during the
initialization of sysmon_envsys(9), otherwise, if _STA does not return true
during the attachment of the driver, it is possible that a flag is never
set. This flaw has always been present, but it only got exposed after the
conversion to use the sysmon-limits.

diffstat:

 sys/dev/acpi/acpi_bat.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 1efec0978edb -r bba272333afc sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Mon Mar 22 14:47:02 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Mon Mar 22 15:08:35 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.93 2010/03/22 09:31:24 jruoho Exp $     */
+/*     $NetBSD: acpi_bat.c,v 1.94 2010/03/22 15:08:35 jruoho Exp $     */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.93 2010/03/22 09:31:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.94 2010/03/22 15:08:35 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -418,8 +418,6 @@
         */
        val = sc->sc_sensor[ACPIBAT_LFCCAPACITY].value_cur;
        sc->sc_sensor[ACPIBAT_CAPACITY].value_max = val;
-       sc->sc_sensor[ACPIBAT_CAPACITY].flags |=
-           ENVSYS_FPERCENT | ENVSYS_FVALID_MAX;
 
        acpibat_print_info(dv, elm);
 
@@ -697,7 +695,9 @@
 
 #undef INITDATA
 
-       sc->sc_sensor[ACPIBAT_CAPACITY].flags |= ENVSYS_FMONLIMITS;
+       sc->sc_sensor[ACPIBAT_CAPACITY].flags |=
+           ENVSYS_FPERCENT | ENVSYS_FVALID_MAX | ENVSYS_FMONLIMITS;
+
        sc->sc_sensor[ACPIBAT_CHARGE_STATE].flags |= ENVSYS_FMONSTCHANGED;
 
        /* Disable userland monitoring on these sensors. */



Home | Main Index | Thread Index | Old Index