kern/117591: [acpi][panic] Divide by zero bug in ACPI
John Baldwin
jhb at freebsd.org
Mon Nov 19 15:19:42 PST 2007
On Monday 19 November 2007 05:40:03 pm Jessica Mahoney wrote:
> The following reply was made to PR kern/117591; it has been noted by GNATS.
>
> From: Jessica Mahoney <root at varusonline.com>
> To: John Baldwin <jhb at freebsd.org>, bug-followup at FreeBSD.org
> Cc:
> Subject: Re: kern/117591: [acpi][panic] Divide by zero bug in ACPI
> Date: Mon, 19 Nov 2007 17:06:40 -0500
>
> John Baldwin wrote:
> > Can you get a stack trace?
> >
> >
> Tracing pid 878 tid 100080 td 0xc3f26440
> acpi_battery_get_battinfo(c3a27980,c3ee4d00,e51e1c60,c3ee4d00,0,...) at
> acpi_battery_get_battinfo+0x26f
> acpi_battery_ioctl(c0a44203,c3ee4d00,0,c40ec880,e51e1c08,...) at
> acpi_battery_ioctl+0x14b
> acpiioctl(c3a9e900,c0a44203,c3ee4d00,3,c3f26440,...) at acpiioctl_0xdd
> devfs_ioctl_f(c3e35d80,c0a44203,c3ee4d00,c3ee5800,c3f26440,...) at
> devfs_ioctl_f+0xcb
> kern_ioctl(c3f26440,3,c0a44203,c3ee4d00,1000a24,..._ at kern_ioctl+0x355
> ioctl(c3f26440,e51e1cfc,c,c3f26440,e51e1d2c,...) at ioctl+0x134
> syscall(e51e1d38) at syscall+0x345
> Xint0x80_syscall() at Xint0x80_syscall+0x20
> --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x2815289b, esp =
> 0xbfbfec3c, ebp = 0xbfbfed28 ---
>
> If there's anything else needed, please let me know and I shall provide.
You can try this:
Index: acpi_battery.c
===================================================================
RCS file: /usr/cvs/src/sys/dev/acpica/acpi_battery.c,v
retrieving revision 1.25
diff -u -r1.25 acpi_battery.c
--- acpi_battery.c 9 Oct 2007 07:51:46 -0000 1.25
+++ acpi_battery.c 19 Nov 2007 23:17:48 -0000
@@ -198,8 +198,10 @@
*/
if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0) {
bst[i].rate = (bst[i].rate * bif->dvol) / 1000;
+#if 0
bst[i].cap = (bst[i].cap * bif->dvol) / 1000;
bif->lfcap = (bif->lfcap * bif->dvol) / 1000;
+#endif
}
/* Calculate percent capacity remaining. */
I think the mA => mW scaling is resulting in lfcap becoming 0, but since
all we want is a ratio for 'cap' so we can generate a percentage, we don't
actually need to scale this.
--
John Baldwin
More information about the freebsd-acpi
mailing list