From owner-p4-projects@FreeBSD.ORG Wed Dec 26 12:27:38 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0263F16A419; Wed, 26 Dec 2007 12:27:38 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78DA416A417 for ; Wed, 26 Dec 2007 12:27:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 75C6A13C442 for ; Wed, 26 Dec 2007 12:27:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBQCRbV2015687 for ; Wed, 26 Dec 2007 12:27:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBQCRbV4015684 for perforce@freebsd.org; Wed, 26 Dec 2007 12:27:37 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 26 Dec 2007 12:27:37 GMT Message-Id: <200712261227.lBQCRbV4015684@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 131694 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 12:27:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=131694 Change 131694 by hselasky@hselasky_laptop001 on 2007/12/26 12:27:28 o Improve suspend and resume handling by disabling interrupts we are not waiting for. o It appears that we need to keep the clocks on for as long as there is VBUS. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#7 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#7 (text+ko) ==== @@ -818,6 +818,13 @@ sc->sc_flags.status_suspend = 0; sc->sc_flags.change_suspend = 0; sc->sc_flags.change_connect = 1; + + /* disable resume interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, + AT91_UDP_INT_RXRSM); + /* enable suspend interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IER, + AT91_UDP_INT_RXSUSP); } /* * If RXRSM and RXSUSP is set at the same time we interpret @@ -828,11 +835,26 @@ if (sc->sc_flags.status_suspend) { sc->sc_flags.status_suspend = 0; sc->sc_flags.change_suspend = 1; + + /* disable resume interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, + AT91_UDP_INT_RXRSM); + /* enable suspend interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IER, + AT91_UDP_INT_RXSUSP); } } else if (status & AT91_UDP_INT_RXSUSP) { if (!sc->sc_flags.status_suspend) { sc->sc_flags.status_suspend = 1; sc->sc_flags.change_suspend = 1; + + /* disable suspend interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, + AT91_UDP_INT_RXSUSP); + + /* enable resume interrupt */ + AT91_UDP_WRITE_4(sc, AT91_UDP_IER, + AT91_UDP_INT_RXRSM); } } /* complete root HUB interrupt endpoint */ @@ -2191,11 +2213,7 @@ goto tr_stalled; } if (sc->sc_flags.status_vbus) { - if (sc->sc_flags.status_suspend) { - at9100_dci_clocks_off(sc); - } else { - at9100_dci_clocks_on(sc); - } + at9100_dci_clocks_on(sc); at9100_dci_pull_up(sc); } else { at9100_dci_pull_down(sc);