From owner-freebsd-acpi@FreeBSD.ORG Mon Sep 8 22:32:02 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 7E2C61065674; Mon, 8 Sep 2008 22:32:02 +0000 (UTC) (envelope-from nate@root.org) Received: from nlpi101.prodigy.net (nlpi101.prodigy.net [207.115.36.117]) by mx1.freebsd.org (Postfix) with ESMTP id 38CB28FC14; Mon, 8 Sep 2008 22:32:02 +0000 (UTC) (envelope-from nate@root.org) X-ORBL: [71.139.8.213] Received: from [10.0.5.18] (ppp-71-139-8-213.dsl.snfc21.pacbell.net [71.139.8.213]) by nlpi101.prodigy.net (8.13.8 out.dk.spool/8.13.8) with ESMTP id m88MW0Ce011103; Mon, 8 Sep 2008 17:32:01 -0500 Message-ID: <48C5A7E0.3010308@root.org> Date: Mon, 08 Sep 2008 15:32:00 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Pietro Cerutti References: <48C14091.4060309@FreeBSD.org> <48C16810.2030003@root.org> <48C59C98.5020408@FreeBSD.org> <48C5A152.9020505@root.org> <48C5A3B6.2070807@FreeBSD.org> In-Reply-To: <48C5A3B6.2070807@FreeBSD.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@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 22:32:02 -0000 Pietro Cerutti wrote: > Nate Lawson wrote: > | Pietro Cerutti wrote: > |> 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. > | > | But it doesn't just add notification through devd. It adds a thread, > | that separately polls for battery state and sends a notify through devd. > | If the user is running any battery app, there's a double poll for the > | same info. > | > | I subscribe to the design approach that where it makes sense to do > | something in usermode, don't do it in kernel mode. In this case, the IO > | interface is poll-only, and any user app that is running can set its own > | policy for how to deal with the information it gets from polling. > > [snip xbatt-related stuff] > > | Let's keep this in usermode, where policy belongs. > > That's fine. Thanks for reviewing that! Thanks for helping with FreeBSD. Hope you'll work on other stuff in the future. -- Nate