From owner-freebsd-acpi@FreeBSD.ORG Sun Nov 26 03:32:15 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E096716A40F for ; Sun, 26 Nov 2006 03:32:15 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE57643D60 for ; Sun, 26 Nov 2006 03:31:22 +0000 (GMT) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.4) with SMTP id OAA02120; Sun, 26 Nov 2006 14:31:59 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Sun, 26 Nov 2006 14:31:59 +1100 (EST) From: Ian Smith To: "M. Warner Losh" In-Reply-To: <20061125.160917.1628359610.imp@bsdimp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-acpi@freebsd.org Subject: Re: How do I... 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: Sun, 26 Nov 2006 03:32:16 -0000 On Sat, 25 Nov 2006, M. Warner Losh wrote: > In message: <4568AA2F.4050602@root.org> > Nate Lawson writes: > : M. Warner Losh wrote: > : > ... run a command when there's < 1% battery life left? > : > > : > Warner > : > : You add support here in acpi_cmbat.c: > : /* XXX If all batteries are critical, perhaps we should suspend. */ > : 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"); > : } > : } > : > : Use the acpi_NotifyMumble function to send a value to devd. You > : probably want to make sure you're off AC power also since you may still > : have that crit state when plugged in. So read the value of AC status > : (see kern_power.c for how to do this) before sending the notify. > > I was thinking of sending the critical message as well as for each % > of battery life that changed. I just wanted to make sure that it > wasn't being done already and i was captain clueless. > > Warner I suspect what you're after is basically the functionality previously provided by apmd for APM battery % {dis,}charging (and other) power related events, where you could define in apmd.conf, eg from mine: apm_battery 20% discharging { exec "logger -p user.notice battery status low [20%]"; exec "echo T250L8CE-GE-C >>/dev/speaker"; } Me too .. and here's where Nate says 'well write it then!' :) Cheers, Ian From owner-freebsd-acpi@FreeBSD.ORG Mon Nov 27 00:33:19 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D59E916A40F for ; Mon, 27 Nov 2006 00:33:19 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E93B43D49 for ; Mon, 27 Nov 2006 00:32:21 +0000 (GMT) (envelope-from nate@root.org) Received: (qmail 77511 invoked from network); 27 Nov 2006 00:27:38 -0000 Received: from ppp-71-139-31-204.dsl.snfc21.pacbell.net (HELO ?10.0.5.59?) (nate-mail@71.139.31.204) by root.org with ESMTPA; 27 Nov 2006 00:27:38 -0000 Message-ID: <456A30F0.3030004@root.org> Date: Sun, 26 Nov 2006 16:27:28 -0800 From: Nate Lawson User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: "M. Warner Losh" References: <20061124.201214.1656128345.imp@bsdimp.com> <4568AA2F.4050602@root.org> <20061125.160917.1628359610.imp@bsdimp.com> In-Reply-To: <20061125.160917.1628359610.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: How do I... 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, 27 Nov 2006 00:33:19 -0000 M. Warner Losh wrote: > In message: <4568AA2F.4050602@root.org> > Nate Lawson writes: > : M. Warner Losh wrote: > : > ... run a command when there's < 1% battery life left? > : > > : > Warner > : > : You add support here in acpi_cmbat.c: > : /* XXX If all batteries are critical, perhaps we should suspend. */ > : 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"); > : } > : } > : > : Use the acpi_NotifyMumble function to send a value to devd. You > : probably want to make sure you're off AC power also since you may still > : have that crit state when plugged in. So read the value of AC status > : (see kern_power.c for how to do this) before sending the notify. > > I was thinking of sending the critical message as well as for each % > of battery life that changed. I just wanted to make sure that it > wasn't being done already and i was captain clueless. > > Warner You'd have to add that to the code that pulls the new battery value. It would compare it to the last % and send a notify if they're different. You could get rid of that printf then and just add a default devd rule for that. Note though that it the critical flag is determined by the BIOS. It could be 5% on one system, 10% on the next. You could add a user-configurable sysctl "critical" flag that was compared to the % and if <=, sets the ACPI_BATT_STAT_CRITICAL flag even though the BIOS didn't. The devd notify code would be the same in either case. The flag as set by the BIOS is level-triggered so it stays set until the battery is charged above the critical level (i.e. even on AC). You don't want to trigger devd notifies on the way back up to normal, although sending a different notify once it is !critical might be useful. Please send me a patch for review if you implement this. Thanks, -- Nate From owner-freebsd-acpi@FreeBSD.ORG Mon Nov 27 11:08:59 2006 Return-Path: X-Original-To: freebsd-acpi@FreeBSD.org Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79C8016A412 for ; Mon, 27 Nov 2006 11:08:59 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1AF643D78 for ; Mon, 27 Nov 2006 11:07:13 +0000 (GMT) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kARB8CKA091863 for ; Mon, 27 Nov 2006 11:08:12 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kARB8AhL091859 for freebsd-acpi@FreeBSD.org; Mon, 27 Nov 2006 11:08:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 27 Nov 2006 11:08:10 GMT Message-Id: <200611271108.kARB8AhL091859@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-acpi@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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, 27 Nov 2006 11:08:59 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o i386/54756 acpi ACPI suspend/resume problem on CF-W2 laptop o i386/55661 acpi ACPI suspend/resume problem on ARMADA M700 o kern/55822 acpi No ACPI power off with SMP kernel o kern/56024 acpi ACPI suspend drains battery while in S3 o i386/64002 acpi acpi problem o i386/67273 acpi [hang] system hangs with acpi and Xfree o i386/72566 acpi ACPI, FreeBSD disables fan on Compaq Armada 1750 o i386/79080 acpi acpi thermal changes freezes HP nx6110 o i386/79081 acpi ACPI suspend/resume not working on HP nx6110 o kern/104625 acpi ACPI on ASUS A8N-32 SLI/ASUS P4P800 does not show ther 10 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/67309 acpi zzz reboot computer (ACPI S3) o i386/69750 acpi Boot without ACPI failed on ASUS L5 o kern/73823 acpi [feature request] acpi / power-on by timer support f kern/74030 acpi Unplugging AC causes battery % to stay locked at 98% f kern/90871 acpi ACPI problems with ASUS A8N-VM-CSM o kern/97383 acpi Volume buttons on IBM Thinkpad crash system with ACPI o kern/98171 acpi [acpi] ACPI 1304 / 0501 errors on Acer 5024WLMi Laptop o kern/103365 acpi [acpi] acpi poweroff doesn't work with geli device att 8 problems total. From owner-freebsd-acpi@FreeBSD.ORG Tue Nov 28 14:18:54 2006 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 802CD16A415 for ; Tue, 28 Nov 2006 14:18:54 +0000 (UTC) (envelope-from tarkhil@webmail.sub.ru) Received: from mail.sub.ru (webmail.sub.ru [213.247.139.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0743843CC8 for ; Tue, 28 Nov 2006 14:18:45 +0000 (GMT) (envelope-from tarkhil@webmail.sub.ru) Received: (qmail 22966 invoked by uid 0); 28 Nov 2006 14:18:46 -0000 Received: from webmail.sub.ru (HELO localhost) (213.247.139.22) by techno.sub.ru with SMTP; 28 Nov 2006 14:18:46 -0000 Received: from unknown ([213.247.139.22]) by localhost (webmail.sub.ru [213.247.139.22]) (amavisd-new, port 10024) with SMTP id 22656-01; Tue, 28 Nov 2006 17:18:40 +0300 (MSK) Received: from unknown (HELO ?192.168.0.239?) (tarkhil%sub.ru@213.152.142.74) by techno.sub.ru with SMTP; 28 Nov 2006 14:18:39 -0000 Message-ID: <456C4503.9060805@webmail.sub.ru> Date: Tue, 28 Nov 2006 17:17:39 +0300 From: Alex Povolotsky User-Agent: Thunderbird 1.5 (X11/20060310) MIME-Version: 1.0 To: John Baldwin References: <200610101020.32041.jhb@freebsd.org> In-Reply-To: <200610101020.32041.jhb@freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mail.sub.ru Cc: acpi@freebsd.org, mobile@freebsd.org Subject: Re: [PATCH] UP APIC suspend/resume support -- Please test 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: Tue, 28 Nov 2006 14:18:54 -0000 John Baldwin wrote: > No one has tested this yet, so I guess folks missed it. Can someone with > otherwise working suspend/resume on a system with APIC please test > http://www.freebsd.org/~jhb/patches/apic_resume.patch and let me know if > suspend/resume works? Note that it doesn't add SMP support, so you'll > still need to disable SMP (either via kern.smp.disabled or by removing > SMP from the kernel config) to test. Thanks. > > slightly incorrect filenames in patch, I guess... Alex.