Name the bus mutex by the controller name, this allows each bus to be

distinguished in lock profiling, etc.
This commit is contained in:
Andrew Thompson 2008-12-23 17:36:25 +00:00
parent 8c639779f4
commit cf4d7cfcc5
9 changed files with 9 additions and 1 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -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);

View file

@ -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);