From owner-freebsd-current@FreeBSD.ORG Tue Sep 20 17:04:32 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70F1106566C for ; Tue, 20 Sep 2011 17:04:32 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7418FC14 for ; Tue, 20 Sep 2011 17:04:32 +0000 (UTC) Received: by qwb8 with SMTP id 8so1941223qwb.3 for ; Tue, 20 Sep 2011 10:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6zp4+YFQDUnpHdtyUdEDaEhCNNrK1ekwqCt457hlPAU=; b=tM8bxzy+9et203ooEITc7XaFPOU8cvwkhQOPHbOOkD8j7HQvb+UrGpcSQNN1ST2wXz lYXJDXApq5qUx/yvjHWiLQNwzmyvWLYYsDnM+xjJIZovJsHzfuGnqDwLIej58mAbAWmH 9PHQed9AcZkMMlIL7gLzFkZXiEa/+nl3al3bE= MIME-Version: 1.0 Received: by 10.224.17.135 with SMTP id s7mr740545qaa.274.1316538271459; Tue, 20 Sep 2011 10:04:31 -0700 (PDT) Received: by 10.224.74.82 with HTTP; Tue, 20 Sep 2011 10:04:31 -0700 (PDT) In-Reply-To: <20110920143841.GA67532@sandvine.com> References: <20110920143841.GA67532@sandvine.com> Date: Tue, 20 Sep 2011 10:04:31 -0700 Message-ID: From: Garrett Cooper To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Request for testing - mfiutil(8) patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 17:04:32 -0000 On Tue, Sep 20, 2011 at 7:38 AM, Ed Maste wrote: > Mfiutil(8) is a commandline management tool for RAID controllers > supported by the mfi(4) driver. =A0I have a couple of changes to the way > battery back up unit (BBU) state is reported and I would like to request > testing from any mfi(4) users who are able to try my patch. > > If you're able to test it for me please grab the modified source tarball > from http://people.freebsd.org/~emaste/mfiutil.tar and build the patched > mfiutil. =A0Then send me the output of "mfiutil show battery" for both th= e > stock and patched mfiutil, as well as the controller model number and > the type of back up unit (none, battery, or supercap). > > (If you're running CURRENT already and want just the patch, it is at > http://people.freebsd.org/~emaste/patches/mfi_show.c.diff .) 1. It properly detects "no battery" when I tried to use a "new" battery with an incompatible daughter board (the firmware in the MegaRAID BIOS reported it was missing): # ./mfiutil show battery mfi0: No battery present 2. With the busted battery: # mfiutil show battery status =3D 0x0000 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: 404 mAh Charge Cycles: 59 Current Charge: 97% Design Voltage: 3700 mV Current Voltage: 4048 mV Temperature: 30 C Status: Firmware status: 0c00 normal Please note that this is what the controller firmware says about the batter= y: mfi0: 36830 (boot + 4s/0x0008/info) - Battery Present mfi0: 36831 (boot + 4s/0x0008/FATAL) - Battery has failed and cannot support data retention. Please replace the battery ... mfi0: 36842 (boot + 27s/0x0008/WARN) - BBU disabled; changing WB virtual disks to WT 3. With the new battery, properly installed, BBU learn in progress: # mfiutil show adapter mfi0 Adapter: Product Name: MegaRAID SAS 8704ELP Serial Number: P391734409 Firmware: 11.0.1-0042 RAID Levels: JBOD, RAID0, RAID1, RAID5, RAID6, RAID10, RAID50 Battery Backup: not present NVRAM: 32K Onboard Memory: 128M Minimum Stripe: 8k Maximum Stripe: 1M I'll provide the last output once it's done relearning. My test patch can be found here as a reference (please note that the #if 0 stuff was stuff I was testing from the Linux megaraid driver that doesn't appear to work), including your change: http://pastebin.com/ZMac0T53 Some of the states like MFI_BBU_STATE_DISCHARGE_ACTIVE don't make sense in mfiutil because they overlap with other BBU states, and thus can't be distinguished from one another. Thanks! -Garrett PS This resolves the PR I filed at least (bin/160581).