Changes in uspace/srv/devman/driver.c [c3d9aaf5:5aa06ad] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/driver.c
rc3d9aaf5 r5aa06ad 1 1 /* 2 * Copyright (c) 20 25Jiri Svoboda2 * Copyright (c) 2018 Jiri Svoboda 3 3 * Copyright (c) 2010 Lenka Trochtova 4 4 * All rights reserved. … … 284 284 dev->drv = drv; 285 285 dev->passed_to_driver = false; 286 fibril_mutex_lock(&dev->state_lock); 287 dev->state = DEVICE_ATTACHING; 288 fibril_mutex_unlock(&dev->state_lock); 289 fibril_condvar_broadcast(&dev->state_cv); 286 dev->state = DEVICE_NOT_INITIALIZED; 290 287 list_append(&dev->driver_devices, &drv->devices); 291 288 … … 634 631 void add_device(driver_t *drv, dev_node_t *dev, dev_tree_t *tree) 635 632 { 636 link_t *link;637 fun_node_t *fun;638 639 633 /* 640 634 * We do not expect to have driver's mutex locked as we do not … … 670 664 async_wait_for(req, &rc); 671 665 } 672 673 if (rc == EOK) {674 log_msg(LOG_DEFAULT, LVL_DEBUG, "Device was added. Wait for "675 "child functions' devices to stabilize.");676 fibril_rwlock_read_lock(&tree->rwlock);677 link = list_first(&dev->functions);678 while (link != NULL) {679 fun = list_get_instance(link, fun_node_t,680 dev_functions);681 682 if (fun->child != NULL) {683 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Wait for "684 "child device %p.", (void *)fun->child);685 fun_add_ref(fun);686 fibril_rwlock_read_unlock(&tree->rwlock);687 dev_wait_stable(fun->child);688 fibril_rwlock_read_lock(&tree->rwlock);689 fun_del_ref(fun);690 }691 692 link = list_next(link, &dev->functions);693 }694 695 fibril_rwlock_read_unlock(&tree->rwlock);696 log_msg(LOG_DEFAULT, LVL_DEBUG,697 "Finished waiting for children.");698 }699 700 fibril_mutex_lock(&dev->state_lock);701 666 702 667 switch (rc) { … … 712 677 } 713 678 714 fibril_mutex_unlock(&dev->state_lock);715 fibril_condvar_broadcast(&dev->state_cv);716 717 679 dev->passed_to_driver = true; 718 680 }
Note:
See TracChangeset
for help on using the changeset viewer.