CVS commit: src/external/gpl3/gcc

2015-06-25 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jun 25 09:53:33 UTC 2015

Modified Files:
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/alpha: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/arm: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/armeb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earm: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmeb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmhf: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmhfeb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv4: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv4eb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv6: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv6eb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv6hf: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv6hfeb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv7: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv7eb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv7hf: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/earmv7hfeb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/hppa: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/i386: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/m68000: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/m68k: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/mips64eb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/mips64el: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/mipseb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/mipsel: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/powerpc: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/sh3eb: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/sh3el: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/sparc: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/sparc64: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/vax: gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/x86_64: gcov-iov.h
src/external/gpl3/gcc/lib/libiberty/arch/armeb: config.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/alpha: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/arm: c++config.h gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/armeb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm: c++config.h gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmhf: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmhfeb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4eb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6eb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hf: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hfeb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7eb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hf: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hfeb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/hppa: c++config.h gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/i386: c++config.h gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68k: c++config.h gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/mips64eb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/mips64el: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/mipseb: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/mipsel: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc: c++config.h
gstdint.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/sh3eb: c++config.h
gstdint.h

CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2015-06-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Thu Jun 25 16:01:20 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c

Log Message:
fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR.  this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.

fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.30 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.31
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.30	Wed May 13 23:57:02 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Thu Jun 25 16:01:20 2015
@@ -1869,6 +1869,15 @@ out:
 	uvmfault_unlockall(ufi, ufi-entry-aref.ar_amap, uobj);
 	if (ret == -ERESTART)
 		uvm_wait(i915flt);
+
+	/*
+	 * Remap EINTR to success, so that we return to userland.
+	 * On the way out, we'll deliver the signal, and if the signal
+	 * is not fatal then the user code which faulted will most likely
+	 * fault again, and we'll come back here for another try.
+	 */
+	if (ret == -EINTR)
+		ret = 0;
 	/* XXX Deal with GPU hangs here...  */
 	intel_runtime_pm_put(dev_priv);
 	/* XXX errno Linux-NetBSD */



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2015-06-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Thu Jun 25 16:01:20 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c

Log Message:
fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR.  this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.

fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/include/ssp

2015-06-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jun 25 18:41:04 UTC 2015

Modified Files:
src/include/ssp: ssp.h unistd.h

