From owner-freebsd-acpi@FreeBSD.ORG Fri Sep 5 17:30:05 2008 Return-Path: Delivered-To: freebsd-acpi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80258106566B for ; Fri, 5 Sep 2008 17:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6E5E18FC1C for ; Fri, 5 Sep 2008 17:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m85HU5ef000158 for ; Fri, 5 Sep 2008 17:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m85HU5q6000155; Fri, 5 Sep 2008 17:30:05 GMT (envelope-from gnats) Date: Fri, 5 Sep 2008 17:30:05 GMT Message-Id: <200809051730.m85HU5q6000155@freefall.freebsd.org> To: freebsd-acpi@FreeBSD.org From: Nate Lawson Cc: 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 Reply-To: Nate Lawson List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 17:30:05 -0000 The following reply was made to PR kern/124223; it has been noted by GNATS. From: Nate Lawson To: Pietro Cerutti Cc: bug-followup@FreeBSD.org, freebsd-acpi@FreeBSD.org Subject: Re: kern/124223: [acpi] [patch] acpi_battery.c -- Notify user-defined critical level via devd(8) Date: Fri, 05 Sep 2008 10:10:40 -0700 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"); > } > } 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? Don't common battery status tools that poll (say, xbatt) have their own way to set a critical level? -Nate Pietro Cerutti wrote: > POKE! > > Anybody interested in reviewing it? -- Nate