From owner-p4-projects@FreeBSD.ORG Thu Jan 22 17:09:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0BF531065670; Thu, 22 Jan 2009 17:09:58 +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 BFC97106564A for ; Thu, 22 Jan 2009 17:09:57 +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 B2B398FC19 for ; Thu, 22 Jan 2009 17:09:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MH9vEE050812 for ; Thu, 22 Jan 2009 17:09:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n0MH9vgq050810 for perforce@freebsd.org; Thu, 22 Jan 2009 17:09:57 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 22 Jan 2009 17:09:57 GMT Message-Id: <200901221709.n0MH9vgq050810@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 156530 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: Thu, 22 Jan 2009 17:09:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=156530 Change 156530 by hselasky@hselasky_laptop001 on 2009/01/22 17:09:44 Improve my UHCI SOF patch. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#24 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#24 (text+ko) ==== @@ -2396,6 +2396,24 @@ else return (USB_ERR_IOERROR); + /* + * Before we do anything, turn on SOF messages on the USB + * BUS. Some USB devices do not cope without them! + */ + if (!(UREAD2(sc, UHCI_CMD) & UHCI_CMD_RS)) { + + DPRINTF("Activating SOFs!\n"); + + UHCICMD(sc, (UHCI_CMD_MAXP | UHCI_CMD_RS)); + + /* wait a little bit */ + if (use_polling) { + DELAY(10000); + } else { + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + } + } + x = URWMASK(UREAD2(sc, port)); UWRITE2(sc, port, x | UHCI_PORTSC_PR); @@ -3321,9 +3339,9 @@ flags = bus->hw_power_state; /* - * WARNING: Some FULL speed USB devices require periodic SOF messages! - * If any USB devices are connected through the UHCI, power - * save will be disabled! + * WARNING: Some FULL speed USB devices require periodic SOF + * messages! If any USB devices are connected through the + * UHCI, power save will be disabled! */ if (flags & (USB_HW_POWER_CONTROL | USB_HW_POWER_NON_ROOT_HUB |