Changeset 53db806 in mainline


Ignore:
Timestamp:
2017-12-10T22:42:44Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7d957b2
Parents:
889146e
Message:

xhci bus: fix setup of FS device

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    r889146e r53db806  
    180180        }
    181181
    182         fibril_mutex_lock(&bus->base.guard);
    183182        /* Assign an address to the device */
    184183        if ((err = address_device(hc, xhci_dev))) {
     
    187186        }
    188187
     188        /* Setup EP0 might already need to issue a transfer. */
     189        fibril_mutex_lock(&bus->base.guard);
     190        assert(bus->devices_by_slot[xhci_dev->slot_id] == NULL);
     191        bus->devices_by_slot[xhci_dev->slot_id] = xhci_dev;
     192        fibril_mutex_unlock(&bus->base.guard);
     193
    189194        if ((err = setup_ep0_packet_size(hc, xhci_dev))) {
    190195                usb_log_error("Failed to setup control endpoint of the new device: %s", str_error(err));
    191196                goto err_address;
    192197        }
    193 
    194         assert(bus->devices_by_slot[xhci_dev->slot_id] == NULL);
    195         bus->devices_by_slot[xhci_dev->slot_id] = xhci_dev;
    196         fibril_mutex_unlock(&bus->base.guard);
    197198
    198199        /* Read the device descriptor, derive the match ids */
  • uspace/lib/usbhost/src/bus.c

    r889146e r53db806  
    131131        assert(device);
    132132
    133         fibril_mutex_lock(&bus->guard);
    134 
    135133        if (desc->max_packet_size == 0 || desc->packets == 0) {
    136134                usb_log_warning("Invalid endpoint description (mps %zu, %u packets)", desc->max_packet_size, desc->packets);
    137135                return EINVAL;
    138136        }
     137
     138        fibril_mutex_lock(&bus->guard);
    139139
    140140        int err = ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.