From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 17 14:27:05 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4AA0D34D; Sun, 17 Feb 2013 14:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 255849F7; Sun, 17 Feb 2013 14:27:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HER5Gm053191; Sun, 17 Feb 2013 14:27:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HER5dE053190; Sun, 17 Feb 2013 14:27:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302171427.r1HER5dE053190@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 17 Feb 2013 14:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246915 - stable/8/bin/test X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2013 14:27:05 -0000 Author: jilles Date: Sun Feb 17 14:27:04 2013 New Revision: 246915 URL: http://svnweb.freebsd.org/changeset/base/246915 Log: MFC r244734: test(1): Document == alias for =. Modified: stable/8/bin/test/test.1 Directory Properties: stable/8/bin/test/ (props changed) Modified: stable/8/bin/test/test.1 ============================================================================== --- stable/8/bin/test/test.1 Sun Feb 17 14:25:42 2013 (r246914) +++ stable/8/bin/test/test.1 Sun Feb 17 14:27:04 2013 (r246915) @@ -32,7 +32,7 @@ .\" @(#)test.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd September 10, 2010 +.Dd December 27, 2012 .Dt TEST 1 .Os .Sh NAME @@ -331,6 +331,13 @@ missing. .It >1 An error occurred. .El +.Sh COMPATIBILITY +For compatibility with some other implementations, +the +.Cm = +primary can be substituted with +.Cm == +with the same meaning. .Sh SEE ALSO .Xr builtin 1 , .Xr expr 1 , From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 17 19:49:30 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 89475239; Sun, 17 Feb 2013 19:49:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CCE0674; Sun, 17 Feb 2013 19:49:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HJnUho051866; Sun, 17 Feb 2013 19:49:30 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HJnUXT051864; Sun, 17 Feb 2013 19:49:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302171949.r1HJnUXT051864@svn.freebsd.org> From: Mark Johnston Date: Sun, 17 Feb 2013 19:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246919 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2013 19:49:30 -0000 Author: markj Date: Sun Feb 17 19:49:29 2013 New Revision: 246919 URL: http://svnweb.freebsd.org/changeset/base/246919 Log: MFC r245961 r245962 r245963. MFC r245961: When the 'R' flag is used with a newsyslog.conf entry, some fields of the corresponding struct sigwork_entry were left uninitialized, potentially causing an early return from do_sigwork(). Ensure that these fields are initialized, and handle the 'R' flag properly in do_sigwork(). MFC r245962: Ensure that newsyslog -n prints the correct message for a rotation rule that uses the 'R' flag. MFC r245963: Rename the run_cmd field to sw_runcmd to make it consistent with the other fields in struct sigwork_entry. Approved by: emaste (co-mentor) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sun Feb 17 19:49:18 2013 (r246918) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sun Feb 17 19:49:29 2013 (r246919) @@ -179,7 +179,7 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_t sw_pid; /* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - int run_cmd; /* run command or send PID to signal */ + int sw_runcmd; /* run command or send PID to signal */ char sw_fname[1]; /* file the PID was read from or shell cmd */ }; @@ -1830,7 +1830,7 @@ do_sigwork(struct sigwork_entry *swork) int kres, secs; char *tmp; - if (!(swork->sw_pidok) || swork->sw_pid == 0) + if (swork->sw_runcmd == 0 && (!(swork->sw_pidok) || swork->sw_pid == 0)) return; /* no work to do... */ /* @@ -1864,14 +1864,19 @@ do_sigwork(struct sigwork_entry *swork) } if (noaction) { - printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum, - (int)swork->sw_pid, swork->sw_fname); - if (secs > 0) - printf("\tsleep %d\n", secs); + if (swork->sw_runcmd) + printf("\tsh -c '%s %d'\n", swork->sw_fname, + swork->sw_signum); + else { + printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum, + (int)swork->sw_pid, swork->sw_fname); + if (secs > 0) + printf("\tsleep %d\n", secs); + } return; } - if (swork->run_cmd) { + if (swork->sw_runcmd) { asprintf(&tmp, "%s %d", swork->sw_fname, swork->sw_signum); if (tmp == NULL) { warn("can't allocate memory to run %s", @@ -1946,7 +1951,7 @@ do_zipwork(struct zipwork_entry *zwork) else pgm_name++; - if (zwork->zw_swork != NULL && zwork->zw_swork->run_cmd == 0 && + if (zwork->zw_swork != NULL && zwork->zw_swork->sw_runcmd == 0 && zwork->zw_swork->sw_pidok <= 0) { warnx( "log %s not compressed because daemon(s) not notified", @@ -2038,10 +2043,12 @@ save_sigwork(const struct conf_entry *en tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - stmp->run_cmd = 0; + stmp->sw_runcmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { - stmp->run_cmd = 1; + stmp->sw_pid = -1; + stmp->sw_pidok = 0; + stmp->sw_runcmd = 1; } else { set_swpid(stmp, ent); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 18 16:03:42 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CCA6441D; Mon, 18 Feb 2013 16:03:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6AF66E7; Mon, 18 Feb 2013 16:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IG3g5C024905; Mon, 18 Feb 2013 16:03:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IG3gSb024904; Mon, 18 Feb 2013 16:03:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302181603.r1IG3gSb024904@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 18 Feb 2013 16:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246942 - stable/8/share/man/man9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 16:03:42 -0000 Author: pluknet Date: Mon Feb 18 16:03:42 2013 New Revision: 246942 URL: http://svnweb.freebsd.org/changeset/base/246942 Log: MFC r246658: Cross-reference vfs_unbusy(9). Modified: stable/8/share/man/man9/vfs_busy.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/vfs_busy.9 ============================================================================== --- stable/8/share/man/man9/vfs_busy.9 Mon Feb 18 16:02:17 2013 (r246941) +++ stable/8/share/man/man9/vfs_busy.9 Mon Feb 18 16:03:42 2013 (r246942) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2010 +.Dd February 11, 2013 .Dt VFS_BUSY 9 .Os .Sh NAME @@ -84,6 +84,8 @@ The mount point is being unmounted .Dv ( MNTK_UNMOUNT is set). .El +.Sh SEE ALSO +.Xr vfs_unbusy 9 .Sh AUTHORS This manual page was written by .An Chad David Aq davidc@acns.ab.ca . From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 18 22:03:05 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C94B9826; Mon, 18 Feb 2013 22:03:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2AAC9E9; Mon, 18 Feb 2013 22:03:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IM35BX035301; Mon, 18 Feb 2013 22:03:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IM35xs035300; Mon, 18 Feb 2013 22:03:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302182203.r1IM35xs035300@svn.freebsd.org> From: Dimitry Andric Date: Mon, 18 Feb 2013 22:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246950 - in stable: 7/usr.bin/mail 8/usr.bin/mail 9/usr.bin/mail X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 22:03:05 -0000 Author: dim Date: Mon Feb 18 22:03:04 2013 New Revision: 246950 URL: http://svnweb.freebsd.org/changeset/base/246950 Log: MFC r246860: Fix undefined behaviour in usr.bin/mail/util.c. Reported by: deeptech71@gmail.com Modified: stable/8/usr.bin/mail/util.c Directory Properties: stable/8/usr.bin/mail/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.bin/mail/aux.c stable/9/usr.bin/mail/util.c Directory Properties: stable/7/usr.bin/mail/ (props changed) stable/9/usr.bin/mail/ (props changed) Modified: stable/8/usr.bin/mail/util.c ============================================================================== --- stable/8/usr.bin/mail/util.c Mon Feb 18 20:21:26 2013 (r246949) +++ stable/8/usr.bin/mail/util.c Mon Feb 18 22:03:04 2013 (r246950) @@ -257,8 +257,8 @@ istrncpy(dest, src, dsize) { strlcpy(dest, src, dsize); - while (*dest) - *dest++ = tolower((unsigned char)*dest); + for (; *dest; dest++) + *dest = tolower((unsigned char)*dest); } /* From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 19 07:50:12 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 500C4DBE; Tue, 19 Feb 2013 07:50:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 415D0219; Tue, 19 Feb 2013 07:50:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J7oBcJ012571; Tue, 19 Feb 2013 07:50:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J7oBRj012570; Tue, 19 Feb 2013 07:50:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190750.r1J7oBRj012570@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 07:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246980 - in stable: 7/contrib/opie 8/contrib/opie 9/contrib/opie X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 07:50:12 -0000 Author: dim Date: Tue Feb 19 07:50:10 2013 New Revision: 246980 URL: http://svnweb.freebsd.org/changeset/base/246980 Log: MFC r246873: In contrib/opie/opiekey.c, use the correct length to zero the secret. Found by: clang ToT Reviewed by: delphij Modified: stable/8/contrib/opie/opiekey.c Directory Properties: stable/8/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/opie/opiekey.c stable/9/contrib/opie/opiekey.c Directory Properties: stable/7/contrib/opie/ (props changed) stable/9/contrib/opie/ (props changed) Modified: stable/8/contrib/opie/opiekey.c ============================================================================== --- stable/8/contrib/opie/opiekey.c Tue Feb 19 06:42:12 2013 (r246979) +++ stable/8/contrib/opie/opiekey.c Tue Feb 19 07:50:10 2013 (r246980) @@ -109,19 +109,19 @@ static void getsecret FUNCTION((secret, if (!opiereadpass(verify, OPIE_SECRET_MAX, 0)) { fprintf(stderr, "Error reading %ssecret pass phrase!\n", promptextra); memset(verify, 0, sizeof(verify)); - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); exit(1); } if (verify[0] && strcmp(verify, secret)) { fprintf(stderr, "They don't match. Try again.\n"); memset(verify, 0, sizeof(verify)); - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); exit(1); } memset(verify, 0, sizeof(verify)); } if (!(flags & 2) && !aflag && opiepasscheck(secret)) { - memset(secret, 0, sizeof(secret)); + memset(secret, 0, OPIE_SECRET_MAX + 1); fprintf(stderr, "Secret pass phrases must be between %d and %d characters long.\n", OPIE_SECRET_MIN, OPIE_SECRET_MAX); exit(1); }; From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 19 07:55:54 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 917722D0; Tue, 19 Feb 2013 07:55:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82A0C252; Tue, 19 Feb 2013 07:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J7tsa3014953; Tue, 19 Feb 2013 07:55:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J7tsVg014951; Tue, 19 Feb 2013 07:55:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190755.r1J7tsVg014951@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 07:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246981 - in stable: 7/contrib/nvi/ex 7/contrib/nvi/vi 8/contrib/nvi/ex 8/contrib/nvi/vi 9/contrib/nvi/ex 9/contrib/nvi/vi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 07:55:54 -0000 Author: dim Date: Tue Feb 19 07:55:53 2013 New Revision: 246981 URL: http://svnweb.freebsd.org/changeset/base/246981 Log: MFC r246874: Fix two instances of undefined behaviour in contrib/nvi. Found by: clang ToT Obtained from: NetBSD Reviewed by: jh Modified: stable/8/contrib/nvi/ex/ex_txt.c stable/8/contrib/nvi/vi/v_txt.c Directory Properties: stable/8/contrib/nvi/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/nvi/ex/ex_txt.c stable/7/contrib/nvi/vi/v_txt.c stable/9/contrib/nvi/ex/ex_txt.c stable/9/contrib/nvi/vi/v_txt.c Directory Properties: stable/7/contrib/nvi/ (props changed) stable/9/contrib/nvi/ (props changed) Modified: stable/8/contrib/nvi/ex/ex_txt.c ============================================================================== --- stable/8/contrib/nvi/ex/ex_txt.c Tue Feb 19 07:50:10 2013 (r246980) +++ stable/8/contrib/nvi/ex/ex_txt.c Tue Feb 19 07:55:53 2013 (r246981) @@ -398,8 +398,8 @@ txt_dent(sp, tp) ++scno; /* Get the previous shiftwidth column. */ - cno = scno; - scno -= --scno % sw; + cno = scno--; + scno -= scno % sw; /* * Since we don't know what comes before the character(s) being Modified: stable/8/contrib/nvi/vi/v_txt.c ============================================================================== --- stable/8/contrib/nvi/vi/v_txt.c Tue Feb 19 07:50:10 2013 (r246980) +++ stable/8/contrib/nvi/vi/v_txt.c Tue Feb 19 07:55:53 2013 (r246981) @@ -1956,8 +1956,10 @@ txt_dent(sp, tp, isindent) target = current; if (isindent) target += COL_OFF(target, sw); - else - target -= --target % sw; + else { + --target; + target -= target % sw; + } /* * The AI characters will be turned into overwrite characters if the From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 19 08:07:13 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 026BD8A2; Tue, 19 Feb 2013 08:07:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E321B2D8; Tue, 19 Feb 2013 08:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J87CXu018550; Tue, 19 Feb 2013 08:07:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J87Cd5018549; Tue, 19 Feb 2013 08:07:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302190807.r1J87Cd5018549@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 08:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246982 - in stable: 7/contrib/wpa_supplicant 8/contrib/wpa/src/crypto 9/contrib/wpa/src/crypto X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 08:07:13 -0000 Author: dim Date: Tue Feb 19 08:07:11 2013 New Revision: 246982 URL: http://svnweb.freebsd.org/changeset/base/246982 Log: MFC r246875: Import change 40eebf235370b6fe6353784ccf01ab92eed062a5 from upstream wpa: From: Jouni Malinen Date: Fri, 15 Jul 2011 13:42:06 +0300 Subject: [PATCH] MD5: Fix clearing of temporary stack memory to use correct length sizeof of the structure instead of the pointer was supposed to be used here. Fix this to clear the full structure at the end of MD5Final(). Found by: clang ToT Reviewed by: rpaulo Modified: stable/8/contrib/wpa/src/crypto/md5.c Directory Properties: stable/8/contrib/wpa/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/wpa_supplicant/md5.c stable/9/contrib/wpa/src/crypto/md5-internal.c Directory Properties: stable/7/contrib/wpa_supplicant/ (props changed) stable/9/contrib/wpa/ (props changed) Modified: stable/8/contrib/wpa/src/crypto/md5.c ============================================================================== --- stable/8/contrib/wpa/src/crypto/md5.c Tue Feb 19 07:55:53 2013 (r246981) +++ stable/8/contrib/wpa/src/crypto/md5.c Tue Feb 19 08:07:11 2013 (r246982) @@ -287,7 +287,7 @@ void MD5Final(unsigned char digest[16], MD5Transform(ctx->buf, (u32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); os_memcpy(digest, ctx->buf, 16); - os_memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + os_memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 19 16:40:17 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 454E72CD; Tue, 19 Feb 2013 16:40:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED872BE; Tue, 19 Feb 2013 16:40:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JGeHkx076644; Tue, 19 Feb 2013 16:40:17 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JGeGNR076643; Tue, 19 Feb 2013 16:40:16 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302191640.r1JGeGNR076643@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Feb 2013 16:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246998 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 16:40:17 -0000 Author: markj Date: Tue Feb 19 16:40:16 2013 New Revision: 246998 URL: http://svnweb.freebsd.org/changeset/base/246998 Log: MFC r239672 (by rrs): This small change takes care of a race condition that can occur when both sides close at the same time. If that occurs, without this fix the connection enters FIN1 on both sides and they will forever send FIN|ACK at each other until the connection times out. This is because we stopped processing the FIN|ACK and thus did not advance the sequence and so never ACK'd each others FIN. This fix adjusts it so we *do* process the FIN properly and the race goes away ;-) Approved by: rrs Approved by: emaste (co-mentor) Modified: stable/8/sys/netinet/tcp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Tue Feb 19 16:39:53 2013 (r246997) +++ stable/8/sys/netinet/tcp_input.c Tue Feb 19 16:40:16 2013 (r246998) @@ -2372,6 +2372,16 @@ tcp_do_segment(struct mbuf *m, struct tc } } else tp->snd_cwnd += tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { @@ -2411,6 +2421,16 @@ tcp_do_segment(struct mbuf *m, struct tc } tp->snd_nxt = th->th_ack; tp->snd_cwnd = tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", @@ -2437,6 +2457,16 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->snd_nxt - tp->snd_una) + (tp->t_dupacks - tp->snd_limited) * tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 20 23:26:16 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0780A244; Wed, 20 Feb 2013 23:26:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB09820F; Wed, 20 Feb 2013 23:26:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KNQF0t073128; Wed, 20 Feb 2013 23:26:15 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KNQFoO073126; Wed, 20 Feb 2013 23:26:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302202326.r1KNQFoO073126@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 20 Feb 2013 23:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247063 - in stable/8: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 23:26:16 -0000 Author: jilles Date: Wed Feb 20 23:26:14 2013 New Revision: 247063 URL: http://svnweb.freebsd.org/changeset/base/247063 Log: MFC r222292,r230095: Show errno messages in cd. Added: stable/8/tools/regression/bin/sh/builtins/cd8.0 - copied unchanged from r230095, head/tools/regression/bin/sh/builtins/cd8.0 Modified: stable/8/bin/sh/cd.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/cd.c ============================================================================== --- stable/8/bin/sh/cd.c Wed Feb 20 23:15:40 2013 (r247062) +++ stable/8/bin/sh/cd.c Wed Feb 20 23:26:14 2013 (r247063) @@ -84,6 +84,7 @@ cdcmd(int argc, char **argv) char *p; struct stat statb; int ch, phys, print = 0; + int errno1 = ENOENT; optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = Pflag; @@ -120,7 +121,12 @@ cdcmd(int argc, char **argv) if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL) path = nullstr; while ((p = padvance(&path, dest)) != NULL) { - if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) { + if (stat(p, &statb) < 0) { + if (errno != ENOENT) + errno1 = errno; + } else if (!S_ISDIR(statb.st_mode)) + errno1 = ENOTDIR; + else { if (!print) { /* * XXX - rethink @@ -132,9 +138,11 @@ cdcmd(int argc, char **argv) } if (docd(p, print, phys) >= 0) return 0; + if (errno != ENOENT) + errno1 = errno; } } - error("can't cd to %s", dest); + error("%s: %s", dest, strerror(errno1)); /*NOTREACHED*/ return 0; } Copied: stable/8/tools/regression/bin/sh/builtins/cd8.0 (from r230095, head/tools/regression/bin/sh/builtins/cd8.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/cd8.0 Wed Feb 20 23:26:14 2013 (r247063, copy of r230095, head/tools/regression/bin/sh/builtins/cd8.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# The exact wording of the error message is not standardized, but giving +# a description of the errno is useful. + +LC_ALL=C +export LC_ALL +r=0 + +t() { + exec 3>&1 + errmsg=`cd "$1" 2>&1 >&3 3>&-` + exec 3>&- + case $errmsg in + *[Nn]ot\ a\ directory*) + ;; + *) + printf "Wrong error message for %s: %s\n" "$1" "$errmsg" + r=3 + ;; + esac +} + +t /dev/tty +t /dev/tty/x +exit $r From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 06:10:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B7EB68D1; Thu, 21 Feb 2013 06:10:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9E6E117F; Thu, 21 Feb 2013 06:10:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L6AbB4098111; Thu, 21 Feb 2013 06:10:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L6AbKs098109; Thu, 21 Feb 2013 06:10:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302210610.r1L6AbKs098109@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 21 Feb 2013 06:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247083 - in stable/8/sys: fs/devfs kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 06:10:37 -0000 Author: kib Date: Thu Feb 21 06:10:36 2013 New Revision: 247083 URL: http://svnweb.freebsd.org/changeset/base/247083 Log: MFC r246472: Stop translating the ERESTART error from the open(2) into EINTR. Posix requires that open(2) is restartable for SA_RESTART. Modified: stable/8/sys/fs/devfs/devfs_vnops.c stable/8/sys/kern/vfs_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Thu Feb 21 06:00:33 2013 (r247082) +++ stable/8/sys/fs/devfs/devfs_vnops.c Thu Feb 21 06:10:36 2013 (r247083) @@ -1015,8 +1015,11 @@ devfs_open(struct vop_open_args *ap) vn_lock(vp, vlocked | LK_RETRY); dev_relthread(dev, ref); - if (error) + if (error != 0) { + if (error == ERESTART) + error = EINTR; return (error); + } #if 0 /* /dev/console */ KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp")); Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Thu Feb 21 06:00:33 2013 (r247082) +++ stable/8/sys/kern/vfs_syscalls.c Thu Feb 21 06:10:36 2013 (r247083) @@ -1107,8 +1107,6 @@ kern_openat(struct thread *td, int fd, c fdclose(fdp, fp, indx, td); fdrop(fp, td); - if (error == ERESTART) - error = EINTR; return (error); } td->td_dupfd = 0; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 06:12:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4AF66A44; Thu, 21 Feb 2013 06:12:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB4F1118E; Thu, 21 Feb 2013 06:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L6CQMo099853; Thu, 21 Feb 2013 06:12:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L6CQDg099852; Thu, 21 Feb 2013 06:12:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302210612.r1L6CQDg099852@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 21 Feb 2013 06:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247084 - stable/8/lib/libc/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 06:12:27 -0000 Author: kib Date: Thu Feb 21 06:12:26 2013 New Revision: 247084 URL: http://svnweb.freebsd.org/changeset/base/247084 Log: MFC r246476: Document the ERESTART translation to EINTR for devfs nodes. Modified: stable/8/lib/libc/sys/open.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/open.2 ============================================================================== --- stable/8/lib/libc/sys/open.2 Thu Feb 21 06:10:36 2013 (r247083) +++ stable/8/lib/libc/sys/open.2 Thu Feb 21 06:12:26 2013 (r247084) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd March 25, 2011 +.Dd February 7, 2013 .Dt OPEN 2 .Os .Sh NAME @@ -235,6 +235,17 @@ It returns \-1 on failure. The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp +If a sleeping open of a device node from +.Xr devfs 5 +is interrupted by a signal, the call always fails with +.Er EINTR , +even if the +.Dv SA_RESTART +flag is set for the signal. +A sleeping open of a fifo (see +.Xr mkfifo 2 ) +is restarted as normal. +.Pp When a new file is created it is given the group of the directory which contains it. .Pp From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 08:21:18 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2A51A11F; Thu, 21 Feb 2013 08:21:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19C0F1A5D; Thu, 21 Feb 2013 08:21:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L8LHUT039032; Thu, 21 Feb 2013 08:21:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L8LEm9039011; Thu, 21 Feb 2013 08:21:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302210821.r1L8LEm9039011@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 21 Feb 2013 08:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247091 - in stable/8/sys: dev/usb dev/usb/controller dev/usb/template sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 08:21:18 -0000 Author: hselasky Date: Thu Feb 21 08:21:14 2013 New Revision: 247091 URL: http://svnweb.freebsd.org/changeset/base/247091 Log: MFC r246616 and r246759: - Move scratch data from the USB bus structure to the USB device structure so that simultaneous access cannot happen. Protect scratch area using the enumeration lock. - Reduce stack usage in usbd_transfer_setup() by moving some big stack members to the scratch area. This saves around 200 bytes of stack. - Fix a whitespace. - Protect control requests using the USB device enumeration lock. - Make sure all callers of usbd_enum_lock() check the return value. - Remove the control transfer specific lock. - Bump the FreeBSD version number, hence external USB modules may need to be recompiled due to a USB device structure change. Modified: stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/usb_bus.h stable/8/sys/dev/usb/usb_controller.h stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_dev.h stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_handle_request.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_msctest.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usb_util.c stable/8/sys/sys/param.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/controller/usb_controller.c Thu Feb 21 08:21:14 2013 (r247091) @@ -407,6 +407,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) struct usb_bus *bus; struct usb_device *udev; usb_error_t err; + uint8_t do_unlock; bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -427,7 +428,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) bus_generic_shutdown(bus->bdev); - usbd_enum_lock(udev); + do_unlock = usbd_enum_lock(udev); err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX); if (err) @@ -444,7 +445,8 @@ usb_bus_suspend(struct usb_proc_msg *pm) if (bus->methods->set_hw_power_sleep != NULL) (bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SUSPEND); - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); } @@ -460,6 +462,7 @@ usb_bus_resume(struct usb_proc_msg *pm) struct usb_bus *bus; struct usb_device *udev; usb_error_t err; + uint8_t do_unlock; bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -469,7 +472,7 @@ usb_bus_resume(struct usb_proc_msg *pm) USB_BUS_UNLOCK(bus); - usbd_enum_lock(udev); + do_unlock = usbd_enum_lock(udev); #if 0 DEVMETHOD(usb_take_controller, NULL); /* dummy */ #endif @@ -503,7 +506,8 @@ usb_bus_resume(struct usb_proc_msg *pm) "attach root HUB\n"); } - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); } @@ -519,6 +523,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm struct usb_bus *bus; struct usb_device *udev; usb_error_t err; + uint8_t do_unlock; bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -530,7 +535,7 @@ usb_bus_shutdown(struct usb_proc_msg *pm bus_generic_shutdown(bus->bdev); - usbd_enum_lock(udev); + do_unlock = usbd_enum_lock(udev); err = usbd_set_config_index(udev, USB_UNCONFIG_INDEX); if (err) @@ -547,7 +552,8 @@ usb_bus_shutdown(struct usb_proc_msg *pm if (bus->methods->set_hw_power_sleep != NULL) (bus->methods->set_hw_power_sleep) (bus, USB_HW_POWER_SHUTDOWN); - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); } Modified: stable/8/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/template/usb_template.c Thu Feb 21 08:21:14 2013 (r247091) @@ -845,20 +845,20 @@ usb_hw_ep_resolve(struct usb_device *ude struct usb_device_descriptor *dd; uint16_t mps; - if (desc == NULL) { + if (desc == NULL) return (USB_ERR_INVAL); - } + /* get bus methods */ methods = udev->bus->methods; - if (methods->get_hw_ep_profile == NULL) { + if (methods->get_hw_ep_profile == NULL) return (USB_ERR_INVAL); - } + if (desc->bDescriptorType == UDESC_DEVICE) { - if (desc->bLength < sizeof(*dd)) { + if (desc->bLength < sizeof(*dd)) return (USB_ERR_INVAL); - } + dd = (void *)desc; /* get HW control endpoint 0 profile */ @@ -905,13 +905,12 @@ usb_hw_ep_resolve(struct usb_device *ude } return (0); /* success */ } - if (desc->bDescriptorType != UDESC_CONFIG) { + if (desc->bDescriptorType != UDESC_CONFIG) return (USB_ERR_INVAL); - } - if (desc->bLength < sizeof(*(ues->cd))) { + if (desc->bLength < sizeof(*(ues->cd))) return (USB_ERR_INVAL); - } - ues = udev->bus->scratch[0].hw_ep_scratch; + + ues = udev->scratch.hw_ep_scratch; memset(ues, 0, sizeof(*ues)); @@ -1232,13 +1231,18 @@ usb_temp_setup(struct usb_device *udev, { struct usb_temp_setup *uts; void *buf; + usb_error_t error; uint8_t n; + uint8_t do_unlock; - if (tdd == NULL) { - /* be NULL safe */ + /* be NULL safe */ + if (tdd == NULL) return (0); - } - uts = udev->bus->scratch[0].temp_setup; + + /* Protect scratch area */ + do_unlock = usbd_enum_lock(udev); + + uts = udev->scratch.temp_setup; memset(uts, 0, sizeof(*uts)); @@ -1251,17 +1255,24 @@ usb_temp_setup(struct usb_device *udev, if (uts->err) { /* some error happened */ - return (uts->err); + goto done; } /* sanity check */ if (uts->size == 0) { - return (USB_ERR_INVAL); + uts->err = USB_ERR_INVAL; + goto done; } /* allocate zeroed memory */ uts->buf = malloc(uts->size, M_USB, M_WAITOK | M_ZERO); + /* + * Allow malloc() to return NULL regardless of M_WAITOK flag. + * This helps when porting the software to non-FreeBSD + * systems. + */ if (uts->buf == NULL) { /* could not allocate memory */ - return (USB_ERR_NOMEM); + uts->err = USB_ERR_NOMEM; + goto done; } /* second pass */ @@ -1276,7 +1287,7 @@ usb_temp_setup(struct usb_device *udev, if (uts->err) { /* some error happened during second pass */ - goto error; + goto done; } /* * Resolve all endpoint addresses ! @@ -1287,7 +1298,7 @@ usb_temp_setup(struct usb_device *udev, DPRINTFN(0, "Could not resolve endpoints for " "Device Descriptor, error = %s\n", usbd_errstr(uts->err)); - goto error; + goto done; } for (n = 0;; n++) { @@ -1300,14 +1311,16 @@ usb_temp_setup(struct usb_device *udev, DPRINTFN(0, "Could not resolve endpoints for " "Config Descriptor %u, error = %s\n", n, usbd_errstr(uts->err)); - goto error; + goto done; } } - return (uts->err); - -error: - usb_temp_unsetup(udev); - return (uts->err); +done: + error = uts->err; + if (error) + usb_temp_unsetup(udev); + if (do_unlock) + usbd_enum_unlock(udev); + return (error); } /*------------------------------------------------------------------------* Modified: stable/8/sys/dev/usb/usb_bus.h ============================================================================== --- stable/8/sys/dev/usb/usb_bus.h Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_bus.h Thu Feb 21 08:21:14 2013 (r247091) @@ -103,16 +103,6 @@ struct usb_bus { uint8_t devices_max; /* maximum number of USB devices */ uint8_t do_probe; /* set if USB should be re-probed */ uint8_t no_explore; /* don't explore USB ports */ - - /* - * The scratch area can only be used inside the explore thread - * belonging to the give serial bus. - */ - union { - struct usb_hw_ep_scratch hw_ep_scratch[1]; - struct usb_temp_setup temp_setup[1]; - uint8_t data[255]; - } scratch[1]; }; #endif /* _USB_BUS_H_ */ Modified: stable/8/sys/dev/usb/usb_controller.h ============================================================================== --- stable/8/sys/dev/usb/usb_controller.h Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_controller.h Thu Feb 21 08:21:14 2013 (r247091) @@ -40,7 +40,6 @@ struct usb_page_cache; struct usb_setup_params; struct usb_hw_ep_profile; struct usb_fs_isoc_schedule; -struct usb_config_descriptor; struct usb_endpoint_descriptor; /* typedefs */ @@ -181,50 +180,6 @@ struct usb_hw_ep_profile { uint8_t support_out:1; /* OUT-token is supported */ }; -/* - * The following structure is used when trying to allocate hardware - * endpoints for an USB configuration in USB device side mode. - */ -struct usb_hw_ep_scratch_sub { - const struct usb_hw_ep_profile *pf; - uint16_t max_frame_size; - uint8_t hw_endpoint_out; - uint8_t hw_endpoint_in; - uint8_t needs_ep_type; - uint8_t needs_in:1; - uint8_t needs_out:1; -}; - -/* - * The following structure is used when trying to allocate hardware - * endpoints for an USB configuration in USB device side mode. - */ -struct usb_hw_ep_scratch { - struct usb_hw_ep_scratch_sub ep[USB_EP_MAX]; - struct usb_hw_ep_scratch_sub *ep_max; - struct usb_config_descriptor *cd; - struct usb_device *udev; - struct usb_bus_methods *methods; - uint8_t bmOutAlloc[(USB_EP_MAX + 15) / 16]; - uint8_t bmInAlloc[(USB_EP_MAX + 15) / 16]; -}; - -/* - * The following structure is used when generating USB descriptors - * from USB templates. - */ -struct usb_temp_setup { - void *buf; - usb_size_t size; - enum usb_dev_speed usb_speed; - uint8_t self_powered; - uint8_t bNumEndpoints; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bConfigurationValue; - usb_error_t err; -}; - /* prototypes */ void usb_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_dev.c Thu Feb 21 08:21:14 2013 (r247091) @@ -214,10 +214,10 @@ usb_ref_device(struct usb_cdev_privdata mtx_unlock(&usb_ref_lock); /* - * We need to grab the sx-lock before grabbing the - * FIFO refs to avoid deadlock at detach! + * We need to grab the enumeration SX-lock before + * grabbing the FIFO refs to avoid deadlock at detach! */ - usbd_enum_lock(cpd->udev); + crd->do_unlock = usbd_enum_lock(cpd->udev); mtx_lock(&usb_ref_lock); @@ -278,9 +278,10 @@ usb_ref_device(struct usb_cdev_privdata return (0); error: - if (crd->is_uref) { + if (crd->do_unlock) usbd_enum_unlock(cpd->udev); + if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { cv_signal(&cpd->udev->ref_cv); } @@ -332,7 +333,7 @@ usb_unref_device(struct usb_cdev_privdat DPRINTFN(2, "cpd=%p is_uref=%d\n", cpd, crd->is_uref); - if (crd->is_uref) + if (crd->do_unlock) usbd_enum_unlock(cpd->udev); mtx_lock(&usb_ref_lock); Modified: stable/8/sys/dev/usb/usb_dev.h ============================================================================== --- stable/8/sys/dev/usb/usb_dev.h Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_dev.h Thu Feb 21 08:21:14 2013 (r247091) @@ -82,6 +82,7 @@ struct usb_cdev_refdata { uint8_t is_write; /* location has write access */ uint8_t is_uref; /* USB refcount decr. needed */ uint8_t is_usbfs; /* USB-FS is active */ + uint8_t do_unlock; /* USB enum unlock needed */ }; struct usb_fs_privdata { Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_device.c Thu Feb 21 08:21:14 2013 (r247091) @@ -443,13 +443,8 @@ usb_unconfigure(struct usb_device *udev, { uint8_t do_unlock; - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); /* detach all interface drivers */ usb_detach_device(udev, USB_IFACE_INDEX_ANY, flag); @@ -512,13 +507,8 @@ usbd_set_config_index(struct usb_device DPRINTFN(6, "udev=%p index=%d\n", udev, index); - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); usb_unconfigure(udev, 0); @@ -871,13 +861,9 @@ usbd_set_alt_interface_index(struct usb_ usb_error_t err; uint8_t do_unlock; - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); + if (iface == NULL) { err = USB_ERR_INVAL; goto done; @@ -914,7 +900,6 @@ usbd_set_alt_interface_index(struct usb_ done: if (do_unlock) usbd_enum_unlock(udev); - return (err); } @@ -1285,13 +1270,8 @@ usb_probe_and_attach(struct usb_device * DPRINTF("udev == NULL\n"); return (USB_ERR_INVAL); } - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); if (udev->curr_config_index == USB_UNCONFIG_INDEX) { /* do nothing - no configuration has been set */ @@ -1378,7 +1358,6 @@ usb_probe_and_attach(struct usb_device * done: if (do_unlock) usbd_enum_unlock(udev); - return (0); } @@ -1507,6 +1486,7 @@ usb_alloc_device(device_t parent_dev, st uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; + uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1541,9 +1521,6 @@ usb_alloc_device(device_t parent_dev, st return (NULL); } /* initialise our SX-lock */ - sx_init_flags(&udev->ctrl_sx, "USB device SX lock", SX_DUPOK); - - /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); @@ -1725,7 +1702,11 @@ usb_alloc_device(device_t parent_dev, st * device descriptor. If no strings are present there we * simply disable all USB strings. */ - scratch_ptr = udev->bus->scratch[0].data; + + /* Protect scratch area */ + do_unlock = usbd_enum_lock(udev); + + scratch_ptr = udev->scratch.data; if (udev->ddesc.iManufacturer || udev->ddesc.iProduct || @@ -1750,7 +1731,7 @@ usb_alloc_device(device_t parent_dev, st mask = usb_lang_mask; /* align length correctly */ - scratch_ptr[0] &= ~1; + scratch_ptr[0] &= ~1U; /* fix compiler warning */ langid = 0; @@ -1771,6 +1752,9 @@ usb_alloc_device(device_t parent_dev, st udev->langid = langid; } + if (do_unlock) + usbd_enum_unlock(udev); + /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ @@ -2107,7 +2091,6 @@ usb_free_device(struct usb_device *udev, &udev->cs_msg[0], &udev->cs_msg[1]); USB_BUS_UNLOCK(udev->bus); - sx_destroy(&udev->ctrl_sx); sx_destroy(&udev->enum_sx); sx_destroy(&udev->sr_sx); @@ -2270,9 +2253,13 @@ usbd_set_device_strings(struct usb_devic size_t temp_size; uint16_t vendor_id; uint16_t product_id; + uint8_t do_unlock; - temp_ptr = (char *)udev->bus->scratch[0].data; - temp_size = sizeof(udev->bus->scratch[0].data); + /* Protect scratch area */ + do_unlock = usbd_enum_lock(udev); + + temp_ptr = (char *)udev->scratch.data; + temp_size = sizeof(udev->scratch.data); vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); @@ -2327,6 +2314,9 @@ usbd_set_device_strings(struct usb_devic snprintf(temp_ptr, temp_size, "product 0x%04x", product_id); udev->product = strdup(temp_ptr, M_USB); } + + if (do_unlock) + usbd_enum_unlock(udev); } /* @@ -2714,11 +2704,17 @@ usbd_device_attached(struct usb_device * return (udev->state > USB_STATE_DETACHED); } -/* The following function locks enumerating the given USB device. */ - -void +/* + * The following function locks enumerating the given USB device. If + * the lock is already grabbed this function returns zero. Else a + * non-zero value is returned. + */ +uint8_t usbd_enum_lock(struct usb_device *udev) { + if (sx_xlocked(&udev->enum_sx)) + return (0); + sx_xlock(&udev->enum_sx); sx_xlock(&udev->sr_sx); /* @@ -2727,6 +2723,7 @@ usbd_enum_lock(struct usb_device *udev) * locked multiple times. */ mtx_lock(&Giant); + return (1); } /* The following function unlocks enumerating the given USB device. */ Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_device.h Thu Feb 21 08:21:14 2013 (r247091) @@ -27,9 +27,18 @@ #ifndef _USB_DEVICE_H_ #define _USB_DEVICE_H_ -struct usb_symlink; /* UGEN */ +#ifndef USB_GLOBAL_INCLUDE_FILE +#include +#include +#include +#endif + +struct usb_bus_methods; +struct usb_config_descriptor; struct usb_device; /* linux compat */ struct usb_fs_privdata; +struct usb_hw_ep_profile; +struct usb_symlink; /* UGEN */ #define USB_CTRL_XFER_MAX 2 @@ -108,13 +117,70 @@ struct usb_power_save { }; /* + * The following structure is used when trying to allocate hardware + * endpoints for an USB configuration in USB device side mode. + */ +struct usb_hw_ep_scratch_sub { + const struct usb_hw_ep_profile *pf; + uint16_t max_frame_size; + uint8_t hw_endpoint_out; + uint8_t hw_endpoint_in; + uint8_t needs_ep_type; + uint8_t needs_in:1; + uint8_t needs_out:1; +}; + +/* + * The following structure is used when trying to allocate hardware + * endpoints for an USB configuration in USB device side mode. + */ +struct usb_hw_ep_scratch { + struct usb_hw_ep_scratch_sub ep[USB_EP_MAX]; + struct usb_hw_ep_scratch_sub *ep_max; + struct usb_config_descriptor *cd; + struct usb_device *udev; + struct usb_bus_methods *methods; + uint8_t bmOutAlloc[(USB_EP_MAX + 15) / 16]; + uint8_t bmInAlloc[(USB_EP_MAX + 15) / 16]; +}; + +/* + * The following structure is used when generating USB descriptors + * from USB templates. + */ +struct usb_temp_setup { + void *buf; + usb_size_t size; + enum usb_dev_speed usb_speed; + uint8_t self_powered; + uint8_t bNumEndpoints; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bConfigurationValue; + usb_error_t err; +}; + +/* + * The scratch area for USB devices. Access to this structure is + * protected by the enumeration SX lock. + */ +union usb_device_scratch { + struct usb_hw_ep_scratch hw_ep_scratch[1]; + struct usb_temp_setup temp_setup[1]; + struct { + struct usb_xfer dummy; + struct usb_setup_params parm; + } xfer_setup[1]; + uint8_t data[255]; +}; + +/* * The following structure defines an USB device. There exists one of * these structures for every USB device. */ struct usb_device { struct usb_clear_stall_msg cs_msg[2]; /* generic clear stall * messages */ - struct sx ctrl_sx; struct sx enum_sx; struct sx sr_sx; struct mtx device_mtx; @@ -192,6 +258,8 @@ struct usb_device { uint32_t clear_stall_errors; /* number of clear-stall failures */ uint16_t autoQuirk[USB_MAX_AUTO_QUIRK]; /* dynamic quirks */ + + union usb_device_scratch scratch; }; /* globals */ @@ -228,7 +296,7 @@ struct usb_endpoint *usb_endpoint_foreac void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); -void usbd_enum_lock(struct usb_device *); +uint8_t usbd_enum_lock(struct usb_device *); void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_generic.c Thu Feb 21 08:21:14 2013 (r247091) @@ -713,13 +713,20 @@ ugen_get_cdesc(struct usb_fifo *f, struc return (error); } +/* + * This function is called having the enumeration SX locked which + * protects the scratch area used. + */ static int ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd) { - void *ptr = f->udev->bus->scratch[0].data; - uint16_t size = sizeof(f->udev->bus->scratch[0].data); + void *ptr; + uint16_t size; int error; + ptr = f->udev->scratch.data; + size = sizeof(f->udev->scratch.data); + if (usbd_req_get_string_desc(f->udev, NULL, ptr, size, ugd->ugd_lang_id, ugd->ugd_string_index)) { error = EINVAL; Modified: stable/8/sys/dev/usb/usb_handle_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_handle_request.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_handle_request.c Thu Feb 21 08:21:14 2013 (r247091) @@ -145,6 +145,7 @@ usb_handle_set_config(struct usb_xfer *x { struct usb_device *udev = xfer->xroot->udev; usb_error_t err = 0; + uint8_t do_unlock; /* * We need to protect against other threads doing probe and @@ -152,7 +153,8 @@ usb_handle_set_config(struct usb_xfer *x */ USB_XFER_UNLOCK(xfer); - usbd_enum_lock(udev); + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); if (conf_no == USB_UNCONFIG_NO) { conf_no = USB_UNCONFIG_INDEX; @@ -175,7 +177,8 @@ usb_handle_set_config(struct usb_xfer *x goto done; } done: - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_XFER_LOCK(xfer); return (err); } @@ -187,13 +190,8 @@ usb_check_alt_setting(struct usb_device uint8_t do_unlock; usb_error_t err = 0; - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); if (alt_index >= usbd_get_no_alts(udev->cdesc, iface->idesc)) err = USB_ERR_INVAL; @@ -222,6 +220,7 @@ usb_handle_iface_request(struct usb_xfer int error; uint8_t iface_index; uint8_t temp_state; + uint8_t do_unlock; if ((req.bmRequestType & 0x1F) == UT_INTERFACE) { iface_index = req.wIndex[0]; /* unicast */ @@ -235,7 +234,8 @@ usb_handle_iface_request(struct usb_xfer */ USB_XFER_UNLOCK(xfer); - usbd_enum_lock(udev); + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); error = ENXIO; @@ -351,17 +351,20 @@ tr_repeat: goto tr_stalled; } tr_valid: - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_XFER_LOCK(xfer); return (0); tr_short: - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_XFER_LOCK(xfer); return (USB_ERR_SHORT_XFER); tr_stalled: - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); USB_XFER_LOCK(xfer); return (USB_ERR_STALLED); } Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_hub.c Thu Feb 21 08:21:14 2013 (r247091) @@ -240,7 +240,9 @@ uhub_explore_sub(struct uhub_softc *sc, /* check if device should be re-enumerated */ if (child->flags.usb_mode == USB_MODE_HOST) { - usbd_enum_lock(child); + uint8_t do_unlock; + + do_unlock = usbd_enum_lock(child); if (child->re_enumerate_wait) { err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); @@ -259,7 +261,8 @@ uhub_explore_sub(struct uhub_softc *sc, child->re_enumerate_wait = 0; err = 0; } - usbd_enum_unlock(child); + if (do_unlock) + usbd_enum_unlock(child); } /* check if probe and attach should be done */ @@ -710,6 +713,7 @@ uhub_explore(struct usb_device *udev) usb_error_t err; uint8_t portno; uint8_t x; + uint8_t do_unlock; hub = udev->hub; sc = hub->hubsoftc; @@ -731,7 +735,7 @@ uhub_explore(struct usb_device *udev) * Make sure we don't race against user-space applications * like LibUSB: */ - usbd_enum_lock(udev); + do_unlock = usbd_enum_lock(udev); for (x = 0; x != hub->nports; x++) { up = hub->ports + x; @@ -811,7 +815,8 @@ uhub_explore(struct usb_device *udev) up->restartcnt = 0; } - usbd_enum_unlock(udev); + if (do_unlock) + usbd_enum_unlock(udev); /* initial status checked */ sc->sc_flags |= UHUB_FLAG_DID_EXPLORE; Modified: stable/8/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_msctest.c Thu Feb 21 08:21:14 2013 (r247091) @@ -500,13 +500,8 @@ bbb_attach(struct usb_device *udev, uint usb_error_t err; uint8_t do_unlock; - /* automatic locking */ - if (usbd_enum_is_locked(udev)) { - do_unlock = 0; - } else { - do_unlock = 1; - usbd_enum_lock(udev); - } + /* Prevent re-enumeration */ + do_unlock = usbd_enum_lock(udev); /* * Make sure any driver which is hooked up to this interface, Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_request.c Thu Feb 21 08:21:14 2013 (r247091) @@ -382,9 +382,8 @@ usbd_get_hr_func(struct usb_device *udev * than 30 seconds is treated like a 30 second timeout. This USB stack * does not allow control requests without a timeout. * - * NOTE: This function is thread safe. All calls to - * "usbd_do_request_flags" will be serialised by the use of an - * internal "sx_lock". + * NOTE: This function is thread safe. All calls to "usbd_do_request_flags" + * will be serialized by the use of the USB device enumeration lock. * * Returns: * 0: Success @@ -408,7 +407,7 @@ usbd_do_request_flags(struct usb_device uint16_t length; uint16_t temp; uint16_t acttemp; - uint8_t enum_locked; + uint8_t do_unlock; if (timeout < 50) { /* timeout is too small */ @@ -420,8 +419,6 @@ usbd_do_request_flags(struct usb_device } length = UGETW(req->wLength); - enum_locked = usbd_enum_is_locked(udev); - DPRINTFN(5, "udev=%p bmRequestType=0x%02x bRequest=0x%02x " "wValue=0x%02x%02x wIndex=0x%02x%02x wLength=0x%02x%02x\n", udev, req->bmRequestType, req->bRequest, @@ -452,17 +449,16 @@ usbd_do_request_flags(struct usb_device } /* - * We need to allow suspend and resume at this point, else the - * control transfer will timeout if the device is suspended! + * Grab the USB device enumeration SX-lock serialization is + * achieved when multiple threads are involved: */ - if (enum_locked) - usbd_sr_unlock(udev); + do_unlock = usbd_enum_lock(udev); /* - * Grab the default sx-lock so that serialisation - * is achieved when multiple threads are involved: + * We need to allow suspend and resume at this point, else the + * control transfer will timeout if the device is suspended! */ - sx_xlock(&udev->ctrl_sx); + usbd_sr_unlock(udev); hr_func = usbd_get_hr_func(udev); @@ -706,10 +702,10 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - sx_xunlock(&udev->ctrl_sx); + usbd_sr_lock(udev); - if (enum_locked) - usbd_sr_lock(udev); + if (do_unlock) + usbd_enum_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) mtx_lock(mtx); Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Thu Feb 21 07:48:07 2013 (r247090) +++ stable/8/sys/dev/usb/usb_transfer.c Thu Feb 21 08:21:14 2013 (r247091) @@ -22,7 +22,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ #include #include @@ -810,20 +810,17 @@ usbd_transfer_setup(struct usb_device *u const struct usb_config *setup_start, uint16_t n_setup, void *priv_sc, struct mtx *xfer_mtx) { - struct usb_xfer dummy; - struct usb_setup_params parm; const struct usb_config *setup_end = setup_start + n_setup; const struct usb_config *setup; + struct usb_setup_params *parm; struct usb_endpoint *ep; struct usb_xfer_root *info; struct usb_xfer *xfer; void *buf = NULL; + usb_error_t error = 0; uint16_t n; uint16_t refcount; - - parm.err = 0; - refcount = 0; - info = NULL; + uint8_t do_unlock; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "usbd_transfer_setup can sleep!"); @@ -842,31 +839,40 @@ usbd_transfer_setup(struct usb_device *u DPRINTFN(6, "using global lock\n"); xfer_mtx = &Giant; } - /* sanity checks */ + + /* more sanity checks */ + for (setup = setup_start, n = 0; setup != setup_end; setup++, n++) { if (setup->bufsize == (usb_frlength_t)-1) { - parm.err = USB_ERR_BAD_BUFSIZE; + error = USB_ERR_BAD_BUFSIZE; DPRINTF("invalid bufsize\n"); } if (setup->callback == NULL) { - parm.err = USB_ERR_NO_CALLBACK; + error = USB_ERR_NO_CALLBACK; DPRINTF("no callback\n"); } ppxfer[n] = NULL; } - if (parm.err) { - goto done; - } - memset(&parm, 0, sizeof(parm)); + if (error) + return (error); + + /* Protect scratch area */ + do_unlock = usbd_enum_lock(udev); - parm.udev = udev; - parm.speed = usbd_get_speed(udev); - parm.hc_max_packet_count = 1; + refcount = 0; + info = NULL; - if (parm.speed >= USB_SPEED_MAX) { - parm.err = USB_ERR_INVAL; + parm = &udev->scratch.xfer_setup[0].parm; + memset(parm, 0, sizeof(*parm)); + + parm->udev = udev; + parm->speed = usbd_get_speed(udev); + parm->hc_max_packet_count = 1; + + if (parm->speed >= USB_SPEED_MAX) { + parm->err = USB_ERR_INVAL; goto done; } /* setup all transfers */ @@ -881,22 +887,22 @@ usbd_transfer_setup(struct usb_device *u info = USB_ADD_BYTES(buf, 0); info->memory_base = buf; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 15:22:55 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C054E405; Thu, 21 Feb 2013 15:22:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B22FACD9; Thu, 21 Feb 2013 15:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LFMtFY065743; Thu, 21 Feb 2013 15:22:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LFMtVs065740; Thu, 21 Feb 2013 15:22:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211522.r1LFMtVs065740@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 15:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247099 - in stable/8/sys/dev: ahci ata ata/chipsets X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 15:22:55 -0000 Author: mav Date: Thu Feb 21 15:22:54 2013 New Revision: 247099 URL: http://svnweb.freebsd.org/changeset/base/247099 Log: MFC r244983 (by jfv): Add Intel Lynx Point PCH SATA Controller Device IDs Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Feb 21 15:21:25 2013 (r247098) +++ stable/8/sys/dev/ahci/ahci.c Thu Feb 21 15:22:54 2013 (r247099) @@ -186,6 +186,14 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x8c028086, 0x00, "Intel Lynx Point", 0}, + {0x8c038086, 0x00, "Intel Lynx Point", 0}, + {0x8c048086, 0x00, "Intel Lynx Point", 0}, + {0x8c058086, 0x00, "Intel Lynx Point", 0}, + {0x8c068086, 0x00, "Intel Lynx Point", 0}, + {0x8c078086, 0x00, "Intel Lynx Point", 0}, + {0x8c0e8086, 0x00, "Intel Lynx Point", 0}, + {0x8c0f8086, 0x00, "Intel Lynx Point", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Thu Feb 21 15:21:25 2013 (r247098) +++ stable/8/sys/dev/ata/ata-pci.h Thu Feb 21 15:22:54 2013 (r247099) @@ -260,6 +260,19 @@ struct ata_pci_controller { #define ATA_PPT_R5 0x1e0e8086 #define ATA_PPT_R6 0x1e0f8086 +#define ATA_LPT_S1 0x8c008086 +#define ATA_LPT_S2 0x8c018086 +#define ATA_LPT_AH1 0x8c028086 +#define ATA_LPT_AH2 0x8c038086 +#define ATA_LPT_R1 0x8c048086 +#define ATA_LPT_R2 0x8c058086 +#define ATA_LPT_R3 0x8c068086 +#define ATA_LPT_R4 0x8c078086 +#define ATA_LPT_S3 0x8c088086 +#define ATA_LPT_S4 0x8c098086 +#define ATA_LPT_R5 0x8c0e8086 +#define ATA_LPT_R6 0x8c0f8086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Thu Feb 21 15:21:25 2013 (r247098) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Thu Feb 21 15:22:54 2013 (r247099) @@ -211,6 +211,18 @@ ata_intel_probe(device_t dev) { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 15:26:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E6FA7BD; Thu, 21 Feb 2013 15:26:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 113B5D12; Thu, 21 Feb 2013 15:26:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LFQQC4066329; Thu, 21 Feb 2013 15:26:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LFQQKM066328; Thu, 21 Feb 2013 15:26:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211526.r1LFQQKM066328@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 15:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247100 - stable/8/sys/dev/ahci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 15:26:27 -0000 Author: mav Date: Thu Feb 21 15:26:26 2013 New Revision: 247100 URL: http://svnweb.freebsd.org/changeset/base/247100 Log: MFC r236242: Add quirk for Marvell based AHCI controller. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Feb 21 15:22:54 2013 (r247099) +++ stable/8/sys/dev/ahci/ahci.c Thu Feb 21 15:26:26 2013 (r247100) @@ -215,6 +215,7 @@ static struct { {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, + {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 17:00:38 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EAE79A; Thu, 21 Feb 2013 17:00:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6890F6EE; Thu, 21 Feb 2013 17:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LH0cCq094615; Thu, 21 Feb 2013 17:00:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LH0cp7094612; Thu, 21 Feb 2013 17:00:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211700.r1LH0cp7094612@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 17:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247105 - in stable/8/sys/cam: ata scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 17:00:38 -0000 Author: mav Date: Thu Feb 21 17:00:37 2013 New Revision: 247105 URL: http://svnweb.freebsd.org/changeset/base/247105 Log: MFC r238379, r238382 (by bruefer): Renamed the kern.cam.da.da_send_ordered sysctl and tunable to kern.cam.da.send_ordered, more in line with the other da sysctls/tunables. Renamed the kern.cam.ada.ada_send_ordered sysctl and tunable to kern.cam.ada.send_ordered, more in line with the other da sysctls/tunables. PR: 169765 Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Thu Feb 21 17:00:35 2013 (r247104) +++ stable/8/sys/cam/ata/ata_da.c Thu Feb 21 17:00:37 2013 (r247105) @@ -471,9 +471,9 @@ TUNABLE_INT("kern.cam.ada.retry_count", SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW, &ada_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, ada_send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW, &ada_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.ada.ada_send_ordered", &ada_send_ordered); +TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered); SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, &ada_spindown_shutdown, 0, "Spin down upon shutdown"); TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Feb 21 17:00:35 2013 (r247104) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Feb 21 17:00:37 2013 (r247105) @@ -873,9 +873,9 @@ TUNABLE_INT("kern.cam.da.retry_count", & SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW, &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout); -SYSCTL_INT(_kern_cam_da, OID_AUTO, da_send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW, &da_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.da.da_send_ordered", &da_send_ordered); +TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered); /* * DA_ORDEREDTAG_INTERVAL determines how often, relative From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 19:23:36 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 266F4930; Thu, 21 Feb 2013 19:23:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0113D319; Thu, 21 Feb 2013 19:23:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJNZQc040450; Thu, 21 Feb 2013 19:23:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LJNZw0040449; Thu, 21 Feb 2013 19:23:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211923.r1LJNZw0040449@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 19:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247118 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 19:23:36 -0000 Author: mav Date: Thu Feb 21 19:23:35 2013 New Revision: 247118 URL: http://svnweb.freebsd.org/changeset/base/247118 Log: MFC r239175: Add missing FAILED event to g_raid_subdisk_event2str() to print it properly in debug messages. Modified: stable/8/sys/geom/raid/g_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Feb 21 19:13:19 2013 (r247117) +++ stable/8/sys/geom/raid/g_raid.c Thu Feb 21 19:23:35 2013 (r247118) @@ -224,6 +224,8 @@ g_raid_subdisk_event2str(int event) switch (event) { case G_RAID_SUBDISK_E_NEW: return ("NEW"); + case G_RAID_SUBDISK_E_FAILED: + return ("FAILED"); case G_RAID_SUBDISK_E_DISCONNECTED: return ("DISCONNECTED"); default: From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 19:35:46 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 766D9D0A; Thu, 21 Feb 2013 19:35:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63EA83E2; Thu, 21 Feb 2013 19:35:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJZkNj043743; Thu, 21 Feb 2013 19:35:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LJZkoj043742; Thu, 21 Feb 2013 19:35:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211935.r1LJZkoj043742@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247119 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 19:35:46 -0000 Author: mav Date: Thu Feb 21 19:35:45 2013 New Revision: 247119 URL: http://svnweb.freebsd.org/changeset/base/247119 Log: MFC r241418: NULL-ify last previously used pointer instead of last possible pointer. This should be only a cosmetic change. Modified: stable/8/sys/geom/raid/md_promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Thu Feb 21 19:23:35 2013 (r247118) +++ stable/8/sys/geom/raid/md_promise.c Thu Feb 21 19:35:45 2013 (r247119) @@ -590,7 +590,7 @@ g_raid_md_promise_purge_disks(struct g_r free(pd->pd_meta[i], M_MD_PROMISE); for (j = i; j < pd->pd_subdisks - 1; j++) pd->pd_meta[j] = pd->pd_meta[j + 1]; - pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL; + pd->pd_meta[pd->pd_subdisks - 1] = NULL; pd->pd_subdisks--; pd->pd_updated = 1; } @@ -695,7 +695,7 @@ g_raid_md_promise_start_disk(struct g_ra free(pd->pd_meta[sdn], M_MD_PROMISE); for (i = sdn; i < pd->pd_subdisks - 1; i++) pd->pd_meta[i] = pd->pd_meta[i + 1]; - pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL; + pd->pd_meta[pd->pd_subdisks - 1] = NULL; pd->pd_subdisks--; } /* If we are in the start process, that's all for now. */ @@ -1144,7 +1144,7 @@ g_raid_md_taste_promise(struct g_raid_md free(metaarr[i], M_MD_PROMISE); for (j = i; j < subdisks - 1; j++) metaarr[i] = metaarr[j + 1]; - metaarr[PROMISE_MAX_SUBDISKS - 1] = NULL; + metaarr[subdisks - 1] = NULL; subdisks--; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 19:44:06 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A4DE228; Thu, 21 Feb 2013 19:44:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCA968A; Thu, 21 Feb 2013 19:44:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJi6KO046615; Thu, 21 Feb 2013 19:44:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LJi5kC046613; Thu, 21 Feb 2013 19:44:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302211944.r1LJi5kC046613@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 19:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247121 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 19:44:06 -0000 Author: mav Date: Thu Feb 21 19:44:05 2013 New Revision: 247121 URL: http://svnweb.freebsd.org/changeset/base/247121 Log: MFC r244980 (by jvf): Add Intel Lynx Point PCH HD Audio Device IDs Modified: stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/sound/pci/hda/hdac.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Thu Feb 21 19:40:46 2013 (r247120) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Thu Feb 21 19:44:05 2013 (r247121) @@ -81,6 +81,8 @@ static const struct { { HDA_INTEL_CPT, "Intel Cougar Point", 0, 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0, 0 }, { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, + { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/8/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.h Thu Feb 21 19:40:46 2013 (r247120) +++ stable/8/sys/dev/sound/pci/hda/hdac.h Thu Feb 21 19:44:05 2013 (r247121) @@ -54,6 +54,8 @@ #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) +#define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) +#define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 20:29:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43A1C79B; Thu, 21 Feb 2013 20:29:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBDF936; Thu, 21 Feb 2013 20:29:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LKTiUh059960; Thu, 21 Feb 2013 20:29:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LKTi0m059959; Thu, 21 Feb 2013 20:29:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302212029.r1LKTi0m059959@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Feb 2013 20:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247125 - stable/8/sys/dev/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 20:29:44 -0000 Author: mav Date: Thu Feb 21 20:29:43 2013 New Revision: 247125 URL: http://svnweb.freebsd.org/changeset/base/247125 Log: MFC r226064 (by wxs): Fix a typo in a comment. Modified: stable/8/sys/dev/ata/ata-all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Thu Feb 21 20:28:42 2013 (r247124) +++ stable/8/sys/dev/ata/ata-all.c Thu Feb 21 20:29:43 2013 (r247125) @@ -868,7 +868,7 @@ ata_boot_attach(void) mtx_lock(&Giant); /* newbus suckage it needs Giant */ - /* kick of probe and attach on all channels */ + /* kick off probe and attach on all channels */ for (ctlr = 0; ctlr < devclass_get_maxunit(ata_devclass); ctlr++) { if ((ch = devclass_get_softc(ata_devclass, ctlr))) { ata_identify(ch->dev); From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 21 22:46:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89FA7189; Thu, 21 Feb 2013 22:46:27 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3D7249; Thu, 21 Feb 2013 22:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LMkRU9003371; Thu, 21 Feb 2013 22:46:27 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LMkRkU003370; Thu, 21 Feb 2013 22:46:27 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201302212246.r1LMkRkU003370@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 21 Feb 2013 22:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247142 - stable/8/contrib/sendmail/src X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 22:46:27 -0000 Author: gshapiro Date: Thu Feb 21 22:46:26 2013 New Revision: 247142 URL: http://svnweb.freebsd.org/changeset/base/247142 Log: MFC: Merge sendmail 8.14.6 errata issue Modified: stable/8/contrib/sendmail/src/milter.c Directory Properties: stable/8/contrib/sendmail/ (props changed) Modified: stable/8/contrib/sendmail/src/milter.c ============================================================================== --- stable/8/contrib/sendmail/src/milter.c Thu Feb 21 22:38:39 2013 (r247141) +++ stable/8/contrib/sendmail/src/milter.c Thu Feb 21 22:46:26 2013 (r247142) @@ -4048,7 +4048,7 @@ milter_helo(helo, e, state) } response = milter_command(SMFIC_HELO, helo, strlen(helo) + 1, - SMFIM_EOH, e, state, "helo", false); + SMFIM_HELO, e, state, "helo", false); milter_per_connection_check(e); return response; }