From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 19 01:19:04 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED5110656D0; Mon, 19 Mar 2012 01:19:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C94AB8FC22; Mon, 19 Mar 2012 01:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1J4cr044221; Mon, 19 Mar 2012 01:19:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1J4U5044219; Mon, 19 Mar 2012 01:19:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190119.q2J1J4U5044219@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233145 - stable/7/sys/modules/dtrace/dtrace X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:19:05 -0000 Author: eadler Date: Mon Mar 19 01:19:04 2012 New Revision: 233145 URL: http://svn.freebsd.org/changeset/base/233145 Log: MFC r232506: Explicitly list dependency PR: misc/160463 Approved by: cperciva Modified: stable/7/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/7/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:18:46 2012 (r233144) +++ stable/7/sys/modules/dtrace/dtrace/Makefile Mon Mar 19 01:19:04 2012 (r233145) @@ -41,4 +41,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup +dtrace_asm.o: assym.s + .include From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 19 01:28:11 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F55106564A; Mon, 19 Mar 2012 01:28:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFC988FC12; Mon, 19 Mar 2012 01:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1SBPR044608; Mon, 19 Mar 2012 01:28:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1SBuC044605; Mon, 19 Mar 2012 01:28:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190128.q2J1SBuC044605@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233148 - stable/7/lib/libc/string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:28:12 -0000 Author: eadler Date: Mon Mar 19 01:28:11 2012 New Revision: 233148 URL: http://svn.freebsd.org/changeset/base/233148 Log: MFC r232503: POSIX mandates that swab do nothing when len < 0 PR: 140690 Approved by: cperciva Modified: stable/7/lib/libc/string/swab.3 stable/7/lib/libc/string/swab.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/string/swab.3 ============================================================================== --- stable/7/lib/libc/string/swab.3 Mon Mar 19 01:27:55 2012 (r233147) +++ stable/7/lib/libc/string/swab.3 Mon Mar 19 01:28:11 2012 (r233148) @@ -28,7 +28,7 @@ .\" @(#)swab.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 10, 2004 +.Dd March 4, 2012 .Dt SWAB 3 .Os .Sh NAME @@ -54,6 +54,9 @@ swapping adjacent bytes. The argument .Fa len must be an even number. +If +.Fa len +is less than zero, nothing will be done. .Sh SEE ALSO .Xr bzero 3 , .Xr memset 3 Modified: stable/7/lib/libc/string/swab.c ============================================================================== --- stable/7/lib/libc/string/swab.c Mon Mar 19 01:27:55 2012 (r233147) +++ stable/7/lib/libc/string/swab.c Mon Mar 19 01:28:11 2012 (r233148) @@ -45,6 +45,8 @@ swab(const void * __restrict from, void int n; char *fp, *tp; + if (len <= 0) + return; n = len >> 1; fp = (char *)from; tp = (char *)to; From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 19 01:33:24 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8953106566B; Mon, 19 Mar 2012 01:33:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B56F8FC15; Mon, 19 Mar 2012 01:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1XO0C044882; Mon, 19 Mar 2012 01:33:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1XOrQ044880; Mon, 19 Mar 2012 01:33:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190133.q2J1XOrQ044880@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233151 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:33:24 -0000 Author: eadler Date: Mon Mar 19 01:33:24 2012 New Revision: 233151 URL: http://svn.freebsd.org/changeset/base/233151 Log: MFC r232504: Remove reference to gcc's non-standard -fwritable-strings, which doesn't exist in recent releases (and is bad advice anyway) PR: docs/163119 Approved by: cperciva Modified: stable/7/lib/libc/stdio/mktemp.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:32:53 2012 (r233150) +++ stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:33:24 2012 (r233151) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 11, 1998 +.Dd March 4, 2012 .Dt MKTEMP 3 .Os .Sh NAME @@ -180,12 +180,6 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. -If the program in question makes heavy use of that type -of function call, you do have the option of compiling the program -so that it will store string constants in a writable segment of memory. -See -.Xr gcc 1 -for more information. .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 19 01:52:10 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CEB6106564A; Mon, 19 Mar 2012 01:52:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B618FC1B; Mon, 19 Mar 2012 01:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1qAOq045532; Mon, 19 Mar 2012 01:52:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1qAKX045530; Mon, 19 Mar 2012 01:52:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190152.q2J1qAKX045530@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233154 - stable/7/lib/libutil X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:52:10 -0000 Author: eadler Date: Mon Mar 19 01:52:09 2012 New Revision: 233154 URL: http://svn.freebsd.org/changeset/base/233154 Log: MFC r231306: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Approved by: cperciva Modified: stable/7/lib/libutil/login_class.c Directory Properties: stable/7/lib/libutil/ (props changed) Modified: stable/7/lib/libutil/login_class.c ============================================================================== --- stable/7/lib/libutil/login_class.c Mon Mar 19 01:51:53 2012 (r233153) +++ stable/7/lib/libutil/login_class.c Mon Mar 19 01:52:09 2012 (r233154) @@ -448,18 +448,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 19 01:57:15 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 261B7106566B; Mon, 19 Mar 2012 01:57:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F23B8FC1D; Mon, 19 Mar 2012 01:57:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2J1vE4O045802; Mon, 19 Mar 2012 01:57:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2J1vEwr045799; Mon, 19 Mar 2012 01:57:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203190157.q2J1vEwr045799@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Mar 2012 01:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233157 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 01:57:15 -0000 Author: eadler Date: Mon Mar 19 01:57:14 2012 New Revision: 233157 URL: http://svn.freebsd.org/changeset/base/233157 Log: MFC r232505: Remove outdated comment of seven years PR: docs/116116 Approved by: cperciva Modified: stable/7/lib/libc/stdio/mktemp.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/stdio/mktemp.3 ============================================================================== --- stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:56:52 2012 (r233156) +++ stable/7/lib/libc/stdio/mktemp.3 Mon Mar 19 01:57:14 2012 (r233157) @@ -236,10 +236,3 @@ and the return status of the call should This will ensure that the program does not continue blindly in the event that an attacker has already created the file with the intention of manipulating or reading its contents. -.Pp -The implementation of these functions calls -.Xr arc4random 3 , -which is not reentrant. -You must provide your own locking around this and other consumers of the -.Xr arc4random 3 -API. From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 22 11:47:07 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E5EB1065673; Thu, 22 Mar 2012 11:47:07 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583998FC15; Thu, 22 Mar 2012 11:47:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MBl7Wd022970; Thu, 22 Mar 2012 11:47:07 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MBl7Ne022968; Thu, 22 Mar 2012 11:47:07 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203221147.q2MBl7Ne022968@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Mar 2012 11:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233304 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 11:47:07 -0000 Author: pluknet Date: Thu Mar 22 11:47:06 2012 New Revision: 233304 URL: http://svn.freebsd.org/changeset/base/233304 Log: MFC r210525: Missing IFCAP_* macro descriptions in ifnet(9). PR: docs/148952 Submitted by: Lars Hartmann Modified: stable/7/share/man/man9/ifnet.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/ifnet.9 ============================================================================== --- stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:43:54 2012 (r233303) +++ stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:47:06 2012 (r233304) @@ -572,6 +572,31 @@ longer than permitted by the Ethernet sp .It Dv IFCAP_JUMBO_MTU This Ethernet interface can transmit and receive frames up to 9000 bytes long. +.It Dv IFCAP_TSO4 +This Ethernet interface supports TCP Segmentation offloading. +.It Dv IFCAP_TSO6 +This Ethernet interface supports TCP6 Segmentation offloading. +.It Dv IFCAP_TSO +A shorthand for +.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 . +.It Dv IFCAP_TOE4 +This Ethernet interface supports TCP offloading. +.It Dv IFCAP_TOE6 +This Ethernet interface supports TCP6 offloading. +.It Dv ICAP_TOE +A Shorthand for +.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . +.It Dv IFCAP_WOL_UCAST +This Ethernet interface supports waking up on any Unicast packet. +.It Dv IFCAP_WOL_MCAST +This Ethernet interface supports waking up on any Multicast packet. +.It Dv IFCAP_WOL_MAGIC +This Ethernet interface supports waking up on any Magic packet such +as those sent by +.Xr wake 8 . +.It Dv IFCAP_WOL +A shorthand for +.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 23 17:23:40 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5AA4106566C; Fri, 23 Mar 2012 17:23:40 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B63058FC0A; Fri, 23 Mar 2012 17:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2NHNepX086284; Fri, 23 Mar 2012 17:23:40 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2NHNeFC086280; Fri, 23 Mar 2012 17:23:40 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201203231723.q2NHNeFC086280@svn.freebsd.org> From: Jim Harris Date: Fri, 23 Mar 2012 17:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233375 - stable/7/sys/dev/isci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 17:23:40 -0000 Author: jimharris Date: Fri Mar 23 17:23:40 2012 New Revision: 233375 URL: http://svn.freebsd.org/changeset/base/233375 Log: MFC r233371: Call xpt_bus_register during attach context, then freeze and do not release until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x where devices weren't always appearing after boot without an explicit rescan. Sponsored by: Intel Reported and tested by: Reviewed by: scottl Approved by: scottl Modified: stable/7/sys/dev/isci/isci.h stable/7/sys/dev/isci/isci_controller.c stable/7/sys/dev/isci/isci_remote_device.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/isci.h ============================================================================== --- stable/7/sys/dev/isci/isci.h Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci.h Fri Mar 23 17:23:40 2012 (r233375) @@ -122,6 +122,7 @@ struct ISCI_CONTROLLER SCI_CONTROLLER_HANDLE_T scif_controller_handle; struct ISCI_DOMAIN domain[SCI_MAX_DOMAINS]; BOOL is_started; + BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; uint8_t *remote_device_memory; Modified: stable/7/sys/dev/isci/isci_controller.c ============================================================================== --- stable/7/sys/dev/isci/isci_controller.c Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci_controller.c Fri Mar 23 17:23:40 2012 (r233375) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + /* Attach to CAM using xpt_bus_register now, then immediately freeze + * the simq. It will get released later when initial domain discovery + * is complete. + */ + controller->has_been_scanned = FALSE; + mtx_lock(&controller->lock); + isci_controller_attach_to_cam(controller); + xpt_freeze_simq(controller->sim, 1); + mtx_unlock(&controller->lock); + return (scif_controller_initialize(controller->scif_controller_handle)); } @@ -441,13 +454,13 @@ void isci_controller_start(void *control void isci_controller_domain_discovery_complete( struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain) { - if (isci_controller->sim == NULL) + if (!isci_controller->has_been_scanned) { - /* Controller has not been attached to CAM yet. We'll clear + /* Controller has not been scanned yet. We'll clear * the discovery bit for this domain, then check if all bits * are now clear. That would indicate that all domains are - * done with discovery and we can then attach the controller - * to CAM. + * done with discovery and we can then proceed with initial + * scan. */ isci_controller->initial_discovery_mask &= @@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co struct isci_softc *driver = isci_controller->isci; uint8_t next_index = isci_controller->index + 1; - isci_controller_attach_to_cam(isci_controller); + isci_controller->has_been_scanned = TRUE; + + /* Unfreeze simq to allow initial scan to proceed. */ + xpt_release_simq(isci_controller->sim, TRUE); + +#if __FreeBSD_version < 800000 + /* When driver is loaded after boot, we need to + * explicitly rescan here for versions <8.0, because + * CAM only automatically scans new buses at boot + * time. + */ + union ccb *ccb = xpt_alloc_ccb_nowait(); + + xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(isci_controller->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); + + xpt_rescan(ccb); +#endif if (next_index < driver->controller_count) { /* There are more controllers that need to Modified: stable/7/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/7/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:22:43 2012 (r233374) +++ stable/7/sys/dev/isci/isci_remote_device.c Fri Mar 23 17:23:40 2012 (r233375) @@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL isci_controller->remote_device[device_index] = isci_remote_device; - if (isci_controller->sim != NULL) { - /* The sim object is not NULL, meaning we have attached - * the controller to CAM already. In that case, create - * a CCB to instruct CAM to rescan this device. - * If the sim object is NULL, this device will get - * scanned as part of the initial scan when the - * controller is attached to CAM. + if (isci_controller->has_been_scanned) { + /* The sim object has been scanned at least once + * already. In that case, create a CCB to instruct + * CAM to rescan this device. + * If the sim object has not been scanned, this device + * will get scanned as part of the initial scan. */ union ccb *ccb = xpt_alloc_ccb_nowait();