CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2018-08-08 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Aug  9 06:29:08 UTC 2018

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_core.c

Log Message:
One newline is enough.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.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/vchiq/dist/interface/vchiq_arm/vchiq_core.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.12 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.13
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.12	Sun Feb  5 16:05:20 2017
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c	Thu Aug  9 06:29:08 2018
@@ -3123,7 +3123,7 @@ vchiq_pause_internal(VCHIQ_STATE_T *stat
 		break;
 	default:
 		vchiq_log_error(vchiq_core_log_level,
-			"vchiq_pause_internal in state %s\n",
+			"vchiq_pause_internal in state %s",
 			conn_state_names[state->conn_state]);
 		status = VCHIQ_ERROR;
 		VCHIQ_STATS_INC(state, error_count);



CVS commit: src/sys

2018-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  9 06:26:47 UTC 2018

Modified Files:
src/sys/dev/usb: ehci.c ehcivar.h motg.c ohci.c ohcivar.h uhci.c
uhcivar.h usbdi.c usbdivar.h xhci.c xhcivar.h
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
pull across abort fixes from nick-nhusb.  add more abort fixes, using
ideas from Taylor and Nick, and myself.  special thanks to both who
inspired much of the code here, if not wrote it directly.

among other problems, this assert should no longer trigger:

   panic: kernel diagnostic assertion "xfer->ux_state == XFER_ONQU" failed: 
file "/current/src/sys/dev/usb/usbdi.c", line 914

using usbhist i was able to track down my instance of it being related
to userland close() beginning, dropping the sc_lock, and then the usb
softintr completes the transfer normally, and when it is done, the
abort path attempts to re-complete the transfer, and the above assert
is tripped.

changes from nhusb were commited with these logs:
--
Move the struct usb_task to struct usbd_xfer for everyone to use.
--
Set device transfer status to USBD_IN_PROGRESS if start methods succeeds
--
Actually set the transfer status on transfers in ohci_abort_xfer and
the controller is dying
--
Don't supply the lock to callout_halt when polling as it won't be held
--
Improve transfer abort
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--
#ifdef DIAGNOSTIC -> KASSERT and add another KASSERT
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--

additional changes include:
- initialise the usb abort task in the HCI allocx routine, so that it
  can be safely usb_rem_task()'d.
- rework the handling of softintr vs cancellation vs timeout abort based
  upon a scheme from Taylor:
  when completing a transfer normally:
  - if the status is not in progress, it must be cancelled or timed out,
and we should not process this xfer.
  - set the status as normal.
  - unconditionallly callout_stop() and usb_rem_task().  they're safe and
either aren't running, or will run and do nothing.
  - finally call usb_transfer_complete().
  when aborting a transfer:
  - status should be cancelled or timed out.
  - if cancelling, callout_halt and usb_rem_task_wait() to make sure the
timer is either done or cancelled.
  - at this point, the ux_status must not be cancelled or timed out, and
if it is not in progress we're done.
  - set the status.
  - if the controller is dying, just return.
  - perform HCI-specific tasks to abort this xfer.
  - finally call usb_transfer_complete().
  for the timeout and timeout task:
  - if the HCI is not dying, and the ux_status is in progress, then
trigger the usb abort task.
- remove UXFER_ABORTWAIT and UXFER_ABORTING.

tested on:
- multiple PC systems with several types of devices: ugen/UPS, ucom,
  umass with disk, ssd and cdrom backends, kbd, ms, using uhci, ehci
  and xhci.
- erlite3: sd@umass on dwc2.
- sunblade2000: kbd/ms and umass disk on ohci.

untested:
- motg, slhci and ahci.  motg has some portion of the new scheme
  applied, but slhci and ahci require more study.

future work includes pushing a lot of the common abort handling into
usbdi.c and leaving upm_abort() for HC specific tasks, but this change
is pullup-able to netbsd-7 and netbsd-8 as it does not change any
external API, as well as removing over 100 lines of code while adding
over 30 new asserts.

XXX: pullup-7, pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/ehcivar.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.281 -r1.282 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/ohcivar.h
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/usb/uhcivar.h
cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/usb/usbdivar.h
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/xhcivar.h
cvs rdiff -u -r1.51 -r1.52 src/sys/external/bsd/dwc2/dwc2.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.259 src/sys/dev/usb/ehci.c:1.260
--- src/sys/dev/usb/ehci.c:1.259	Wed Jun  6 01:49:09 2018
+++ src/sys/dev/usb/ehci.c	Thu Aug  9 06:26:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.259 2018/06/06 01:49:09 maya Exp $ */
+/*	$NetBSD: ehci.c,v 1.260 2018/08/09 06:26:47 mrg Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.259 2018/06/06 01:49:09 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.260 2018/08/09 06:26:47 mrg Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -412,8 +412,7 @@ ehci_init(ehci_softc_t *sc)
 
 	mut

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

2018-08-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug  8 22:16:49 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_gart.c

Log Message:
Fix ordering of bus_dmamap_sync.

The ordering is:

...
- driver writes to kernel pointer
- sync
- driver triggers device use of newly written data (*)
- sync
- driver writes to kernel pointer
- sync
...

The operation (*) is a DMA write.  Hence the syncs should be:

...
- driver writes to kernel pointer
- bus_dmamap_sync(BUS_DMASYNC_PREWRITE)
- driver triggers device use of newly written data
- bus_dmamap_sync(BUS_DMASYNC_POSTWRITE)
- bus_dmamap_sync(BUS_DMASYNC_PREWRITE)
- driver writes to kernel pointer
- bus_dmamap_sync(BUS_DMASYNC_POSTWRITE)
- bus_dmamap_sync(BUS_DMASYNC_PREWRITE)
...

(Preemptive pullup from my DRM/KMS update branch in Git.)

XXX pullup-7
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.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/radeon/radeon_gart.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.5 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.5	Sat Jul 26 05:45:53 2014
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c	Wed Aug  8 22:16:49 2018
@@ -268,7 +268,7 @@ radeon_gart_pre_update(struct radeon_dev
 
 		bus_dmamap_sync(rdev->ddev->dmat, rdev->gart.rg_table_map,
 		gpu_pgstart*entsize, gpu_npages*entsize,
-		BUS_DMASYNC_PREWRITE);
+		BUS_DMASYNC_POSTWRITE);
 	}
 }
 
@@ -284,7 +284,7 @@ radeon_gart_post_update(struct radeon_de
 
 		bus_dmamap_sync(rdev->ddev->dmat, rdev->gart.rg_table_map,
 		gpu_pgstart*entsize, gpu_npages*entsize,
-		BUS_DMASYNC_POSTWRITE);
+		BUS_DMASYNC_PREWRITE);
 	}
 	radeon_gart_tlb_flush(rdev);
 }



CVS commit: src/distrib/sets/lists/man

2018-08-08 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Aug  8 21:17:46 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi

Log Message:
Adjust set lists better.


To generate a diff of this commit:
cvs rdiff -u -r1.1606 -r1.1607 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1606 src/distrib/sets/lists/man/mi:1.1607
--- src/distrib/sets/lists/man/mi:1.1606	Wed Aug  8 21:15:42 2018
+++ src/distrib/sets/lists/man/mi	Wed Aug  8 21:17:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1606 2018/08/08 21:15:42 maya Exp $
+# $NetBSD: mi,v 1.1607 2018/08/08 21:17:46 maya Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1494,7 +1494,7 @@
 ./usr/share/man/cat4/nside.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nsip.0			man-obsolete		obsolete
 ./usr/share/man/cat4/nsmb.0			man-sys-catman		.cat
-./usr/share/man/cat4/nsp.0			man-obsolete		.cat
+./usr/share/man/cat4/nsp.0			man-obsolete		obsolete
 ./usr/share/man/cat4/nsphy.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nsphyter.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ntwo.0			man-sys-catman		.cat
@@ -4601,7 +4601,7 @@
 ./usr/share/man/html4/nsclpcsio.html		man-sys-htmlman		html
 ./usr/share/man/html4/nside.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsmb.html			man-sys-htmlman		html
-./usr/share/man/html4/nsp.html			man-obsolete		html
+./usr/share/man/html4/nsp.html			man-obsolete		obsolete
 ./usr/share/man/html4/nsphy.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsphyter.html		man-sys-htmlman		html
 ./usr/share/man/html4/ntwo.html			man-sys-htmlman		html
@@ -7566,7 +7566,7 @@
 ./usr/share/man/man4/nside.4			man-sys-man		.man
 ./usr/share/man/man4/nsip.4			man-obsolete		obsolete
 ./usr/share/man/man4/nsmb.4			man-sys-man		.man
-./usr/share/man/man4/nsp.4			man-obsolete		.man
+./usr/share/man/man4/nsp.4			man-obsolete		obsolete
 ./usr/share/man/man4/nsphy.4			man-sys-man		.man
 ./usr/share/man/man4/nsphyter.4			man-sys-man		.man
 ./usr/share/man/man4/ntwo.4			man-sys-man		.man



CVS commit: src

2018-08-08 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Aug  8 21:15:42 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Removed Files:
src/share/man/man4: nsp.4

Log Message:
Remove nsp(4) documentation following the removal of code.


To generate a diff of this commit:
cvs rdiff -u -r1.1605 -r1.1606 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.662 -r1.663 src/share/man/man4/Makefile
cvs rdiff -u -r1.4 -r0 src/share/man/man4/nsp.4

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1605 src/distrib/sets/lists/man/mi:1.1606
--- src/distrib/sets/lists/man/mi:1.1605	Fri Aug  3 06:07:02 2018
+++ src/distrib/sets/lists/man/mi	Wed Aug  8 21:15:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1605 2018/08/03 06:07:02 kamil Exp $
+# $NetBSD: mi,v 1.1606 2018/08/08 21:15:42 maya Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1494,7 +1494,7 @@
 ./usr/share/man/cat4/nside.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nsip.0			man-obsolete		obsolete
 ./usr/share/man/cat4/nsmb.0			man-sys-catman		.cat
-./usr/share/man/cat4/nsp.0			man-sys-catman		.cat
+./usr/share/man/cat4/nsp.0			man-obsolete		.cat
 ./usr/share/man/cat4/nsphy.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nsphyter.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ntwo.0			man-sys-catman		.cat
@@ -4601,7 +4601,7 @@
 ./usr/share/man/html4/nsclpcsio.html		man-sys-htmlman		html
 ./usr/share/man/html4/nside.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsmb.html			man-sys-htmlman		html
-./usr/share/man/html4/nsp.html			man-sys-htmlman		html
+./usr/share/man/html4/nsp.html			man-obsolete		html
 ./usr/share/man/html4/nsphy.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsphyter.html		man-sys-htmlman		html
 ./usr/share/man/html4/ntwo.html			man-sys-htmlman		html
@@ -7566,7 +7566,7 @@
 ./usr/share/man/man4/nside.4			man-sys-man		.man
 ./usr/share/man/man4/nsip.4			man-obsolete		obsolete
 ./usr/share/man/man4/nsmb.4			man-sys-man		.man
-./usr/share/man/man4/nsp.4			man-sys-man		.man
+./usr/share/man/man4/nsp.4			man-obsolete		.man
 ./usr/share/man/man4/nsphy.4			man-sys-man		.man
 ./usr/share/man/man4/nsphyter.4			man-sys-man		.man
 ./usr/share/man/man4/ntwo.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.662 src/share/man/man4/Makefile:1.663
--- src/share/man/man4/Makefile:1.662	Tue Jul 31 19:30:19 2018
+++ src/share/man/man4/Makefile	Wed Aug  8 21:15:41 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.662 2018/07/31 19:30:19 rjs Exp $
+#	$NetBSD: Makefile,v 1.663 2018/08/08 21:15:41 maya Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -43,7 +43,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	micphy.4 midi.4 mii.4 mk48txx.4 mlx.4 mly.4 mpls.4 mpii.4 mpt.4 \
 	mpu.4 mtd.4 mtio.4 msm6242b.4 multicast.4 mvsata.4 \
 	nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 \
-	nsclpcsio.4 nside.4 nsp.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 nsmb.4 \
+	nsclpcsio.4 nside.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 nsmb.4 \
 	nvme.4 \
 	oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 otus.4 \
 	pad.4 pas.4 pcdisplay.4 pcf8563rtc.4 pciide.4 pckbc.4 pckbd.4 pcn.4 \



CVS commit: src/sys/dev/pci

2018-08-08 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Aug  8 21:00:29 UTC 2018

Modified Files:
src/sys/dev/pci: files.pci
Removed Files:
src/sys/dev/pci/n8: Makefile.lkm files.n8 helper.c helper.h license.txt
n8_memory_bsd.c n8_semaphore_bsd.c nsp.c nsp.h nspvar.h
src/sys/dev/pci/n8/QMgr: Makefile QMQueue.c QMQueue.h QMUtil.c QMUtil.h
QMgrInit.c QMgrInit.h RNQueue.c RN_Queue.h
src/sys/dev/pci/n8/common: config.c config.h contextMem.c contextMem.h
displayRegs.c displayRegs.h irq.c irq.h n8_SKSManager.c
n8_daemon_kernel.c n8_driver_main.h n8_driver_parms.h n8_memory.c
n8_memory.h n8_rn_common.h n8_sksInit.c n8_sksInit.h nsp2000_regs.h
nsp_ioctl.c userPool.c userPool.h
src/sys/dev/pci/n8/common/api: Makefile md32_common.h
n8_API_Initialize.c n8_API_Initialize.h n8_buffer.c n8_callback.c
n8_contextM.c n8_cryptographic.c n8_daemon_sks.c n8_dh.c n8_dsa.c
n8_dsa.h n8_event.c n8_hash.c n8_hash.h n8_key_works.c n8_packet.c
n8_packet.h n8_packet_IPSec.c n8_packet_IPSec.h n8_pk_ops.c
n8_precomp_md5.c n8_precomp_md5.h n8_precomp_md5_locl.h
n8_precomp_sha_locl.h n8_precompute.c n8_precompute.h
n8_pub_enums.c n8_request.c n8_rng.c n8_rsa.c n8_rsa.h n8_sks.c
n8_ssltls.c n8_ssltls.h n8_system.c n8_user_util.c n8_util.c
n8_util.h test_case.c
src/sys/dev/pci/n8/common/api/commands: Makefile n8_cb_dh.c n8_cb_dh.h
n8_cb_dsa.c n8_cb_dsa.h n8_cb_ea.c n8_cb_ea.h n8_cb_pk_ops.c
n8_cb_pk_ops.h n8_cb_rsa.c n8_cb_rsa.h
src/sys/dev/pci/n8/include_private: n8_OS_intf.h n8_SKSManager.h
n8_common.h n8_daemon_common.h n8_daemon_sks.h n8_device_info.h
n8_driver_api.h n8_ea_common.h n8_enqueue_common.h n8_key_works.h
n8_malloc_common.h n8_manage_memory.h n8_pk_common.h n8_rand.h
n8_semaphore.h n8_sks.h n8_sks_util.h n8_time.h n8_version.h
nsp_ioctl.h test_case.h
src/sys/dev/pci/n8/include_public: n8_pub_buffer.h n8_pub_common.h
n8_pub_context.h n8_pub_enums.h n8_pub_errors.h n8_pub_hash.h
n8_pub_packet.h n8_pub_pk.h n8_pub_request.h n8_pub_rng.h
n8_pub_service.h n8_pub_sks.h n8_pub_symmetric.h n8_pub_types.h
n8_sdk_config.h
src/sys/dev/pci/n8/memory: n8_manage_memory.c

Log Message:
Remove NetOctave NSP2000 support

This code has bitrotted - it hasn't been adjusted from the old module
framework.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2018/07/10/msg023638.html


To generate a diff of this commit:
cvs rdiff -u -r1.398 -r1.399 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.1 -r0 src/sys/dev/pci/n8/Makefile.lkm \
src/sys/dev/pci/n8/files.n8 src/sys/dev/pci/n8/license.txt \
src/sys/dev/pci/n8/n8_semaphore_bsd.c src/sys/dev/pci/n8/nspvar.h
cvs rdiff -u -r1.2 -r0 src/sys/dev/pci/n8/helper.c src/sys/dev/pci/n8/nsp.h
cvs rdiff -u -r1.3 -r0 src/sys/dev/pci/n8/helper.h
cvs rdiff -u -r1.6 -r0 src/sys/dev/pci/n8/n8_memory_bsd.c
cvs rdiff -u -r1.13 -r0 src/sys/dev/pci/n8/nsp.c
cvs rdiff -u -r1.1 -r0 src/sys/dev/pci/n8/QMgr/Makefile \
src/sys/dev/pci/n8/QMgr/QMQueue.h src/sys/dev/pci/n8/QMgr/QMUtil.c \
src/sys/dev/pci/n8/QMgr/QMUtil.h src/sys/dev/pci/n8/QMgr/QMgrInit.h \
src/sys/dev/pci/n8/QMgr/RN_Queue.h
cvs rdiff -u -r1.2 -r0 src/sys/dev/pci/n8/QMgr/QMQueue.c \
src/sys/dev/pci/n8/QMgr/QMgrInit.c src/sys/dev/pci/n8/QMgr/RNQueue.c
cvs rdiff -u -r1.5 -r0 src/sys/dev/pci/n8/common/config.c
cvs rdiff -u -r1.2 -r0 src/sys/dev/pci/n8/common/config.h \
src/sys/dev/pci/n8/common/n8_SKSManager.c \
src/sys/dev/pci/n8/common/n8_rn_common.h \
src/sys/dev/pci/n8/common/nsp2000_regs.h
cvs rdiff -u -r1.1 -r0 src/sys/dev/pci/n8/common/contextMem.c \
src/sys/dev/pci/n8/common/contextMem.h \
src/sys/dev/pci/n8/common/displayRegs.c \
src/sys/dev/pci/n8/common/displayRegs.h src/sys/dev/pci/n8/common/irq.c \
src/sys/dev/pci/n8/common/irq.h \
src/sys/dev/pci/n8/common/n8_daemon_kernel.c \
src/sys/dev/pci/n8/common/n8_driver_main.h \
src/sys/dev/pci/n8/common/n8_driver_parms.h \
src/sys/dev/pci/n8/common/n8_memory.c \
src/sys/dev/pci/n8/common/n8_memory.h \
src/sys/dev/pci/n8/common/n8_sksInit.c \
src/sys/dev/pci/n8/common/n8_sksInit.h \
src/sys/dev/pci/n8/common/nsp_ioctl.c \
src/sys/dev/pci/n8/common/userPool.c src/sys/dev/pci/n8/common/userPool.h
cvs rdiff -u -r1.1 -r0 src/sys/dev/pci/n8/common/api/Makefile \
src/sys/dev/pci/n8/common/api/md32_common.h \
src/sys/dev/pci/n8/common/api/n8_API_Initialize.c \
src/sys/dev/pci/n8/common/api/n8_API_Initialize.h \
src/sys/dev/pci/n8/common/api/n8_buffer.c \
src/sys/dev/pci/n8/common/api/n8_contextM.c \
src/sys/dev/pci/n8/common/api/n8_cryptographic.c \
src/sys/dev/pci/n8/common/api/n8_dh.c \
src/sys/dev/pci

CVS commit: src/crypto/external/bsd/openssl.old/dist/crypto

2018-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug  8 19:19:36 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl.old/dist/crypto/evp: evp.h
src/crypto/external/bsd/openssl.old/dist/crypto/x509: x509_vfy.h

Log Message:
Add missing functions for racoon2 to compile under netbsd-8
>From Chuck Zmudzinski
XXX: pullup-8 (to openssl not openssl.old)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h

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

Modified files:

Index: src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h
diff -u src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h:1.5 src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h:1.6
--- src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h:1.5	Tue Feb  6 14:58:30 2018
+++ src/crypto/external/bsd/openssl.old/dist/crypto/evp/evp.h	Wed Aug  8 15:19:36 2018
@@ -1559,6 +1559,14 @@ static inline RSA *EVP_PKEY_get0_RSA(EVP
 	return pkey->pkey.rsa;
 }
 
+static inline DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey)
+{
+	if (pkey->type != EVP_PKEY_DSA) {
+		return NULL;
+	}
+	return pkey->pkey.dsa;
+}
+
 #endif
 
 

Index: src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h
diff -u src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h:1.1.1.1 src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h:1.2
--- src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h:1.1.1.1	Sat Feb  3 17:43:48 2018
+++ src/crypto/external/bsd/openssl.old/dist/crypto/x509/x509_vfy.h	Wed Aug  8 15:19:36 2018
@@ -645,6 +645,15 @@ STACK_OF(POLICYQUALINFO) *X509_policy_no
*node);
 const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
  *node);
+#if OPENSSL_API_COMPAT >= 0x1010L
+
+static inline X509 *
+X509_STORE_CTX_get0_cert(X509_STORE_CTX *x)
+{ 
+	return X509_STORE_CTX_get_current_cert(x);
+}
+ 
+#endif
 
 #ifdef  __cplusplus
 }



CVS commit: src/doc

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:05:19 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add driver for ARM GICv3 interrupt controllers.


To generate a diff of this commit:
cvs rdiff -u -r1.2417 -r1.2418 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2417 src/doc/CHANGES:1.2418
--- src/doc/CHANGES:1.2417	Sun Aug  5 13:24:56 2018
+++ src/doc/CHANGES	Wed Aug  8 19:05:19 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2417 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2418 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -192,3 +192,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[kamil 20180803]
 	kUBSan: Added support for micro-UBSan (kernel-UBSan) as KUBSAN.
 		[kamil 20180803]
+	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]



CVS commit: src/sys/arch/arm/fdt

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:03:08 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/fdt: gicv3_fdt.c

Log Message:
Add GICv3 FDT glue


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/gicv3_fdt.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/arch/arm/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.21 src/sys/arch/arm/fdt/files.fdt:1.22
--- src/sys/arch/arm/fdt/files.fdt:1.21	Sun Jul 15 23:48:08 2018
+++ src/sys/arch/arm/fdt/files.fdt	Wed Aug  8 19:03:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.21 2018/07/15 23:48:08 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.22 2018/08/08 19:03:08 jmcneill Exp $
 
 include	"dev/pckbport/files.pckbport"
 
@@ -25,6 +25,9 @@ device  gic: mpcorebus
 attach  gic at fdt with gic_fdt
 filearch/arm/fdt/gic_fdt.c 	gic_fdt
 
+attach	gicvthree at fdt with gicv3_fdt
+file	arch/arm/fdt/gicv3_fdt.c		gicv3_fdt
+
 device  l2cc: mpcorebus
 attach  l2cc at fdt with l2cc_fdt
 filearch/arm/fdt/l2cc_fdt.c 	l2cc_fdt

Added files:

Index: src/sys/arch/arm/fdt/gicv3_fdt.c
diff -u /dev/null src/sys/arch/arm/fdt/gicv3_fdt.c:1.1
--- /dev/null	Wed Aug  8 19:03:09 2018
+++ src/sys/arch/arm/fdt/gicv3_fdt.c	Wed Aug  8 19:03:08 2018
@@ -0,0 +1,354 @@
+/* $NetBSD: gicv3_fdt.c,v 1.1 2018/08/08 19:03:08 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015-2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
+ */
+
+#define	_INTR_PRIVATE
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.1 2018/08/08 19:03:08 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define	GICV3_MAXIRQ	1020
+
+#define	IRQ_PPI(n)	((n) + 16)
+#define	IRQ_SPI(n)	((n) + 32)
+
+struct gicv3_fdt_softc;
+struct gicv3_fdt_irq;
+
+static int	gicv3_fdt_match(device_t, cfdata_t, void *);
+static void	gicv3_fdt_attach(device_t, device_t, void *);
+
+static int	gicv3_fdt_map_registers(struct gicv3_fdt_softc *);
+
+static int	gicv3_fdt_intr(void *);
+
+static void *	gicv3_fdt_establish(device_t, u_int *, int, int,
+		int (*)(void *), void *);
+static void	gicv3_fdt_disestablish(device_t, void *);
+static bool	gicv3_fdt_intrstr(device_t, u_int *, char *, size_t);
+
+struct fdtbus_interrupt_controller_func gicv3_fdt_funcs = {
+	.establish = gicv3_fdt_establish,
+	.disestablish = gicv3_fdt_disestablish,
+	.intrstr = gicv3_fdt_intrstr
+};
+
+struct gicv3_fdt_irqhandler {
+	struct gicv3_fdt_irq	*ih_irq;
+	int			(*ih_fn)(void *);
+	void			*ih_arg;
+	bool			ih_mpsafe;
+	TAILQ_ENTRY(gicv3_fdt_irqhandler) ih_next;
+};
+
+struct gicv3_fdt_irq {
+	struct gicv3_fdt_softc	*intr_sc;
+	void			*intr_ih;
+	void			*intr_arg;
+	int			intr_refcnt;
+	int			intr_ipl;
+	int			intr_level;
+	int			intr_mpsafe;
+	TAILQ_HEAD(, gicv3_fdt_irqhandler) intr_handlers;
+	int			intr_irq;
+};
+
+struct gicv3_fdt_softc {
+	struct gicv3_softc	sc_gic;
+	int			sc_phandle;
+
+	struct gicv3_fdt_irq	*sc_irq[GICV3_MAXIRQ];
+};
+
+CFATTACH_DECL_NEW(gicv3_fdt, sizeof(struct gicv3_fdt_softc),
+	gicv3_fdt_match, gicv3_fdt_attach, NULL, NULL);
+
+static int
+gicv3_fdt_match(device_t parent, cfdata_t cf, void *aux)
+{
+	const char * const compatible[] = {
+		"arm,gic-v3",
+		NULL
+	};
+	struct fdt_attach_args * const faa = aux;
+	const int phandle = faa->faa_phandle;
+
+	return of_match_compatible(phandle, compatible);
+}
+
+static void
+gicv3_fdt_attach(device_t parent, device_t self, void *aux)
+{
+	struct gicv3_fdt_softc 

CVS commit: src/sys/arch/arm/cortex

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:02:28 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: files.cortex
Added Files:
src/sys/arch/arm/cortex: gicv3.c gicv3.h

Log Message:
Add GICv3 support.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/cortex/gicv3.c \
src/sys/arch/arm/cortex/gicv3.h

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

Modified files:

Index: src/sys/arch/arm/cortex/files.cortex
diff -u src/sys/arch/arm/cortex/files.cortex:1.7 src/sys/arch/arm/cortex/files.cortex:1.8
--- src/sys/arch/arm/cortex/files.cortex:1.7	Tue Jun  5 08:03:28 2018
+++ src/sys/arch/arm/cortex/files.cortex	Wed Aug  8 19:02:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.cortex,v 1.7 2018/06/05 08:03:28 hkenken Exp $
+# $NetBSD: files.cortex,v 1.8 2018/08/08 19:02:28 jmcneill Exp $
 
 defflag opt_cpu_in_cksum.h			NEON_IN_CKSUM
 
@@ -16,6 +16,10 @@ device	armgic: pic, pic_splfuncs
 attach	armgic at mpcorebus
 file	arch/arm/cortex/gic.c			armgic
 
+# ARM Generic Interrupt Controller v3+
+device	gicvthree: pic, pic_splfuncs
+file	arch/arm/cortex/gicv3.c			gicvthree
+
 # ARM PL310 L2 Cache Controller(initially on Cortex-A9)
 device	arml2cc
 attach	arml2cc at mpcorebus

Added files:

Index: src/sys/arch/arm/cortex/gicv3.c
diff -u /dev/null src/sys/arch/arm/cortex/gicv3.c:1.1
--- /dev/null	Wed Aug  8 19:02:28 2018
+++ src/sys/arch/arm/cortex/gicv3.c	Wed Aug  8 19:02:28 2018
@@ -0,0 +1,546 @@
+/* $NetBSD: gicv3.c,v 1.1 2018/08/08 19:02:28 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 "opt_multiprocessor.h"
+
+#define	_INTR_PRIVATE
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.1 2018/08/08 19:02:28 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#define	PICTOSOFTC(pic)	\
+	((void *)((uintptr_t)(pic) - offsetof(struct gicv3_softc, sc_pic)))
+
+#define	IPL_TO_PRIORITY(ipl)	((IPL_HIGH - (ipl)) << 4)
+
+static struct gicv3_softc *gicv3_softc;
+
+static inline uint32_t
+gicd_read_4(struct gicv3_softc *sc, bus_size_t reg)
+{
+	return bus_space_read_4(sc->sc_bst, sc->sc_bsh_d, reg);
+}
+
+static inline void
+gicd_write_4(struct gicv3_softc *sc, bus_size_t reg, uint32_t val)
+{
+	bus_space_write_4(sc->sc_bst, sc->sc_bsh_d, reg, val);
+}
+
+static inline void
+gicd_write_8(struct gicv3_softc *sc, bus_size_t reg, uint64_t val)
+{
+	bus_space_write_8(sc->sc_bst, sc->sc_bsh_d, reg, val);
+}
+
+static inline uint32_t
+gicr_read_4(struct gicv3_softc *sc, u_int index, bus_size_t reg)
+{
+	KASSERT(index < sc->sc_bsh_r_count);
+	return bus_space_read_4(sc->sc_bst, sc->sc_bsh_r[index], reg);
+}
+
+static inline void
+gicr_write_4(struct gicv3_softc *sc, u_int index, bus_size_t reg, uint32_t val)
+{
+	KASSERT(index < sc->sc_bsh_r_count);
+	bus_space_write_4(sc->sc_bst, sc->sc_bsh_r[index], reg, val);
+}
+
+static inline uint64_t
+gicr_read_8(struct gicv3_softc *sc, u_int index, bus_size_t reg)
+{
+	KASSERT(index < sc->sc_bsh_r_count);
+	return bus_space_read_8(sc->sc_bst, sc->sc_bsh_r[index], reg);
+}
+
+static inline void
+gicr_write_8(struct gicv3_softc *sc, u_int index, bus_size_t reg, uint64_t val)
+{
+	KASSERT(index < sc->sc_bsh_r_count);
+	bus_space_write_8(sc->sc_bst, sc->sc_bsh_r[index], reg, val);
+}
+
+static void
+gicv3_unblock_irqs(struct pic_softc *pic, size_t irqbase, uint32_t mask)
+{
+	struct gicv3_softc * const sc = PICTOSOFTC(pic);
+	struct cpu_info * const ci = curcpu();
+	const u_int group = irqbase / 32;
+
+	

CVS commit: src/sys/arch/arm/cortex

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:01:55 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic_reg.h

Log Message:
Update for GICv3


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gic_reg.h

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

Modified files:

Index: src/sys/arch/arm/cortex/gic_reg.h
diff -u src/sys/arch/arm/cortex/gic_reg.h:1.6 src/sys/arch/arm/cortex/gic_reg.h:1.7
--- src/sys/arch/arm/cortex/gic_reg.h:1.6	Thu Jun 22 07:02:14 2017
+++ src/sys/arch/arm/cortex/gic_reg.h	Wed Aug  8 19:01:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic_reg.h,v 1.6 2017/06/22 07:02:14 skrll Exp $	*/
+/*	$NetBSD: gic_reg.h,v 1.7 2018/08/08 19:01:54 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -133,11 +133,20 @@
 
 #define	GICD_ITARGETSRn(n)	(0x800+4*(n)) // Interrupt Processor Targets Registers
 #define	GICD_ICFGRn(n)		(0xC00+4*(n)) // Interrupt Configuration Registers
+#define	GICD_IGRPMODRn(n)	(0xD00+4*(n)) // Interrupt Group Modifier Registers
 #define	GICD_NSACRn(n)		(0xE00+4*(n)) // Non-secure Access Control Registers, optional
 #define	GICD_SGIR		0xF00 // Software Generated Interrupt Register
 #define	GICD_CPENDSGIR(n)	(0xF10+4*(n)) // SGI Clear-Pending Registers
 #define	GICD_SPENDSGIR(n)	(0xF20+4*(n)) // SGI Set-Pending Registers
+#define	GICD_IROUTER(n)		(0x6100+8*(n)) // Interrupt Routing Registers
 
+#define	GICD_CTRL_RWP			__BIT(31)	// GICv3
+#define	GICD_CTRL_E1NWF			__BIT(7)	// GICv3
+#define	GICD_CTRL_DS			__BIT(6)	// GICv3
+#define	GICD_CTRL_ARE_NS		__BIT(5)	// GICv3
+#define	GICD_CTRL_ARE_S			__BIT(4)	// GICv3
+#define	GICD_CTRL_EnableGrp1S		__BIT(2)	// GICv3
+#define	GICD_CTRL_EnableGrp1NS		__BIT(1)	// GICv3
 #define	GICD_CTRL_Enable		__BIT(0)
 
 #define	GICD_TYPER_LSPI			__BITS(15,11)
@@ -175,6 +184,61 @@
 #define	GICD_SGIR_NSATT			__BIT(15)
 #define	GICD_SGIR_SGIINTID		__BITS(3,0)
 
+#define	GICD_IROUTER_Aff3		__BITS(39,32)
+#define	GICD_IROUTER_Interrupt_Routing_mode __BIT(31)
+#define	GICD_IROUTER_Aff2		__BITS(23,16)
+#define	GICD_IROUTER_Aff1		__BITS(15,8)
+#define	GICD_IROUTER_Aff0		__BITS(7,0)
+
+#define	GICR_CTRL		0x	// Redistributor Control Register
+#define	GICR_IIDR		0x0004	// Implementor Identification Register
+#define	GICR_TYPER		0x0008	// Redistributor Type Register
+#define	GICR_STATUSR		0x0010	// Error Reporting Status Register, optional
+#define	GICR_WAKER		0x0014	// Redistributor Wake Register
+#define	GICR_SETLPIR		0x0040	// Set LPI Pending Register
+#define	GICR_CLRLPIR		0x0048	// Clear LPI Pending Register
+#define	GICR_PROPBASER		0x0070	// Redistributor Properties Base Address Register
+#define	GICR_PENDBASER		0x0078	// Redistributor LPI Pending Table Base Address Register
+#define	GICR_INVLPIR		0x00A0	// Redistributor Invalidate LPI Register
+#define	GICR_INVALLR		0x00B0	// Redistributor Invalidate All Register
+#define	GICR_SYNCR		0x00C0	// Redistributor Synchronize Register
+
+#define	GICR_IGROUPR0		0x10080	// Interrupt Group Register 0
+#define	GICR_ISENABLER0		0x10100	// Interrupt Set-Enable Register 0
+#define	GICR_ICENABLER0		0x10180	// Interrupt Clear-Enable Register 0
+#define	GICR_ISPENDR0		0x10200	// Interrupt Set-Pend Register 0
+#define	GICR_ICPENDR0		0x10280	// Interrupt Clear-Pend Register 0
+#define	GICR_ISACTIVER0		0x10300	// Interrupt Set-Active Register 0
+#define	GICR_ICACTIVER0		0x10380	// Interrupt Clear-Active Register 0
+#define	GICR_IPRIORITYRn(n)	(0x10400+4*(n)) // Interrupt Priority Registers
+#define	GICR_ICFGRn(n)		(0x10C00+4*(n)) // SGI (0) / PPI (1) Configuration Register
+#define	GICR_IGRPMODR0		0x10D00	// Interrupt Group Modifier Register 0
+#define	GICR_NSACR		0x10E00	// Non-Secure Access Control Register
+
+#define	GICR_CTRL_UWP			__BIT(31)
+#define	GICR_CTRL_DPG1S			__BIT(26)
+#define	GICR_CTRL_DPG1NS		__BIT(25)
+#define	GICR_CTRL_DPG0			__BIT(24)
+#define	GICR_CTRL_RWP			__BIT(3)
+#define	GICR_CTRL_Enable_LPIs		__BIT(0)
+
+#define	GICR_TYPER_Affinity_Value	__BITS(63,32)
+#define	GICR_TYPER_Affinity_Value_Aff3	__BITS(63,56)
+#define	GICR_TYPER_Affinity_Value_Aff2	__BITS(55,48)
+#define	GICR_TYPER_Affinity_Value_Aff1	__BITS(47,40)
+#define	GICR_TYPER_Affinity_Value_Aff0	__BITS(39,32)
+#define	GICR_TYPER_CommonLPIAff		__BITS(25,24)
+#define	GICR_TYPER_Processor_Number	__BITS(23,8)
+#define	GICR_TYPER_DPGS			__BIT(5)
+#define	GICR_TYPER_Last			__BIT(4)
+#define	GICR_TYPER_DirectLPI		__BIT(3)
+#define	GICR_TYPER_VLPIS		__BIT(1)
+#define	GICR_TYPER_PLPIS		__BIT(0)
+
+#define	GICR_WAKER_ChildrenAsleep	__BIT(2)
+#define	GICR_WAKER_ProcessorSleep	__BIT(1)
+
+
 /*
  * GICv1 names
  */



CVS commit: src/sys/arch/aarch64/include

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:01:15 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: cpu.h

Log Message:
Add fields for per-cpu GICv3 state


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/include/cpu.h

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

Modified files:

Index: src/sys/arch/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.5 src/sys/arch/aarch64/include/cpu.h:1.6
--- src/sys/arch/aarch64/include/cpu.h:1.5	Mon Jul 23 22:32:22 2018
+++ src/sys/arch/aarch64/include/cpu.h	Wed Aug  8 19:01:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.5 2018/07/23 22:32:22 ryo Exp $ */
+/* $NetBSD: cpu.h,v 1.6 2018/08/08 19:01:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -78,6 +78,10 @@ struct cpu_info {
 	struct evcnt ci_vfp_reuse;
 	struct evcnt ci_vfp_save;
 	struct evcnt ci_vfp_release;
+
+	/* interrupt controller */
+	u_int ci_gic_redist;	/* GICv3 redistributor index */
+	uint64_t ci_gic_sgir;	/* GICv3 SGIR target */
 };
 
 static inline struct cpu_info *



CVS commit: src/sys/arch/aarch64/include

2018-08-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug  8 19:00:53 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Add GICv3 system registers


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/include/armreg.h

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

Modified files:

Index: src/sys/arch/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.14 src/sys/arch/aarch64/include/armreg.h:1.15
--- src/sys/arch/aarch64/include/armreg.h:1.14	Sun Aug  5 07:49:02 2018
+++ src/sys/arch/aarch64/include/armreg.h	Wed Aug  8 19:00:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.14 2018/08/05 07:49:02 skrll Exp $ */
+/* $NetBSD: armreg.h,v 1.15 2018/08/08 19:00:53 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -66,6 +66,11 @@ reg_##regname##_write(uint64_t __val)			
 
 #define AARCH64REG_WRITEIMM_INLINE(regname)			\
 	AARCH64REG_WRITEIMM_INLINE2(regname, regname)
+
+#define AARCH64REG_READWRITE_INLINE2(regname, regdesc)		\
+	AARCH64REG_READ_INLINE2(regname, regdesc)		\
+	AARCH64REG_WRITE_INLINE2(regname, regdesc)
+
 /*
  * System registers available at EL0 (user)
  */
@@ -951,17 +956,69 @@ AARCH64REG_WRITE_INLINE(cntvct_el0)
 #define	 ID_AA64PFR0_EL1_EL0_64	 	 1
 #define	 ID_AA64PFR0_EL1_EL0_64_32	 2
 
+/*
+ * GICv3 system registers
+ */
+AARCH64REG_READWRITE_INLINE2(icc_sre_el1, s3_0_c12_c12_5)
+AARCH64REG_READWRITE_INLINE2(icc_ctlr_el1, s3_0_c12_c12_4)
+AARCH64REG_READWRITE_INLINE2(icc_pmr_el1, s3_0_c4_c6_0)
+AARCH64REG_READWRITE_INLINE2(icc_bpr0_el1, s3_0_c12_c8_3)
+AARCH64REG_READWRITE_INLINE2(icc_bpr1_el1, s3_0_c12_c12_3)
+AARCH64REG_READWRITE_INLINE2(icc_igrpen0_el1, s3_0_c12_c12_6)
+AARCH64REG_READWRITE_INLINE2(icc_igrpen1_el1, s3_0_c12_c12_7)
+AARCH64REG_READWRITE_INLINE2(icc_eoir0_el1, s3_0_c12_c8_1)
+AARCH64REG_READWRITE_INLINE2(icc_eoir1_el1, s3_0_c12_c12_1)
+AARCH64REG_READWRITE_INLINE2(icc_sgi1r_el1, s3_0_c12_c11_5)
+AARCH64REG_READ_INLINE2(icc_iar1_el1, s3_0_c12_c12_0)
+
 // ICC_SRE_EL1: Interrupt Controller System Register Enable register
-#define	ICC_SRE_EL1_SRE		 __BIT(0)
-#define	ICC_SRE_EL1_DFB		 __BIT(1)
-#define	ICC_SRE_EL1_DIB		 __BIT(2)
-
-// ICC_SRE_EL2: Interrupt Controller System Register Enable register
-#define	ICC_SRE_EL2_SRE		 __BIT(0)
-#define	ICC_SRE_EL2_DFB		 __BIT(1)
-#define	ICC_SRE_EL2_DIB		 __BIT(2)
-#define	ICC_SRE_EL2_EN		 __BIT(3)
+#define	ICC_SRE_EL1_DIB		__BIT(2)
+#define	ICC_SRE_EL1_DFB		__BIT(1)
+#define	ICC_SRE_EL1_SRE		__BIT(0)
+
+// ICC_BPR[01]_EL1: Interrupt Controller Binary Point Register 0/1
+#define	ICC_BPR_EL1_BinaryPoint	__BITS(2,0)
+
+// ICC_CTLR_EL1: Interrupt Controller Control Register
+#define	ICC_CTLR_EL1_A3V	__BIT(15)
+#define	ICC_CTLR_EL1_SEIS	__BIT(14)
+#define	ICC_CTLR_EL1_IDbits	__BITS(13,11)
+#define	ICC_CTLR_EL1_PRIbits	__BITS(10,8)
+#define	ICC_CTLR_EL1_PMHE	__BIT(6)
+#define	ICC_CTLR_EL1_EOImode	__BIT(1)
+#define	ICC_CTLR_EL1_CBPR	__BIT(0)
+
+// ICC_IGRPEN[01]_EL1: Interrupt Controller Interrupt Group 0/1 Enable register
+#define	ICC_IGRPEN_EL1_Enable	__BIT(0)
+
+// ICC_SGI[01]R_EL1: Interrupt Controller Software Generated Interrupt Group 0/1 Register
+#define	ICC_SGIR_EL1_Aff3	__BITS(55,48)
+#define	ICC_SGIR_EL1_IRM	__BIT(40)
+#define	ICC_SGIR_EL1_Aff2	__BITS(39,32)
+#define	ICC_SGIR_EL1_INTID	__BITS(27,24)
+#define	ICC_SGIR_EL1_Aff1	__BITS(23,16)
+#define	ICC_SGIR_EL1_TargetList	__BITS(15,0)
+#define	ICC_SGIR_EL1_Aff	(ICC_SGIR_EL1_Aff3|ICC_SGIR_EL1_Aff2|ICC_SGIR_EL1_Aff1)
+
+// ICC_IAR[01]_EL1: Interrupt Controller Interrupt Acknowledge Register 0/1
+#define	ICC_IAR_INTID		__BITS(23,0)
+#define	ICC_IAR_INTID_SPURIOUS	1023
+
+/*
+ * GICv3 REGISTER ACCESS
+ */
 
+#define	icc_sre_read		reg_icc_sre_el1_read
+#define	icc_sre_write		reg_icc_sre_el1_write
+#define	icc_pmr_write		reg_icc_pmr_el1_write
+#define	icc_bpr0_write		reg_icc_bpr0_el1_write
+#define	icc_bpr1_write		reg_icc_bpr1_el1_write
+#define	icc_ctlr_read		reg_icc_ctlr_el1_read
+#define	icc_ctlr_write		reg_icc_ctlr_el1_write
+#define	icc_igrpen1_write	reg_icc_igrpen1_el1_write
+#define	icc_sgi1r_write		reg_icc_sgi1r_el1_write
+#define	icc_iar1_read		reg_icc_iar1_el1_read
+#define	icc_eoi1r_write		reg_icc_eoir1_el1_write
 
 /*
  * GENERIC TIMER REGISTER ACCESS



CVS commit: [netbsd-8] src/doc

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:37:27 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Tickets #963, #964, #966


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.7 src/doc/CHANGES-8.1:1.1.2.8
--- src/doc/CHANGES-8.1:1.1.2.7	Tue Aug  7 13:40:40 2018
+++ src/doc/CHANGES-8.1	Wed Aug  8 10:37:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.7 2018/08/07 13:40:40 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.8 2018/08/08 10:37:27 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -342,3 +342,45 @@ share/man/man4/ifmedia.4			1.30
 	Add some missing IFM_* entries.
 	[msaitoh, ticket #962]
 
+sys/dev/usb/if_athn_usb.c			1.28,1.29
+sys/dev/usb/if_atu.c1.62,1.63
+sys/dev/usb/if_aue.c1.144,1.145
+sys/dev/usb/if_axe.c1.91,1.92
+sys/dev/usb/if_axen.c1.15,1.16
+sys/dev/usb/if_cue.c1.79,1.80
+sys/dev/usb/if_otus.c1.34,1.35
+sys/dev/usb/if_rum.c1.62,1.63
+sys/dev/usb/if_run.c1.28,1.29
+sys/dev/usb/if_smsc.c1.35,1.36
+sys/dev/usb/if_udav.c1.54,1.55
+sys/dev/usb/if_upgt.c1.21,1.22
+sys/dev/usb/if_ural.c1.56,1.57
+sys/dev/usb/if_url.c1.59,1.60
+sys/dev/usb/if_urtw.c1.16,1.17
+sys/dev/usb/if_urtwn.c1.61,1.63
+sys/dev/usb/if_zyd.c1.49,1.50
+sys/dev/usb/uatp.c1.16,1.17
+sys/dev/usb/umcs.c1.11,1.12
+sys/dev/usb/usb.c1.170,1.171
+sys/dev/usb/usb_subr.c1.225,1.226
+sys/dev/usb/usbdi.h1.93,1.95
+
+	Make usb detach more reliable by using a new
+	function usb_rem_task_wait.
+	[riastradh, ticket #963]
+
+lib/libcurses/addbytes.c			1.48
+
+	Avoid curx going beyond end of window when adding a wide
+	character to the last column.
+	[simonb, ticket #964]
+
+sys/external/bsd/dwc2/dist/dwc2_core.h		1.9
+sys/external/bsd/dwc2/dist/dwc2_hcd.c		1.21
+sys/external/bsd/dwc2/dist/dwc2_hcd.h		1.15
+sys/external/bsd/dwc2/dist/dwc2_hcdintr.c	1.14
+sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c	1.15
+
+	Fix woeful USB disk performance on ERLITE.
+	[simonb, ticket #966]
+



CVS commit: [netbsd-8] src/sys/external/bsd/dwc2/dist

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:36:08 UTC 2018

Modified Files:
src/sys/external/bsd/dwc2/dist [netbsd-8]: dwc2_core.h dwc2_hcd.c
dwc2_hcd.h dwc2_hcdintr.c dwc2_hcdqueue.c

Log Message:
Pull up following revision(s) (requested by simonb in ticket #966):

sys/external/bsd/dwc2/dist/dwc2_core.h: revision 1.9
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: revision 1.15
sys/external/bsd/dwc2/dist/dwc2_hcd.h: revision 1.15
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: revision 1.14
sys/external/bsd/dwc2/dist/dwc2_hcd.c: revision 1.21

Merge
https://github.com/torvalds/linux/commit/38d2b5fb75c15923fb89c32134516a623515bce4
to mitigate USB NAK interrupt storms, with an extra change from
skrll@ to also mitigate interrupt storms on the non-split case with
older DWC2 cores.

Fixes woeful USB disk performance on an ERLITE.

Much thanks to skrll@ for pointer to the above patch, handling the
non-split case and testing.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/external/bsd/dwc2/dist/dwc2_core.h
cvs rdiff -u -r1.19 -r1.19.10.1 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h \
src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c
cvs rdiff -u -r1.13 -r1.13.10.1 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.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/dwc2/dist/dwc2_core.h
diff -u src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.8 src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.8.10.1
--- src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.8	Wed Feb 24 22:17:54 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_core.h	Wed Aug  8 10:36:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_core.h,v 1.8 2016/02/24 22:17:54 skrll Exp $	*/
+/*	$NetBSD: dwc2_core.h,v 1.8.10.1 2018/08/08 10:36:08 martin Exp $	*/
 
 /*
  * core.h - DesignWare HS OTG Controller common declarations
@@ -756,6 +756,7 @@ struct dwc2_hsotg {
 	} flags;
 
 	struct list_head non_periodic_sched_inactive;
+	struct list_head non_periodic_sched_waiting;
 	struct list_head non_periodic_sched_active;
 	struct list_head *non_periodic_qh_ptr;
 	struct list_head periodic_sched_inactive;

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.19 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.19.10.1
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.19	Wed Feb 24 22:17:54 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.c	Wed Aug  8 10:36:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.c,v 1.19 2016/02/24 22:17:54 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.c,v 1.19.10.1 2018/08/08 10:36:08 martin Exp $	*/
 
 /*
  * hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.19 2016/02/24 22:17:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.19.10.1 2018/08/08 10:36:08 martin Exp $");
 
 #include 
 #include 
@@ -117,6 +117,10 @@ static void dwc2_dump_channel_info(struc
 	list_for_each_entry(qh, &hsotg->non_periodic_sched_inactive,
 			qh_list_entry)
 		dev_dbg(hsotg->dev, "%p\n", qh);
+	dev_dbg(hsotg->dev, "  NP waiting sched:\n");
+	list_for_each_entry(qh, &hsotg->non_periodic_sched_waiting,
+			qh_list_entry)
+		dev_dbg(hsotg->dev, "%p\n", qh);
 	dev_dbg(hsotg->dev, "  NP active sched:\n");
 	list_for_each_entry(qh, &hsotg->non_periodic_sched_active,
 			qh_list_entry)
@@ -194,6 +198,7 @@ static void dwc2_qh_list_free(struct dwc
 static void dwc2_kill_all_urbs(struct dwc2_hsotg *hsotg)
 {
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_inactive);
+	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_waiting);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_active);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->periodic_sched_inactive);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->periodic_sched_ready);
@@ -2215,6 +2220,7 @@ static void dwc2_hcd_free(struct dwc2_hs
 
 	/* Free memory for QH/QTD lists */
 	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_inactive);
