Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 2015 10:56:33 -0500
From:      Jonathon Reinhart <jonathon.reinhart@gmail.com>
To:        Scott Long <scott4long@yahoo.com>, sthaug@nethelp.no,  Sean Bruno <sbruno@freebsd.org>, freebsd-scsi@freebsd.org, freebsd-drivers@freebsd.org
Subject:   Re: ciss(4) HP Smart Array P840
Message-ID:  <CAPFHKzfjizzOAYaJgPmOUGJSJY0ZOr7eEJPyzUhAU3A60z3obQ@mail.gmail.com>
In-Reply-To: <CAPFHKzfS=MOBFEJc7WEse56Bz3F=-KmJ%2Bx-pHM_WkyUBtgJ5pw@mail.gmail.com>
References:  <CAPFHKzf65eSsg0aNe5wjS1jUVeh7gd9xgvAvMVuc6Shunsc9GA@mail.gmail.com> <20151120.084410.74714437.sthaug@nethelp.no> <CAPFHKzdJ3F3ay0FQf0cwMWadSercKdg_tWap-poUeTpMe1Gn-Q@mail.gmail.com> <30640027-5C49-4AC0-9BAF-7E6208F7DD13@yahoo.com> <CAPFHKzdUdjxf1g%2BhvAqQnXCiibwmZvGSTVKaWoY_exd8TZ8tuA@mail.gmail.com> <A69F13A0-4C3A-4E23-B01B-941D3C57CB47@yahoo.com> <CAPFHKzfS=MOBFEJc7WEse56Bz3F=-KmJ%2Bx-pHM_WkyUBtgJ5pw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sbruno@FreeBSD.org>
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 <scott.benesh@hp.com>
    Sponsored by:   Yahoo! Inc.

commit 34cc27f945a62076a0d8826f61b1a0f90b20ae4f    (d85167d0 on freebsd/freebsd)
Author: sbruno <sbruno@FreeBSD.org>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPFHKzfjizzOAYaJgPmOUGJSJY0ZOr7eEJPyzUhAU3A60z3obQ>