* Warn user when battery goes critical
@ 2004-04-05 21:10 Pavel Machek
[not found] ` <20040405211032.GA3575-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2004-04-05 21:10 UTC (permalink / raw)
To: len.brown-ral2JQCrhuEAvxtiuMwx3w, ACPI mailing list
Hi!
When battery is going critical, perhaps user should know? It already
helped me when power was turned off at expansion cord...
Pavel
Index: linux/drivers/acpi/battery.c
===================================================================
--- linux.orig/drivers/acpi/battery.c 2004-04-05 22:47:33.000000000 +0200
+++ linux/drivers/acpi/battery.c 2004-02-20 12:39:11.000000000 +0100
@@ -332,6 +332,13 @@
battery->flags.present = device->status.battery_present;
+ {
+ struct acpi_battery_status *bst = NULL;
+ int res = acpi_battery_get_status(battery, &bst);
+
+ if (!res && (bst->state & 0x04))
+ printk(KERN_CRIT "Battery status: critical\n");
+ }
return_VALUE(result);
}
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <20040405211032.GA3575-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>]
* Re: Warn user when battery goes critical [not found] ` <20040405211032.GA3575-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org> @ 2004-04-06 1:21 ` Karl Hegbloom 2004-04-08 17:15 ` Stefan Seyfried 1 sibling, 0 replies; 5+ messages in thread From: Karl Hegbloom @ 2004-04-06 1:21 UTC (permalink / raw) To: ACPI mailing list On Mon, 2004-04-05 at 14:10, Pavel Machek wrote: > When battery is going critical, perhaps user should know? It already > helped me when power was turned off at expansion cord... > > + int res = acpi_battery_get_status(battery, &bst); If this patch goes in, PLEASE, create a way to turn that feature OFF or to control the interval at which it is run, since on some laptops (this one) the battery status BIOS call takes too long, interrupts are disabled then, and touch-pad and keyboard interrupts are lost, causing pointer warps, bouncy or "stickyyyyyyyyyyyy" keys, and keyboard lockouts. It is also probably the cause of a system hang during heavy network I/O. -- If you feel like the machines are conspiring against you, then it's time to perspire against the machines. ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Warn user when battery goes critical [not found] ` <20040405211032.GA3575-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org> 2004-04-06 1:21 ` Karl Hegbloom @ 2004-04-08 17:15 ` Stefan Seyfried [not found] ` <20040408171527.GH23710-l0tNAEGuAhhzZ8+rp42Dbp9+tswZ0GTaehPwdyo5hKaELgA04lAiVw@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: Stefan Seyfried @ 2004-04-08 17:15 UTC (permalink / raw) To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f On Mon, Apr 05, 2004 at 11:10:32PM +0200, Pavel Machek wrote: > Hi! > > When battery is going critical, perhaps user should know? It already > helped me when power was turned off at expansion cord... > + if (!res && (bst->state & 0x04)) > + printk(KERN_CRIT "Battery status: critical\n"); This should go into userspace IMO. There are some applications that will handle this, so no need for code bloat in the kernel. Hey! I'd never thought i could one day accuse Pavel of "eyecandy bloat" ;-) Happy Easter, Stefan -- Stefan Seyfried ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20040408171527.GH23710-l0tNAEGuAhhzZ8+rp42Dbp9+tswZ0GTaehPwdyo5hKaELgA04lAiVw@public.gmane.org>]
* Re: Re: Warn user when battery goes critical [not found] ` <20040408171527.GH23710-l0tNAEGuAhhzZ8+rp42Dbp9+tswZ0GTaehPwdyo5hKaELgA04lAiVw@public.gmane.org> @ 2004-04-12 20:45 ` Sérgio Monteiro Basto [not found] ` <1081802715.3428.40.camel-4/PLUo9XfK8@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Sérgio Monteiro Basto @ 2004-04-12 20:45 UTC (permalink / raw) To: Stefan Seyfried, hegbloom-tbDHPZwbsQQ; +Cc: acpi-devel Hi, I am think in reply to this question a long time, well because I not a man of the code, it is goes my reflection, I turn acpi debug on because I want to know in /var/log em battery got one "bat low 2" but is very annoying applet monitor every time that ask battery stat appears : [ACPI Debug] String: Length 0x24, "---------------------------- AC _PSR" [ACPI Debug] String: Length 0x27, "---------------------------- AC on line" [ACPI Debug] String: Length 0x30, "--------- VIA SOFTWARE SMI PMIO 2Fh ------ this messages are written in DSDT, so is just select the more imports and the DEBUG messages from DSDT. Bye On Thu, 2004-04-08 at 18:15, Stefan Seyfried wrote: > On Mon, Apr 05, 2004 at 11:10:32PM +0200, Pavel Machek wrote: > > Hi! > > > > When battery is going critical, perhaps user should know? It already > > helped me when power was turned off at expansion cord... > > > + if (!res && (bst->state & 0x04)) > > + printk(KERN_CRIT "Battery status: critical\n"); > > This should go into userspace IMO. There are some applications that will > handle this, so no need for code bloat in the kernel. > > Hey! I'd never thought i could one day accuse Pavel of "eyecandy bloat" ;-) > > > Happy Easter, > > Stefan -- Sérgio M. B. ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1081802715.3428.40.camel-4/PLUo9XfK8@public.gmane.org>]
* Re: Re: Warn user when battery goes critical [not found] ` <1081802715.3428.40.camel-4/PLUo9XfK8@public.gmane.org> @ 2004-04-13 20:02 ` Pavel Machek 0 siblings, 0 replies; 5+ messages in thread From: Pavel Machek @ 2004-04-13 20:02 UTC (permalink / raw) To: S Monteiro Basto; +Cc: Stefan Seyfried, hegbloom-tbDHPZwbsQQ, acpi-devel Hi! > > > When battery is going critical, perhaps user should know? It already > > > helped me when power was turned off at expansion cord... > > > > > + if (!res && (bst->state & 0x04)) > > > + printk(KERN_CRIT "Battery status: critical\n"); > > > > This should go into userspace IMO. There are some applications that will > > handle this, so no need for code bloat in the kernel. > > > > Hey! I'd never thought i could one day accuse Pavel of "eyecandy bloat" ;-) > > :-). Yes battery monitors exist and yes, I should watch /proc/acpi/battery.../state; otoh it is clearly an critical condition, and I should not be forced to run cpu-eating battery monitor daemon when kernel knows without polling. Pavel -- 64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-04-13 20:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 21:10 Warn user when battery goes critical Pavel Machek
[not found] ` <20040405211032.GA3575-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-04-06 1:21 ` Karl Hegbloom
2004-04-08 17:15 ` Stefan Seyfried
[not found] ` <20040408171527.GH23710-l0tNAEGuAhhzZ8+rp42Dbp9+tswZ0GTaehPwdyo5hKaELgA04lAiVw@public.gmane.org>
2004-04-12 20:45 ` Sérgio Monteiro Basto
[not found] ` <1081802715.3428.40.camel-4/PLUo9XfK8@public.gmane.org>
2004-04-13 20:02 ` Pavel Machek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox