PERFORCE change 121703 for review

Hans Petter Selasky hselasky at FreeBSD.org
Fri Jun 15 17:23:37 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=121703

Change 121703 by hselasky at hselasky_mini_itx on 2007/06/15 17:23:15

	Poll the interrupt handler one time after attach/resume to
	catch any lost interrupts.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/ehci.c#33 edit
.. //depot/projects/usb/src/sys/dev/usb/ohci.c#27 edit
.. //depot/projects/usb/src/sys/dev/usb/uhci.c#27 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/ehci.c#33 (text+ko) ====

@@ -105,6 +105,7 @@
 
 static usbd_config_td_command_t ehci_root_ctrl_task;
 static void ehci_root_ctrl_task_td(struct ehci_softc *sc, struct thread *ctd);
+static void ehci_do_poll(struct usbd_bus *bus);
 
 #define SC_HW_PHYSADDR(sc,what) \
   ((sc)->sc_hw_page.physaddr +	\
@@ -373,6 +374,11 @@
 
  done:
 	mtx_unlock(&sc->sc_bus.mtx);
+
+	if (!err) {
+	    /* catch any lost interrupts */
+	    ehci_do_poll(&(sc->sc_bus));
+	}
 	return (err);
 }
 
@@ -531,6 +537,10 @@
 	mtx_unlock(&sc->sc_bus.mtx);
 
 	DELAY(1000*USB_RESUME_WAIT);
+
+	/* catch any lost interrupts */
+	ehci_do_poll(&(sc->sc_bus));
+
 	return;
 }
 

==== //depot/projects/usb/src/sys/dev/usb/ohci.c#27 (text+ko) ====

@@ -121,6 +121,7 @@
 
 static usbd_config_td_command_t ohci_root_ctrl_task;
 static void ohci_root_ctrl_task_td(struct ohci_softc *sc, struct thread *ctd);
+static void ohci_do_poll(struct usbd_bus *bus);
 
 #define SC_HW_PHYSADDR(sc,what) \
   ((sc)->sc_hw_page.physaddr + \
@@ -379,6 +380,8 @@
 	else
 	{
 		mtx_unlock(&sc->sc_bus.mtx);
+		/* catch any lost interrupts */
+		ohci_do_poll(&(sc->sc_bus));
 		return (USBD_NORMAL_COMPLETION);
 	}
 }
@@ -475,6 +478,10 @@
 	sc->sc_control = sc->sc_intre = 0;
 
 	mtx_unlock(&sc->sc_bus.mtx);
+
+	/* catch any lost interrupts */
+	ohci_do_poll(&(sc->sc_bus));
+
 	return;
 }
 

==== //depot/projects/usb/src/sys/dev/usb/uhci.c#27 (text+ko) ====

@@ -138,6 +138,7 @@
 
 static usbd_config_td_command_t uhci_root_ctrl_task;
 static void uhci_root_ctrl_task_td(struct uhci_softc *sc, struct thread *ctd);
+static void uhci_do_poll(struct usbd_bus *bus);
 
 void
 uhci_reset(uhci_softc_t *sc)
@@ -439,6 +440,9 @@
 
 	mtx_unlock(&sc->sc_bus.mtx);
 
+	/* catch lost interrupts */
+	uhci_do_poll(&(sc->sc_bus));
+
 	return 0;
 }
 
@@ -503,6 +507,10 @@
 #endif
 
 	mtx_unlock(&sc->sc_bus.mtx);
+
+	/* catch lost interrupts */
+	uhci_do_poll(&(sc->sc_bus));
+
 	return;
 }
 


More information about the p4-projects mailing list