Remove the code which disables port status change interrupts for 1 second
authorHasso Tepper <hasso@dragonflybsd.org>
Tue, 10 Jun 2008 10:04:06 +0000 (10:04 +0000)
committerHasso Tepper <hasso@dragonflybsd.org>
Tue, 10 Jun 2008 10:04:06 +0000 (10:04 +0000)
when one occured. It meant that event get lost or delayed until the next
change leaving the port dead under some circumstances.

Obtained-from: NetBSD

sys/bus/usb/ehci.c
sys/bus/usb/ehcivar.h

index 1d448dc..eb968f8 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: ehci.c,v 1.91 2005/02/27 00:27:51 perry Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/ehci.c,v 1.36.2.3 2006/09/24 13:39:04 iedowse Exp $   */
-/*     $DragonFly: src/sys/bus/usb/ehci.c,v 1.34 2008/05/26 12:02:42 mneumann Exp $    */
+/*     $DragonFly: src/sys/bus/usb/ehci.c,v 1.35 2008/06/10 10:04:05 hasso Exp $       */
 
 /*
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -185,8 +185,6 @@ static void         ehci_noop(usbd_pipe_handle pipe);
 
 static int             ehci_str(usb_string_descriptor_t *, int, char *);
 static void            ehci_pcd(ehci_softc_t *, usbd_xfer_handle);
-static void            ehci_pcd_able(ehci_softc_t *, int);
-static void            ehci_pcd_enable(void *);
 static void            ehci_disown(ehci_softc_t *, int, int);
 
 static ehci_soft_qh_t  *ehci_alloc_sqh(ehci_softc_t *);
@@ -467,7 +465,6 @@ ehci_init(ehci_softc_t *sc)
        sc->sc_async_head = sqh;
        EOWRITE4(sc, EHCI_ASYNCLISTADDR, sqh->physaddr | EHCI_LINK_QH);
 
-       callout_init(&sc->sc_tmo_pcd);
        callout_init(&sc->sc_tmo_intrlist);
 
        lockinit(&sc->sc_doorbell_lock, "ehcidb", 0, 0);
@@ -571,13 +568,6 @@ ehci_intr1(ehci_softc_t *sc)
        }
        if (eintrs & EHCI_STS_PCD) {
                ehci_pcd(sc, sc->sc_intrxfer);
-               /*
-                * Disable PCD interrupt for now, because it will be
-                * on until the port has been reset.
-                */
-               ehci_pcd_able(sc, 0);
-               /* Do not allow RHSC interrupts > 1 per second */
-                callout_reset(&sc->sc_tmo_pcd, hz, ehci_pcd_enable, sc);
                eintrs &= ~EHCI_STS_PCD;
        }
 
@@ -594,25 +584,6 @@ ehci_intr1(ehci_softc_t *sc)
        return (1);
 }
 
-void
-ehci_pcd_able(ehci_softc_t *sc, int on)
-{
-       DPRINTFN(4, ("ehci_pcd_able: on=%d\n", on));
-       if (on)
-               sc->sc_eintrs |= EHCI_STS_PCD;
-       else
-               sc->sc_eintrs &= ~EHCI_STS_PCD;
-       EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs);
-}
-
-void
-ehci_pcd_enable(void *v_sc)
-{
-       ehci_softc_t *sc = v_sc;
-
-       ehci_pcd_able(sc, 1);
-}
-
 void
 ehci_pcd(ehci_softc_t *sc, usbd_xfer_handle xfer)
 {
@@ -891,7 +862,6 @@ ehci_detach(struct ehci_softc *sc, int flags)
        EOWRITE4(sc, EHCI_USBCMD, 0);
        EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
        callout_stop(&sc->sc_tmo_intrlist);
-       callout_stop(&sc->sc_tmo_pcd);
 
        usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */
 
@@ -1816,21 +1786,6 @@ ehci_root_ctrl_start(usbd_xfer_handle xfer)
                        err = USBD_IOERROR;
                        goto ret;
                }
-#if 0
-               switch(value) {
-               case UHF_C_PORT_CONNECTION:
-               case UHF_C_PORT_ENABLE:
-               case UHF_C_PORT_SUSPEND:
-               case UHF_C_PORT_OVER_CURRENT:
-               case UHF_C_PORT_RESET:
-                       /* Enable RHSC interrupt if condition is cleared. */
-                       if ((OREAD4(sc, port) >> 16) == 0)
-                               ehci_pcd_able(sc, 1);
-                       break;
-               default:
-                       break;
-               }
-#endif
                break;
        case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
                if ((value & 0xff) != 0) {
index 9f5becc..e7b4218 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/ehcivar.h,v 1.9.2.1 2006/01/26 01:43:13 iedowse Exp $ */
-/*     $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.11 2007/06/30 20:39:22 hasso Exp $    */
+/*     $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.12 2008/06/10 10:04:06 hasso Exp $    */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -144,7 +144,6 @@ typedef struct ehci_softc {
 
        struct lock sc_doorbell_lock;
 
-       struct callout sc_tmo_pcd;
        struct callout sc_tmo_intrlist;
 
        char sc_dying;