From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 11 01:00:29 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B16810656D3 for ; Sun, 11 Sep 2011 01:00:29 +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 1A1618FC17 for ; Sun, 11 Sep 2011 01:00:29 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8B10SXH043730 for ; Sun, 11 Sep 2011 01:00:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8B10Stx043729; Sun, 11 Sep 2011 01:00:28 GMT (envelope-from gnats) Date: Sun, 11 Sep 2011 01:00:28 GMT Message-Id: <201109110100.p8B10Stx043729@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Cooper Cc: Subject: Re: bin/160581: mfiutil(8) doesn' t properly detect dead battery with mfiutil show battery X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Cooper List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2011 01:00:29 -0000 The following reply was made to PR bin/160581; it has been noted by GNATS. From: Garrett Cooper To: Mark Cc: bug-followup@FreeBSD.org Subject: Re: bin/160581: mfiutil(8) doesn't properly detect dead battery with mfiutil show battery Date: Sat, 10 Sep 2011 17:34:19 -0700 (PDT) On Sat, 10 Sep 2011, Mark wrote: > Hi Garrett, > > It looks like mfi(4) is missing a mask or several for the fw_status > field when it tries to grab info about the battery backup. Maybe the > attached patch can help a bit in figuring out what mfiutil is > ignoring. I don't know if there's a publicly available datasheet for > the firmware; I couldn't find it last time I tried. Maybe jhb@ has > access to one. There's nothing useful in LSI's FreeBSD or Linux > drivers - probably the opcodes and masks are just hardcoded into > MegaCLI. > > If there's no way to figure out the masks from a datasheet, it'll > probably be necessary to disassemble MegaCLI or something. I can try > and figure it out, but I don't have access to a machine with an LSI > controller right now, so it'd be tricky. =( Hi Mark, That's exactly what I tried before, but didn't include in my PR email. Here's what I got: $ sudo mfiutil show battery mfi0: Battery State: Manufacture Date: 9/19/2009 Serial Number: 1022 Manufacturer: LS1111001B Model: 3598301 Chemistry: LION Design Capacity: 1215 mAh Full Charge Capacity: 417 mAh Current Capacity: 415 mAh Charge Cycles: 58 Current Charge: 100% Design Voltage: 3700 mV Current Voltage: 4049 mV Temperature: 43 C Status:Firmware status: 3072 <-- HERE normal LSI's copy of the driver is unfortunately unhelpful here, and I tried ktrace'ing/truss'ing the driver to no avail. I guess the next step is to hack the driver and dump the ioctl output sent via MegaCLI (shouldn't be too hard). Thanks! -Garrett