diff --git a/sys/dev/usb2/controller/at91dci_atmelarm.c b/sys/dev/usb2/controller/at91dci_atmelarm.c index d0772fe0f7f..23de204fc05 100644 --- a/sys/dev/usb2/controller/at91dci_atmelarm.c +++ b/sys/dev/usb2/controller/at91dci_atmelarm.c @@ -147,6 +147,7 @@ at91_udp_attach(device_t dev) /* get all DMA memory */ + sc->sc_dci.sc_bus.parent = dev; if (usb2_bus_mem_alloc_all(&sc->sc_dci.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); diff --git a/sys/dev/usb2/controller/ehci2_pci.c b/sys/dev/usb2/controller/ehci2_pci.c index 41b5c2caf2a..65e4fcefe6e 100644 --- a/sys/dev/usb2/controller/ehci2_pci.c +++ b/sys/dev/usb2/controller/ehci2_pci.c @@ -234,6 +234,7 @@ ehci_pci_attach(device_t self) } /* get all DMA memory */ + sc->sc_bus.parent = self; if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { return ENOMEM; diff --git a/sys/dev/usb2/controller/musb2_otg_atmelarm.c b/sys/dev/usb2/controller/musb2_otg_atmelarm.c index f67de1ed565..de4b58b2f64 100644 --- a/sys/dev/usb2/controller/musb2_otg_atmelarm.c +++ b/sys/dev/usb2/controller/musb2_otg_atmelarm.c @@ -104,6 +104,7 @@ musbotg_attach(device_t dev) /* get all DMA memory */ + sc->sc_otg.sc_bus.parent = dev; if (usb2_bus_mem_alloc_all(&sc->sc_otg.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); diff --git a/sys/dev/usb2/controller/ohci2_atmelarm.c b/sys/dev/usb2/controller/ohci2_atmelarm.c index cd0d3327115..b440f1490d5 100644 --- a/sys/dev/usb2/controller/ohci2_atmelarm.c +++ b/sys/dev/usb2/controller/ohci2_atmelarm.c @@ -75,6 +75,7 @@ ohci_atmelarm_attach(device_t dev) } /* get all DMA memory */ + sc->sc_ohci.sc_bus.parent = dev; if (usb2_bus_mem_alloc_all(&sc->sc_ohci.sc_bus, USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { return ENOMEM; diff --git a/sys/dev/usb2/controller/ohci2_pci.c b/sys/dev/usb2/controller/ohci2_pci.c index fe84e9c0fef..990c8498329 100644 --- a/sys/dev/usb2/controller/ohci2_pci.c +++ b/sys/dev/usb2/controller/ohci2_pci.c @@ -202,6 +202,7 @@ ohci_pci_attach(device_t self) } /* get all DMA memory */ + sc->sc_bus.parent = self; if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &ohci_iterate_hw_softc)) { return ENOMEM; diff --git a/sys/dev/usb2/controller/uhci2_pci.c b/sys/dev/usb2/controller/uhci2_pci.c index 44e0b591de2..9baf42bd1c0 100644 --- a/sys/dev/usb2/controller/uhci2_pci.c +++ b/sys/dev/usb2/controller/uhci2_pci.c @@ -253,6 +253,7 @@ uhci_pci_attach(device_t self) } /* get all DMA memory */ + sc->sc_bus.parent = self; if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &uhci_iterate_hw_softc)) { return ENOMEM; diff --git a/sys/dev/usb2/controller/usb2_bus.h b/sys/dev/usb2/controller/usb2_bus.h index c58c986e7b0..d9dc74ee0f9 100644 --- a/sys/dev/usb2/controller/usb2_bus.h +++ b/sys/dev/usb2/controller/usb2_bus.h @@ -59,6 +59,7 @@ struct usb2_bus { struct usb2_perm perm; struct usb2_xfer_queue intr_q; + device_t parent; device_t bdev; /* filled by HC driver */ struct usb2_dma_parent_tag dma_parent_tag[1]; diff --git a/sys/dev/usb2/controller/usb2_controller.c b/sys/dev/usb2/controller/usb2_controller.c index 7c3ea896e44..5dd517d67d1 100644 --- a/sys/dev/usb2/controller/usb2_controller.c +++ b/sys/dev/usb2/controller/usb2_controller.c @@ -430,7 +430,7 @@ usb2_bus_mem_alloc_all(struct usb2_bus *bus, bus_dma_tag_t dmat, bus->devices_max = USB_MAX_DEVICES; - mtx_init(&bus->bus_mtx, "USB bus lock", + mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), NULL, MTX_DEF | MTX_RECURSE); TAILQ_INIT(&bus->intr_q.head); diff --git a/sys/dev/usb2/controller/uss820dci_atmelarm.c b/sys/dev/usb2/controller/uss820dci_atmelarm.c index 3a1eb16f4c6..8e92ffb4f9e 100644 --- a/sys/dev/usb2/controller/uss820dci_atmelarm.c +++ b/sys/dev/usb2/controller/uss820dci_atmelarm.c @@ -140,6 +140,7 @@ uss820_atmelarm_attach(device_t dev) } /* get all DMA memory */ + sc->sc_bus.parent = dev; if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM);