From owner-freebsd-scsi@freebsd.org Tue Nov 24 15:57:03 2015 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77ACCA36888; Tue, 24 Nov 2015 15:57:03 +0000 (UTC) (envelope-from jonathon.reinhart@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EEF31553; Tue, 24 Nov 2015 15:57:03 +0000 (UTC) (envelope-from jonathon.reinhart@gmail.com) Received: by ioir85 with SMTP id r85so24489490ioi.1; Tue, 24 Nov 2015 07:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=xei7LUa87zTMBwclifOkV6ud8NqI8amuNIBfwTw9MYE=; b=klXUUxlnxHxAID5qGQTkpzUmCG1kt+WKB4fbGdBfSYEuwMJemNEnT6hbUPuz2s+WIR zEYyrzHcb1ziCfKGPgqbEItyGowvebn8fTsV7Oqv/hscncpYj/vsVv+VcrS0kD3xO/0b ViA6uopTUejKkSkPa0CYiV9H7mTxS06HCKmuIYSFFjtlYq7vw2RtG8Hno3jl8Tq31ZQx z9BuMezCrzrj4DXf2z9TS+en7hH9GqkpOEAoxLlIqIl88AHypbd+N8GwOQYTGiBOh27H NRW8vWG+9qPVAkF1Aakx/8a1Tom9uNc8rg++GUiMEC0n4nHNpwN9yXR1spWO1W7C8uT3 6S6Q== X-Received: by 10.107.136.217 with SMTP id s86mr29697459ioi.142.1448380622662; Tue, 24 Nov 2015 07:57:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.10.67 with HTTP; Tue, 24 Nov 2015 07:56:33 -0800 (PST) In-Reply-To: References: <20151120.084410.74714437.sthaug@nethelp.no> <30640027-5C49-4AC0-9BAF-7E6208F7DD13@yahoo.com> From: Jonathon Reinhart Date: Tue, 24 Nov 2015 10:56:33 -0500 Message-ID: Subject: Re: ciss(4) HP Smart Array P840 To: Scott Long , sthaug@nethelp.no, Sean Bruno , freebsd-scsi@freebsd.org, freebsd-drivers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2015 15:57:03 -0000 After reviewing the differences between 9.3.1-STABLE and the latest FreeBSD, I've decided to try and merge the latest back into 9.3.1 so that I can use the current version of FreeNAS with my P840 controller. Please forgive my ignorance in the FreeBSD release / development process, as I'm not really sure how to figure out where FreeBSD releases are made relative to the source code. I'm looking on http://github.com/freebsd/freebsd, but there are no tags or releases. I realize this is probably because FreeBSD uses SVN, but the TrueOS on which FreeNAS is based uses Git. FreeNAS (http://github.com/freenas/freenas.git) branch 9.3.1-STABLE pulls in the FreeBSD source from TrueOS (http://github.com/trueos/trueos), at branch 9.3.1-STABLE. ------------------------------------------------------------------------------------------------------------------------------------------------------ Latest TrueOS change: $ git status On branch 9.3.1-STABLE $ git log -n2 sys/dev/ciss commit e2839cc1b8453737875676ba9e8d2f0b42aaa460 Author: sbruno Date: Mon Apr 21 16:55:02 2014 +0000 MFC r264127 Add PCI-IDs for TBD Gen9 RAID controller HBAs from HP to ciss(4) Submitted by: Benesh, Scott Sponsored by: Yahoo! Inc. commit 34cc27f945a62076a0d8826f61b1a0f90b20ae4f (d85167d0 on freebsd/freebsd) Author: sbruno Date: Tue Apr 15 17:52:22 2014 +0000 MFC r264354 but change the lock arg and implementation to fit the current state of CAM in stable/9 Fix insta-panic on assert of unlocked periph mtx in ciss(4) when logical volume state changes. I'm still setting the mergeinfo as done here as the intent of the MFC, if not the EXACT code is being implemented. Reviewed by: mav@ Sponsored by: Yahoo! Inc ------------------------------------------------------------------------------------------------------------------------------------------------------ These are the changes to freebsd/master that are *not* in TrueOS 9.3.1-STABLE $ git log --oneline d85167d~1..HEAD sys/dev/ciss 590adc1 r249170 was just plain wrong. The effect of the change is to always delete a logic volume on status change which is NOT what we want here. bc3e70b Remove redundant mtx_lock/unlock in ciss_name_device. This is a guaranteed insta-panic on device add/remove. This is only called from the notify thread which already holds the lock while calling this function. 346273b Remove MAXBSIZE use from drivers where it has nothing to do. c8a5ac8 Remove compat shims for FreeBSD versions older than 6 (really early 5). The only diffs in the disassembly were different line numbers passed to lock functions. dd63bf9 Prevent overflow issues in timeout processing fcae8e0 Add detection for ciss(4) controllers that are set to non-raid JBOD mode. If a controller is set to JBOD, it has no RAID functions turned on. af69ed3 Check return of cam_periph_find() before using it in a printf. d85167d Fix insta-panic on assert of unlocked periph mtx in ciss(4) when logical volume state changes ------------------------------------------------------------------------------------------------------------------------------------------------------ fcae8e0 Appears to be the winner here, adding JBOD / HBA mode support. I've done my best to apply those patches to TrueOS 9.3.1-STABLE, and I'm building it now. After those commits, the only difference between FreeBSD "master" and my branch is: diff -u freebsd/sys/dev/ciss/ciss.c trueos/sys/dev/ciss/ciss.c --- freebsd/sys/dev/ciss/ciss.c 2015-11-23 17:53:43.119544620 -0500 +++ trueos/sys/dev/ciss/ciss.c 2015-11-24 10:51:50.609160463 -0500 @@ -4388,17 +4388,11 @@ DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; - devclass_t dc; - int maxciss, i; - dc = devclass_find("ciss"); - if ( dc == NULL ) { - printf("%s: can't find devclass!\n", __func__); - return; - } - maxciss = devclass_get_maxunit(dc); - for (i = 0; i < maxciss; i++) { - sc = devclass_get_softc(dc, i); + sc = devclass_get_softc(devclass_find("ciss"), 0); + if (sc == NULL) { + printf("no ciss controllers\n"); + } else { ciss_print_adapter(sc); } If anyone, namely Sean, be willing to take a look at my diff, I would greatly appreciate it: https://github.com/trueos/trueos/compare/9.3.1-STABLE...JonathonReinhart:update-ciss-to-latest You'll see there is one commit that I made, and that is the one I'm unsure of. Thank you for your time, Jonathon Reinhart