Log Message:
Allow SSP enabled functions to conditionally skip the object size check.
Use this is fix the getcwd(NULL, lmit) case, which breaks in lang/parrot.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/include/ssp/ssp.h
cvs rdiff -u -r1.6 -r1.7 src/include/ssp/unistd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/ssp/ssp.h
diff -u src/include/ssp/ssp.h:1.11 src/include/ssp/ssp.h:1.12
--- src/include/ssp/ssp.h:1.11	Sat May  9 15:41:47 2015
+++ src/include/ssp/ssp.h	Thu Jun 25 18:41:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssp.h,v 1.11 2015/05/09 15:41:47 christos Exp $	*/
+/*	$NetBSD: ssp.h,v 1.12 2015/06/25 18:41:03 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc.
@@ -64,18 +64,19 @@
 #define __ssp_check(buf, len, bos) \
 	if (bos(buf) != (size_t)-1  len  bos(buf)) \
 		__chk_fail()
-#define __ssp_redirect_raw(rtype, fun, symbol, args, call, bos) \
+#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \
 rtype __ssp_real_(fun) args __RENAME(symbol); \
 __ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \
 __ssp_inline rtype fun args { \
-	__ssp_check(__buf, __len, bos); \
+	if (cond) \
+		__ssp_check(__buf, __len, bos); \
 	return __ssp_real_(fun) call; \
 }
 
 #define __ssp_redirect(rtype, fun, args, call) \
-__ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos)
+__ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos)
 #define __ssp_redirect0(rtype, fun, args, call) \
-__ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos0)
+__ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
 
 #define __ssp_overlap(a, b, l) \
 (((a) = (b)  (b) = (a) + (l)) || ((b) = (a)  (a) = (b) + (l)))

Index: src/include/ssp/unistd.h
diff -u src/include/ssp/unistd.h:1.6 src/include/ssp/unistd.h:1.7
--- src/include/ssp/unistd.h:1.6	Wed Jan 26 18:07:44 2011
+++ src/include/ssp/unistd.h	Thu Jun 25 18:41:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.6 2011/01/26 18:07:44 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -42,7 +42,8 @@ __ssp_redirect0(ssize_t, read, (int __fd
 __ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \
 char *__restrict __buf, size_t __len), (__path, __buf, __len));
 
-__ssp_redirect(char *, getcwd, (char *__buf, size_t __len), (__buf, __len));
+__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len),
+(__buf, __len), __buf != 0, __ssp_bos);
 
 __END_DECLS
 



CVS commit: src/include/ssp

2015-06-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jun 25 18:41:04 UTC 2015

Modified Files:
src/include/ssp: ssp.h unistd.h

Log Message:
Allow SSP enabled functions to conditionally skip the object size check.
Use this is fix the getcwd(NULL, lmit) case, which breaks in lang/parrot.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/include/ssp/ssp.h
cvs rdiff -u -r1.6 -r1.7 src/include/ssp/unistd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/xorg/tools/makekeys

2015-06-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jun 26 02:43:26 UTC 2015

Modified Files:
src/external/mit/xorg/tools/makekeys: Makefile

Log Message:
Don't recreate link if clean or cleandir


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/tools/makekeys/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2015-06-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 26 01:16:54 UTC 2015

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
stars[offset] - stars+offset.  It's shorter!

Coincidentally, the change also works around a gcc 5.1 bug which causes
a segmentation fault when trying to compile the longer version (guess
the compiler got exhausted, or something).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66345


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.59 src/sbin/raidctl/raidctl.c:1.60
--- src/sbin/raidctl/raidctl.c:1.59	Wed May 27 17:55:23 2015
+++ src/sbin/raidctl/raidctl.c	Fri Jun 26 01:16:54 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.59 2015/05/27 17:55:23 christos Exp $   */
+/*  $NetBSD: raidctl.c,v 1.60 2015/06/26 01:16:54 pooka Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: raidctl.c,v 1.59 2015/05/27 17:55:23 christos Exp $);
+__RCSID($NetBSD: raidctl.c,v 1.60 2015/06/26 01:16:54 pooka Exp $);
 #endif
 
 
@@ -1097,7 +1097,7 @@ get_bar(char *string, double percent, in
 		(int)((percent * max_strlen)/ 100);
 	if (offset  0)
 		offset = 0;
-	snprintf(string,max_strlen,%s,stars[offset]);
+	snprintf(string,max_strlen,%s,stars+offset);
 }
 
 static void



CVS commit: src/sbin/raidctl

2015-06-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 26 01:16:54 UTC 2015

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
stars[offset] - stars+offset.  It's shorter!

Coincidentally, the change also works around a gcc 5.1 bug which causes
a segmentation fault when trying to compile the longer version (guess
the compiler got exhausted, or something).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66345


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/libc++/dist/libcxxrt/src

2015-06-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 26 00:50:39 UTC 2015

Modified Files:
src/external/bsd/libc++/dist/libcxxrt/src: exception.cc

Log Message:
Fix gcc revision check for __cxa_begin_catch() declaration.

Now it matches what was introduced in upstream commit e426f95.

Fixes PR lib/49990 (libc++ fails to compile with g++ 5.1)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/libc++/dist/libcxxrt/src/exception.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libc++/dist/libcxxrt/src/exception.cc
diff -u src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.1.1.4 src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.2
--- src/external/bsd/libc++/dist/libcxxrt/src/exception.cc:1.1.1.4	Thu May 15 23:56:01 2014
+++ src/external/bsd/libc++/dist/libcxxrt/src/exception.cc	Fri Jun 26 00:50:39 2015
@@ -673,7 +673,7 @@ static _Unwind_Reason_Code trace(struct 
  * If the failure happened by falling off the end of the stack without finding
  * a handler, prints a back trace before aborting.
  */
-#if __GNUC__  3  __GNUC_MINOR__  2
+#if __GNUC__  4 || (__GNUC__ == 4  __GNUC_MINOR__ = 4)
 extern C void *__cxa_begin_catch(void *e) throw();
 #else
 extern C void *__cxa_begin_catch(void *e);
