svn commit: r302562 - stable/10/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Mon Jul 11 12:59:24 UTC 2016


Author: hselasky
Date: Mon Jul 11 12:59:23 2016
New Revision: 302562
URL: https://svnweb.freebsd.org/changeset/base/302562

Log:
  MFC r302306:
  Fix detection of USB device disconnects in USB host mode when the USB
  device is connected directly to the USB port of the DWC OTG, in this
  case a RPI-zero.
  
  PR:		210695

Modified:
  stable/10/sys/dev/usb/controller/dwc_otg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/dwc_otg.c
==============================================================================
--- stable/10/sys/dev/usb/controller/dwc_otg.c	Mon Jul 11 12:44:58 2016	(r302561)
+++ stable/10/sys/dev/usb/controller/dwc_otg.c	Mon Jul 11 12:59:23 2016	(r302562)
@@ -2981,7 +2981,8 @@ dwc_otg_interrupt(void *arg)
 		else
 			sc->sc_flags.status_bus_reset = 0;
 
-		if (hprt & HPRT_PRTENCHNG)
+		if ((hprt & HPRT_PRTENCHNG) &&
+		    (hprt & HPRT_PRTENA) == 0)
 			sc->sc_flags.change_enabled = 1;
 
 		if (hprt & HPRT_PRTENA)
@@ -4741,6 +4742,8 @@ tr_handle_get_port_status:
 
 	value = 0;
 
+	if (sc->sc_flags.change_enabled)
+		value |= UPS_C_PORT_ENABLED;
 	if (sc->sc_flags.change_connect)
 		value |= UPS_C_CONNECT_STATUS;
 	if (sc->sc_flags.change_suspend)


More information about the svn-src-stable mailing list