+	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_waiting);
 	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_active);
 	dwc2_qh_list_free(hsotg, &hsotg->periodic_sched_inactive);
 	dwc2_qh_list_free(hsotg, &hsotg->periodic_sched_ready);
@@ -2337,6 +2343,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hso
 
 	/* Initialize the non-periodic schedule */
 	INIT_LIST_HEAD(&hsotg->non_periodic_sched_inactive);
+	INIT_LIST_HEAD(&hsotg->non_periodic_sched_waiting);
 	INIT_LIST_HEAD(&hsotg->non_periodic_sched_active);
 
 	/* Initialize the periodic schedule */

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.h
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.14 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.14.10.1
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.14	Sat A

CVS commit: [netbsd-8] src/lib/libcurses

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:32:18 UTC 2018

Modified Files:
src/lib/libcurses [netbsd-8]: addbytes.c

Log Message:
Pull up following revision(s) (requested by simonb in ticket #964):

lib/libcurses/addbytes.c: revision 1.48

Avoid curx going beyond end of window when adding a wide character to the
last column.

OK @blymn.
- --


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.47.6.1 src/lib/libcurses/addbytes.c

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

Modified files:

Index: src/lib/libcurses/addbytes.c
diff -u src/lib/libcurses/addbytes.c:1.47 src/lib/libcurses/addbytes.c:1.47.6.1
--- src/lib/libcurses/addbytes.c:1.47	Fri Jan  6 14:25:41 2017
+++ src/lib/libcurses/addbytes.c	Wed Aug  8 10:32:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.47 2017/01/06 14:25:41 roy Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.47.6.1 2018/08/08 10:32:18 martin Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c	8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.47 2017/01/06 14:25:41 roy Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.47.6.1 2018/08/08 10:32:18 martin Exp $");
 #endif
 #endif/* not lint */
 
@@ -582,7 +582,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 		if (newx > *(*lnp)->lastchp)
 			*(*lnp)->lastchp = newx;
 		__touchline(win, *y, sx, (int) win->maxx - 1);
-		win->curx = sx;
+		*x = win->curx = sx;
 	} else {
 		win->curx = *x;
 



CVS commit: [netbsd-8] src/sys/dev/usb

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:28:35 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: if_athn_usb.c if_atu.c if_aue.c if_axe.c
if_axen.c if_cue.c if_otus.c if_rum.c if_run.c if_smsc.c if_udav.c
if_upgt.c if_ural.c if_url.c if_urtw.c if_urtwn.c if_zyd.c uatp.c
umcs.c usb.c usb_subr.c usbdi.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #963):

sys/dev/usb/if_cue.c: revision 1.80
sys/dev/usb/umcs.c: revision 1.11
sys/dev/usb/umcs.c: revision 1.12
sys/dev/usb/if_ural.c: revision 1.56
sys/dev/usb/if_run.c: revision 1.28
sys/dev/usb/if_ural.c: revision 1.57
sys/dev/usb/if_run.c: revision 1.29
sys/dev/usb/uatp.c: revision 1.16
sys/dev/usb/uatp.c: revision 1.17
sys/dev/usb/if_axe.c: revision 1.91
sys/dev/usb/if_axe.c: revision 1.92
sys/dev/usb/if_zyd.c: revision 1.49
sys/dev/usb/if_axen.c: revision 1.15
sys/dev/usb/if_url.c: revision 1.60
sys/dev/usb/if_udav.c: revision 1.54
sys/dev/usb/if_axen.c: revision 1.16
sys/dev/usb/if_udav.c: revision 1.55
sys/dev/usb/if_athn_usb.c: revision 1.28
sys/dev/usb/if_athn_usb.c: revision 1.29
sys/dev/usb/if_urtw.c: revision 1.16
sys/dev/usb/if_urtw.c: revision 1.17
sys/dev/usb/if_cue.c: revision 1.79
sys/dev/usb/if_rum.c: revision 1.62
sys/dev/usb/if_urtwn.c: revision 1.61
sys/dev/usb/if_rum.c: revision 1.63
sys/dev/usb/if_urtwn.c: revision 1.63
sys/dev/usb/usb.c: revision 1.170
sys/dev/usb/usb.c: revision 1.171
sys/dev/usb/if_smsc.c: revision 1.35
sys/dev/usb/if_smsc.c: revision 1.36
sys/dev/usb/if_zyd.c: revision 1.50
sys/dev/usb/if_aue.c: revision 1.144
sys/dev/usb/if_aue.c: revision 1.145
sys/dev/usb/usb_subr.c: revision 1.225
sys/dev/usb/usb_subr.c: revision 1.226
sys/dev/usb/if_upgt.c: revision 1.21
sys/dev/usb/usbdi.h: revision 1.93
sys/dev/usb/if_upgt.c: revision 1.22
sys/dev/usb/if_url.c: revision 1.59
sys/dev/usb/usbdi.h: revision 1.95
sys/dev/usb/if_otus.c: revision 1.34
sys/dev/usb/if_atu.c: revision 1.62
sys/dev/usb/if_otus.c: revision 1.35
sys/dev/usb/if_atu.c: revision 1.63

New function usb_rem_task_wait(dev, task, queue).

If task is scheduled to run, removes it from the queue.  If it may
have already begun to run, waits for it to complete.  Caller must
guarantee it will not switch to another queue.  If caller guarantees
it will not be scheduled again, then usb_rem_task_wait guarantees it
is not running on return.

This will enable us to fix a litany of bugs in detach where we
currently fail to wait for a pending task.

Use usb_rem_task_wait in various drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.2 -r1.22.2.3 src/sys/dev/usb/if_athn_usb.c
cvs rdiff -u -r1.55.8.2 -r1.55.8.3 src/sys/dev/usb/if_atu.c
cvs rdiff -u -r1.141.8.1 -r1.141.8.2 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.82.6.3 -r1.82.6.4 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.11.8.1 -r1.11.8.2 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.76.8.1 -r1.76.8.2 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.31.2.1 -r1.31.2.2 src/sys/dev/usb/if_otus.c
cvs rdiff -u -r1.58.2.1 -r1.58.2.2 src/sys/dev/usb/if_rum.c
cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/dev/usb/if_run.c
cvs rdiff -u -r1.30.8.1 -r1.30.8.2 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.51.8.1 -r1.51.8.2 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.17.8.1 -r1.17.8.2 src/sys/dev/usb/if_upgt.c
cvs rdiff -u -r1.51.8.2 -r1.51.8.3 src/sys/dev/usb/if_ural.c
cvs rdiff -u -r1.56.8.1 -r1.56.8.2 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.13.8.1 -r1.13.8.2 src/sys/dev/usb/if_urtw.c
cvs rdiff -u -r1.53.2.3 -r1.53.2.4 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.44.2.1 -r1.44.2.2 src/sys/dev/usb/if_zyd.c
cvs rdiff -u -r1.14 -r1.14.6.1 src/sys/dev/usb/uatp.c
cvs rdiff -u -r1.10 -r1.10.10.1 src/sys/dev/usb/umcs.c
cvs rdiff -u -r1.165.6.2 -r1.165.6.3 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.220.2.2 -r1.220.2.3 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.92 -r1.92.8.1 src/sys/dev/usb/usbdi.h

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/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.22.2.2 src/sys/dev/usb/if_athn_usb.c:1.22.2.3
--- src/sys/dev/usb/if_athn_usb.c:1.22.2.2	Wed Jan 31 18:01:54 2018
+++ src/sys/dev/usb/if_athn_usb.c	Wed Aug  8 10:28:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.22.2.2 2018/01/31 18:01:54 martin Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.22.2.3 2018/08/08 10:28:35 martin Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.22.2.2 20

CVS commit: [netbsd-7] src/doc

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:18:41 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Ticket #1626


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.100 -r1.1.2.101 src/doc/CHANGES-7.2

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

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.100 src/doc/CHANGES-7.2:1.1.2.101
--- src/doc/CHANGES-7.2:1.1.2.100	Tue Aug  7 16:07:49 2018
+++ src/doc/CHANGES-7.2	Wed Aug  8 10:18:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.100 2018/08/07 16:07:49 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.101 2018/08/08 10:18:41 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5811,3 +5811,30 @@ external/gpl2/gmake/dist/glob/glob.c		1.
 	Fix build failure on Ubuntu 18.04.
 	[nonaka, ticket #1625]
 
+sys/dev/usb/if_athn_usb.c			1.28,1.29
+sys/dev/usb/if_atu.c1.62,1.63
+sys/dev/usb/if_aue.c1.144,1.145
+sys/dev/usb/if_axe.c1.91,1.92
+sys/dev/usb/if_axen.c1.15,1.16
+sys/dev/usb/if_cue.c1.79,1.80
+sys/dev/usb/if_otus.c1.34,1.35
+sys/dev/usb/if_rum.c1.62,1.63
+sys/dev/usb/if_run.c1.28,1.29
+sys/dev/usb/if_smsc.c1.35,1.36
+sys/dev/usb/if_udav.c1.54,1.55
+sys/dev/usb/if_upgt.c1.21,1.22
+sys/dev/usb/if_ural.c1.56,1.57
+sys/dev/usb/if_url.c1.59,1.60
+sys/dev/usb/if_urtw.c1.16,1.17
+sys/dev/usb/if_urtwn.c1.61,1.63
+sys/dev/usb/if_zyd.c1.49,1.50
+sys/dev/usb/uatp.c1.16,1.17
+sys/dev/usb/umcs.c1.11,1.12
+sys/dev/usb/usb.c1.170,1.171
+sys/dev/usb/usb_subr.c1.225,1.226
+sys/dev/usb/usbdi.h1.93,1.95
+
+	Make usb detach more reliable by using a new
+	function usb_rem_task_wait.
+	[riastradh, ticket #1626]
+



CVS commit: [netbsd-7] src/sys/dev/usb

2018-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  8 10:17:11 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: if_athn_usb.c if_atu.c if_aue.c if_axe.c
if_axen.c if_cue.c if_otus.c if_rum.c if_run.c if_smsc.c if_udav.c
if_upgt.c if_ural.c if_url.c if_urtw.c if_urtwn.c if_zyd.c uatp.c
umcs.c usb.c usb_subr.c usbdi.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1626):

sys/dev/usb/if_cue.c: revision 1.80
sys/dev/usb/umcs.c: revision 1.11
sys/dev/usb/umcs.c: revision 1.12
sys/dev/usb/if_ural.c: revision 1.56
sys/dev/usb/if_run.c: revision 1.28
sys/dev/usb/if_ural.c: revision 1.57
sys/dev/usb/if_run.c: revision 1.29
sys/dev/usb/uatp.c: revision 1.16
sys/dev/usb/uatp.c: revision 1.17
sys/dev/usb/if_axe.c: revision 1.91
sys/dev/usb/if_axe.c: revision 1.92
sys/dev/usb/if_zyd.c: revision 1.49
sys/dev/usb/if_axen.c: revision 1.15
sys/dev/usb/if_url.c: revision 1.60
sys/dev/usb/if_udav.c: revision 1.54
sys/dev/usb/if_axen.c: revision 1.16
sys/dev/usb/if_udav.c: revision 1.55
sys/dev/usb/if_athn_usb.c: revision 1.28
sys/dev/usb/if_athn_usb.c: revision 1.29
sys/dev/usb/if_urtw.c: revision 1.16
sys/dev/usb/if_urtw.c: revision 1.17
sys/dev/usb/if_cue.c: revision 1.79
sys/dev/usb/if_rum.c: revision 1.62
sys/dev/usb/if_urtwn.c: revision 1.61
sys/dev/usb/if_rum.c: revision 1.63
sys/dev/usb/if_urtwn.c: revision 1.63
sys/dev/usb/usb.c: revision 1.170
sys/dev/usb/usb.c: revision 1.171
sys/dev/usb/if_smsc.c: revision 1.35
sys/dev/usb/if_smsc.c: revision 1.36
sys/dev/usb/if_zyd.c: revision 1.50
sys/dev/usb/if_aue.c: revision 1.144
sys/dev/usb/if_aue.c: revision 1.145
sys/dev/usb/usb_subr.c: revision 1.225
sys/dev/usb/usb_subr.c: revision 1.226
sys/dev/usb/if_upgt.c: revision 1.21
sys/dev/usb/usbdi.h: revision 1.93
sys/dev/usb/if_upgt.c: revision 1.22
sys/dev/usb/if_url.c: revision 1.59
sys/dev/usb/usbdi.h: revision 1.95
sys/dev/usb/if_otus.c: revision 1.34
sys/dev/usb/if_atu.c: revision 1.62
sys/dev/usb/if_otus.c: revision 1.35
sys/dev/usb/if_atu.c: revision 1.63

New function usb_rem_task_wait(dev, task, queue).

If task is scheduled to run, removes it from the queue.  If it may
have already begun to run, waits for it to complete.  Caller must
guarantee it will not switch to another queue.  If caller guarantees
it will not be scheduled again, then usb_rem_task_wait guarantees it
is not running on return.

This will enable us to fix a litany of bugs in detach where we
currently fail to wait for a pending task.

Use usb_rem_task_wait in various drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.3 -r1.6.6.4 src/sys/dev/usb/if_athn_usb.c
cvs rdiff -u -r1.49.10.2 -r1.49.10.3 src/sys/dev/usb/if_atu.c
cvs rdiff -u -r1.132.2.2 -r1.132.2.3 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.67.2.3 -r1.67.2.4 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.3.2.3 -r1.3.2.4 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.68.2.2 -r1.68.2.3 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.25.4.2 -r1.25.4.3 src/sys/dev/usb/if_otus.c
cvs rdiff -u -r1.48.4.2 -r1.48.4.3 src/sys/dev/usb/if_rum.c
cvs rdiff -u -r1.10.4.3 -r1.10.4.4 src/sys/dev/usb/if_run.c
cvs rdiff -u -r1.19.2.4 -r1.19.2.5 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.43.2.2 -r1.43.2.3 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.12.2.2 -r1.12.2.3 src/sys/dev/usb/if_upgt.c
cvs rdiff -u -r1.44.12.3 -r1.44.12.4 src/sys/dev/usb/if_ural.c
cvs rdiff -u -r1.48.2.2 -r1.48.2.3 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.6.4.2 -r1.6.4.3 src/sys/dev/usb/if_urtw.c
cvs rdiff -u -r1.34.2.4 -r1.34.2.5 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.36.12.2 -r1.36.12.3 src/sys/dev/usb/if_zyd.c
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 src/sys/dev/usb/uatp.c
cvs rdiff -u -r1.7.6.2 -r1.7.6.3 src/sys/dev/usb/umcs.c
cvs rdiff -u -r1.154.2.3 -r1.154.2.4 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.196.4.4 -r1.196.4.5 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.90.2.1 -r1.90.2.2 src/sys/dev/usb/usbdi.h

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/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.6.6.3 src/sys/dev/usb/if_athn_usb.c:1.6.6.4
--- src/sys/dev/usb/if_athn_usb.c:1.6.6.3	Mon Feb 19 19:33:06 2018
+++ src/sys/dev/usb/if_athn_usb.c	Wed Aug  8 10:17:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.6.6.3 2018/02/19 19:33:06 snj Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.6.6.4 2018/08/08 10:17:11 martin Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.6.3 2

CVS commit: src/sys/arch/mips/mips

2018-08-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Aug  8 07:50:12 UTC 2018

Modified Files:
src/sys/arch/mips/mips: cpu_exec.c

Log Message:
Make change of ABI printf()s #ifdef DEBUG_EXEC.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mips/mips/cpu_exec.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/arch/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.65 src/sys/arch/mips/mips/cpu_exec.c:1.66
--- src/sys/arch/mips/mips/cpu_exec.c:1.65	Sun Oct 16 10:57:58 2016
+++ src/sys/arch/mips/mips/cpu_exec.c	Wed Aug  8 07:50:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.65 2016/10/16 10:57:58 maxv Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.66 2018/08/08 07:50:12 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.65 2016/10/16 10:57:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.66 2018/08/08 07:50:12 simonb Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_ultrix.h"
@@ -96,7 +96,9 @@ mips_netbsd_elf32_probe(struct lwp *l, s
 {
 	struct proc * const p = l->l_proc;
 	const Elf32_Ehdr * const eh = eh0;
+#ifdef DEBUG_EXEC
 	int old_abi = p->p_md.md_abi;
+#endif /* DEBUG_EXEC */
 	const char *itp_suffix = NULL;
 
 	/*
@@ -138,8 +140,10 @@ mips_netbsd_elf32_probe(struct lwp *l, s
 	case EF_MIPS_ABI2:
 		itp_suffix = "n32";
 		p->p_md.md_abi = _MIPS_BSD_API_N32;
+#ifdef DEBUG_EXEC
 		if (old_abi != p->p_md.md_abi)
 			printf("pid %d(%s): ABI set to N32 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
+#endif /* DEBUG_EXEC */
 		break;
 #endif
 #ifdef COMPAT_16
@@ -150,9 +154,11 @@ mips_netbsd_elf32_probe(struct lwp *l, s
 	case EF_MIPS_ABI_O32:
 		itp_suffix = "o32";
 		p->p_md.md_abi = _MIPS_BSD_API_O32;
+#ifdef DEBUG_EXEC
 		if (old_abi != p->p_md.md_abi)
 			printf("pid %d(%s): ABI set to O32 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
 		break;
+#endif /* DEBUG_EXEC */
 	default:
 		return ENOEXEC;
 	}
@@ -208,7 +214,9 @@ mips_netbsd_elf64_probe(struct lwp *l, s
 {
 	struct proc * const p = l->l_proc;
 	const Elf64_Ehdr * const eh = eh0;
+#ifdef DEBUG_EXEC
 	int old_abi = p->p_md.md_abi;
+#endif /* DEBUG_EXEC */
 	const char *itp_suffix = NULL;
 
 	switch (eh->e_flags & EF_MIPS_ARCH) {
@@ -247,14 +255,18 @@ mips_netbsd_elf64_probe(struct lwp *l, s
 	case 0:
 		itp_suffix = "64";
 		p->p_md.md_abi = _MIPS_BSD_API_N64;
+#ifdef DEBUG_EXEC
 		if (old_abi != p->p_md.md_abi)
 			printf("pid %d(%s): ABI set to N64 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
+#endif /* DEBUG_EXEC */
 		break;
 	case EF_MIPS_ABI_O64:
 		itp_suffix = "o64";
 		p->p_md.md_abi = _MIPS_BSD_API_O64;
+#ifdef DEBUG_EXEC
 		if (old_abi != p->p_md.md_abi)
 			printf("pid %d(%s): ABI set to O64 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
+#endif /* DEBUG_EXEC */
 		break;
 	default:
 		return ENOEXEC;



CVS commit: src/sys/external/bsd/dwc2/dist

2018-08-08 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Aug  8 07:20:44 UTC 2018

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_core.h dwc2_hcd.c dwc2_hcd.h
dwc2_hcdintr.c dwc2_hcdqueue.c

Log Message:
Merge
https://github.com/torvalds/linux/commit/38d2b5fb75c15923fb89c32134516a623515bce4
to mitigate USB NAK interrupt storms, with an extra change from
skrll@ to also mitigate interrupt storms on the non-split case with
older DWC2 cores.

Fixes woeful USB disk performance on an ERLITE.

Much thanks to skrll@ for pointer to the above patch, handling the
non-split case and testing.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/dwc2/dist/dwc2_core.h
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h \
src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.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/dwc2/dist/dwc2_core.h
diff -u src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.8 src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.9
--- src/sys/external/bsd/dwc2/dist/dwc2_core.h:1.8	Wed Feb 24 22:17:54 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_core.h	Wed Aug  8 07:20:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_core.h,v 1.8 2016/02/24 22:17:54 skrll Exp $	*/
+/*	$NetBSD: dwc2_core.h,v 1.9 2018/08/08 07:20:44 simonb Exp $	*/
 
 /*
  * core.h - DesignWare HS OTG Controller common declarations
@@ -756,6 +756,7 @@ struct dwc2_hsotg {
 	} flags;
 
 	struct list_head non_periodic_sched_inactive;
+	struct list_head non_periodic_sched_waiting;
 	struct list_head non_periodic_sched_active;
 	struct list_head *non_periodic_qh_ptr;
 	struct list_head periodic_sched_inactive;

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.20 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.21
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.c:1.20	Wed Aug  1 16:44:14 2018
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.c	Wed Aug  8 07:20:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.c,v 1.20 2018/08/01 16:44:14 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.c,v 1.21 2018/08/08 07:20:44 simonb Exp $	*/
 
 /*
  * hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.20 2018/08/01 16:44:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.21 2018/08/08 07:20:44 simonb Exp $");
 
 #include 
 #include 
@@ -117,6 +117,10 @@ static void dwc2_dump_channel_info(struc
 	list_for_each_entry(qh, &hsotg->non_periodic_sched_inactive,
 			qh_list_entry)
 		dev_dbg(hsotg->dev, "%p\n", qh);
+	dev_dbg(hsotg->dev, "  NP waiting sched:\n");
+	list_for_each_entry(qh, &hsotg->non_periodic_sched_waiting,
+			qh_list_entry)
+		dev_dbg(hsotg->dev, "%p\n", qh);
 	dev_dbg(hsotg->dev, "  NP active sched:\n");
 	list_for_each_entry(qh, &hsotg->non_periodic_sched_active,
 			qh_list_entry)
@@ -194,6 +198,7 @@ static void dwc2_qh_list_free(struct dwc
 static void dwc2_kill_all_urbs(struct dwc2_hsotg *hsotg)
 {
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_inactive);
+	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_waiting);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->non_periodic_sched_active);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->periodic_sched_inactive);
 	dwc2_kill_urbs_in_qh_list(hsotg, &hsotg->periodic_sched_ready);
@@ -2215,6 +2220,7 @@ static void dwc2_hcd_free(struct dwc2_hs
 
 	/* Free memory for QH/QTD lists */
 	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_inactive);
+	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_waiting);
 	dwc2_qh_list_free(hsotg, &hsotg->non_periodic_sched_active);
 	dwc2_qh_list_free(hsotg, &hsotg->periodic_sched_inactive);
 	dwc2_qh_list_free(hsotg, &hsotg->periodic_sched_ready);
@@ -2337,6 +2343,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hso
 
 	/* Initialize the non-periodic schedule */
 	INIT_LIST_HEAD(&hsotg->non_periodic_sched_inactive);
+	INIT_LIST_HEAD(&hsotg->non_periodic_sched_waiting);
 	INIT_LIST_HEAD(&hsotg->non_periodic_sched_active);
 
 	/* Initialize the periodic schedule */

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcd.h
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.14 src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.15
--- src/sys/external/bsd/dwc2/dist/dwc2_hcd.h:1.14	Sat Apr 23 10:15:30 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcd.h	Wed Aug  8 07:20:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcd.h,v 1.14 2016/04/23 10:15:30 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcd.h,v 1.15 2018/08/08 07:20:44 simonb Exp $	*/
 
 /*
  * hcd.h - DesignWare HS OTG Controller host-mode declarations
@@ -222,6 +222,7 @@ enum dwc2_transaction_type {
 /**
  * struct dwc2_qh - Software queue head structure
  *
+ * @hsotg:  T