@@ -1189,7 +1189,7 @@ BEGIN_PERSONALITY_FUNCTION(__gxx_persona
  * pointer to the caught exception, which is either the adjusted pointer (for
  * C++ exceptions) of the unadjusted pointer (for foreign exceptions).
  */
-#if __GNUC__  3  __GNUC_MINOR__  2
+#if __GNUC__  4 || (__GNUC__ == 4  __GNUC_MINOR__ = 4)
 extern C void *__cxa_begin_catch(void *e) throw()
 #else
 extern C void *__cxa_begin_catch(void *e)



CVS commit: src/external/bsd/libc++/dist/libcxxrt/src

2015-06-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 26 00:50:39 UTC 2015

Modified Files:
src/external/bsd/libc++/dist/libcxxrt/src: exception.cc

Log Message:
Fix gcc revision check for __cxa_begin_catch() declaration.

Now it matches what was introduced in upstream commit e426f95.

Fixes PR lib/49990 (libc++ fails to compile with g++ 5.1)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/libc++/dist/libcxxrt/src/exception.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libpthread

2015-06-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 26 01:33:09 UTC 2015

Modified Files:
src/lib/libpthread: pthread_types.h

Log Message:
C++ (namely libc++) expects to be using PTHREAD_FOO_INITIALIZER as a
member initializer. This does not work for volatile types. Since C++
does not touch the guts of those types, redefine them as non-volatile.

Fixes libc++ compilation with g++ 5.1, as reported in PR lib/49989.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libpthread/pthread_types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/lib/libpthread

2015-06-25 Thread Antti Kantee
On Fri, Jun 26, 2015 at 01:33:09AM +, Antti Kantee wrote:
 Module Name:  src
 Committed By: pooka
 Date: Fri Jun 26 01:33:09 UTC 2015
 
 Modified Files:
   src/lib/libpthread: pthread_types.h
 
 Log Message:
 C++ (namely libc++) expects to be using PTHREAD_FOO_INITIALIZER as a
 member initializer. This does not work for volatile types. Since C++
 does not touch the guts of those types, redefine them as non-volatile.
 
 Fixes libc++ compilation with g++ 5.1, as reported in PR lib/49989.

Forgot to mention: the patch is from christos (thanks!)


CVS commit: [nick-nhusb] src/sys/dev/usb

2015-06-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jun 25 06:30:13 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
Improve bInterval handling in xhci_configure_endpoint - should help
keyboards.

From t-hash


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.29 -r1.28.2.30 src/sys/dev/usb/xhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.29 src/sys/dev/usb/xhci.c:1.28.2.30
--- src/sys/dev/usb/xhci.c:1.28.2.29	Tue Jun 23 12:22:35 2015
+++ src/sys/dev/usb/xhci.c	Thu Jun 25 06:30:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.29 2015/06/23 12:22:35 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.30 2015/06/25 06:30:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.29 2015/06/23 12:22:35 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.30 2015/06/25 06:30:13 skrll Exp $);
 
 #include opt_usb.h
 
@@ -1250,13 +1250,30 @@ xhci_configure_endpoint(struct usbd_pipe
 
 	switch (xfertype) {
 	case UE_INTERRUPT:
-		/* 6.2.3.6  */
+		if (pipe-up_interval != USBD_DEFAULT_INTERVAL)
+			ival = pipe-up_interval;
+
+		/* xHCI 6.2.3.6 Table 65, USB 2.0 9.6.6 */
 		if (speed == USB_SPEED_LOW || speed == USB_SPEED_FULL) {
-			ival = ival  10 ? 10 : ival;
-			ival = ival  3 ? 3 : ival;
+			int i;
+
+			/*
+			 * round ival down to the nearest base 2 multiple of
+			 * bInterval * 8.
+			 * bInterval is at most 255 as its type is uByte.
+			 * 255(ms) = 2040(x 125us)  2^11, so start with 11.
+			 */
+			for (i = 11; i  0; i--) {
+if ((ival * 8) = (1  i))
+	break;
+			}
+			ival = i;
 		} else {
-			ival = ival  15 ? 15 : ival;
+			/* Interval = bInterval-1 for SS/HS */
+			ival--;
 		}
+		DPRINTFN(4, ival %u, ival, 0, 0, 0);
+
 		if (USB_IS_SS(speed)) {
 			if (maxb  0)
 mps = 1024;
@@ -1279,12 +1296,11 @@ xhci_configure_endpoint(struct usbd_pipe
 		break;
 #ifdef notyet
 	case UE_ISOCHRONOUS:
-		if (speed == USB_SPEED_FULL) {
-			ival = ival  18 ? 18 : ival;
-			ival = ival  3 ? 3 : ival;
-		} else {
-			ival = ival  15 ? 15 : ival;
-		}
+		if (speed == USB_SPEED_FULL)
+			ival += 3; /* 1ms - 125us */
+		ival--;
+		DPRINTFN(4, ival %u, ival, 0, 0, 0);
+
 		if (USB_IS_SS(speed)) {
 			mps = 1024;
 		} else {



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-06-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jun 25 06:30:13 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
Improve bInterval handling in xhci_configure_endpoint - should help
keyboards.

From t-hash


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.29 -r1.28.2.30 src/sys/dev/usb/xhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.