From owner-p4-projects@FreeBSD.ORG Sun Dec 2 12:43:39 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E9A3D16A421; Sun, 2 Dec 2007 12:43: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 77BAF16A419 for ; Sun, 2 Dec 2007 12:43:38 +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 6933F13C4D3 for ; Sun, 2 Dec 2007 12:43:38 +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 lB2ChcEG062195 for ; Sun, 2 Dec 2007 12:43:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lB2ChcQR062192 for perforce@freebsd.org; Sun, 2 Dec 2007 12:43:38 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 2 Dec 2007 12:43:38 GMT Message-Id: <200712021243.lB2ChcQR062192@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 130004 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: Sun, 02 Dec 2007 12:43:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=130004 Change 130004 by hselasky@hselasky_laptop001 on 2007/12/02 12:43:01 Factor out initialization and destruction of the USB lock. Affected files ... .. //depot/projects/usb/src/sys/arm/at91/ohci_atmelarm.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/ehci_pci.c#28 edit .. //depot/projects/usb/src/sys/dev/usb/ohci_pci.c#28 edit .. //depot/projects/usb/src/sys/dev/usb/uhci_pci.c#27 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#63 edit Differences ... ==== //depot/projects/usb/src/sys/arm/at91/ohci_atmelarm.c#10 (text) ==== @@ -84,9 +84,6 @@ sc->iclk = at91_pmc_clock_ref("ohci_clk"); sc->fclk = at91_pmc_clock_ref("uhpck"); - mtx_init(&(sc->sc_ohci.sc_bus.mtx), "usb lock", - NULL, MTX_DEF | MTX_RECURSE); - sc->sc_ohci.sc_dev = dev; rid = MEM_RID; @@ -204,8 +201,6 @@ usbd_bus_mem_free_all(&(sc->sc_bus), &ohci_iterate_hw_softc); - mtx_destroy(&(sc->sc_ohci.sc_bus.mtx)); - return (0); } ==== //depot/projects/usb/src/sys/dev/usb/ehci_pci.c#28 (text+ko) ==== @@ -224,9 +224,6 @@ if (usbd_bus_mem_alloc_all(&(sc->sc_bus), &ehci_iterate_hw_softc)) { return ENOMEM; } - mtx_init(&sc->sc_bus.mtx, "usb lock", - NULL, MTX_DEF | MTX_RECURSE); - sc->sc_dev = self; pci_enable_busmaster(self); @@ -407,8 +404,6 @@ usbd_bus_mem_free_all(&(sc->sc_bus), &ehci_iterate_hw_softc); - mtx_destroy(&sc->sc_bus.mtx); - return (0); } ==== //depot/projects/usb/src/sys/dev/usb/ohci_pci.c#28 (text+ko) ==== @@ -205,9 +205,6 @@ if (usbd_bus_mem_alloc_all(&(sc->sc_bus), &ohci_iterate_hw_softc)) { return ENOMEM; } - mtx_init(&sc->sc_bus.mtx, "usb lock", - NULL, MTX_DEF | MTX_RECURSE); - sc->sc_dev = self; pci_enable_busmaster(self); @@ -364,8 +361,6 @@ usbd_bus_mem_free_all(&(sc->sc_bus), &ohci_iterate_hw_softc); - mtx_destroy(&sc->sc_bus.mtx); - return (0); } ==== //depot/projects/usb/src/sys/dev/usb/uhci_pci.c#27 (text+ko) ==== @@ -221,9 +221,6 @@ if (usbd_bus_mem_alloc_all(&(sc->sc_bus), &uhci_iterate_hw_softc)) { return ENOMEM; } - mtx_init(&sc->sc_bus.mtx, "usb lock", - NULL, MTX_DEF | MTX_RECURSE); - sc->sc_dev = self; pci_enable_busmaster(self); @@ -390,8 +387,6 @@ usbd_bus_mem_free_all(&(sc->sc_bus), &uhci_iterate_hw_softc); - mtx_destroy(&sc->sc_bus.mtx); - return (0); } ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#63 (text+ko) ==== @@ -2922,6 +2922,9 @@ { bus->alloc_failed = 0; + mtx_init(&(bus->mtx), "USB lock", + NULL, MTX_DEF | MTX_RECURSE); + cb(bus, &usbd_bus_mem_alloc_all_cb); if (bus->alloc_failed) { @@ -2951,6 +2954,8 @@ usbd_dma_tag_unsetup(bus->dma_tags, USB_BUS_DMA_TAG_MAX); + mtx_destroy(&(bus->mtx)); + return; }