From owner-freebsd-acpi@FreeBSD.ORG Mon Sep 8 21:44:00 2008 Return-Path: Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA4C81065671; Mon, 8 Sep 2008 21:44:00 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id 60DC58FC1A; Mon, 8 Sep 2008 21:44:00 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from [213.142.183.219] (helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KcoWd-0005xa-EP; Mon, 08 Sep 2008 23:43:59 +0200 Message-ID: <48C59C98.5020408@FreeBSD.org> Date: Mon, 08 Sep 2008 23:43:52 +0200 From: Pietro Cerutti Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.16 (X11/20080807) MIME-Version: 1.0 To: Nate Lawson References: <48C14091.4060309@FreeBSD.org> <48C16810.2030003@root.org> In-Reply-To: <48C16810.2030003@root.org> X-Enigmail-Version: 0.95.6 OpenPGP: id=9571F78E; url=http://gahr.ch/pgp/ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Source: X-Source-Args: X-Source-Dir: Cc: freebsd-acpi@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: kern/124223: [acpi] [patch] acpi_battery.c -- Notify user-defined critical level via devd(8) X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 21:44:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Nate Lawson wrote: | There are a few problems with your approach. | | Critical status is already reported with a flag when usermode polls for | the battery status: |> if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) { |> if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) { |> sc->flags |= ACPI_BATT_STAT_CRITICAL; |> device_printf(dev, "critically low charge!\n"); |> } |> } I agree. Critical level is already checked for in the cmbat module. However, reporting is not done in a "standardized" way. My patch would just like to add notification through devd. | Since usermode utilities already poll, they can handle that flag or | implement their own notion of critical battery level. Why introduce a | new kernel thread to do that same polling? Because you can't configure the notion of "critical level" via cmbat. | | Don't common battery status tools that poll (say, xbatt) have their own | way to set a critical level? xbatt uses APM and ioctl to get the status of the battery. I agree that userlevel utilities can e.g., retrieve the remaining percent and set the critical level arbitrarily, but I anyway think that a configurable level to be seen as critical by the OS could be a useful addition. I'm open to discussions about the best way to implement it (cmbat, battery, ...?), if we get to an agreement that this could be a useful feature :) Otherwise feel free to close the PR, as I can accept your arguments. | | -Nate | | Pietro Cerutti wrote: |> POKE! |> |> Anybody interested in reviewing it? | - -- Pietro Cerutti gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEAREKAAYFAkjFnJcACgkQwMJqmJVx946mtgCgivQVqG6nrctsffXFdm5HRQfX 1OUAoL9TXYwwiNfHvnUclKAhVzWcnw9S =3q5J -----END PGP SIGNATURE-----