Lines Matching full:links
48 /* Device links support. */
138 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_is_dependent()
156 switch (supplier->links.status) { in device_link_init_status()
158 switch (consumer->links.status) { in device_link_init_status()
175 switch (consumer->links.status) { in device_link_init_status()
211 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_reorder_to_tail()
566 list_for_each_entry(link, &supplier->links.consumers, s_node) { in device_link_add()
667 list_add_tail_rcu(&link->s_node, &supplier->links.consumers); in device_link_add()
668 list_add_tail_rcu(&link->c_node, &consumer->links.suppliers); in device_link_add()
708 * The caller is responsible for adding the links to the supplier devices once
710 * wait_for_suppliers list once links to all the suppliers have been created.
719 list_add_tail(&consumer->links.needs_suppliers, &wait_for_suppliers); in device_link_wait_for_supplier()
720 consumer->links.need_for_probe = need_for_probe; in device_link_wait_for_supplier()
735 * device_link_add_missing_supplier_links - Add links from consumer devices to
741 * supplier links. If that succeeds, the consumer device is removed from
746 * added all the supplier links for the consumer device. It should return an
758 links.needs_suppliers) { in device_link_add_missing_supplier_links()
761 list_del_init(&dev->links.needs_suppliers); in device_link_add_missing_supplier_links()
763 dev->links.need_for_probe = false; in device_link_add_missing_supplier_links()
812 * Care is required for hotplugged devices: Their links are purged on removal
840 list_for_each_entry(link, &supplier->links.consumers, s_node) { in device_link_remove()
855 list_for_each_entry(link, &dev->links.suppliers, c_node) { in device_links_missing_supplier()
859 if (link->supplier->links.status == DL_DEV_DRIVER_BOUND) { in device_links_missing_supplier()
872 * Check links from this device to any suppliers. Walk the list of the device's
873 * links to suppliers and see if all of them are available. If not, simply
878 * that function checks the device's links to consumers. This means we need to
882 * Links without the DL_FLAG_MANAGED flag set are ignored.
894 if (!list_empty(&dev->links.needs_suppliers) && in device_links_check_suppliers()
895 dev->links.need_for_probe) { in device_links_check_suppliers()
903 list_for_each_entry(link, &dev->links.suppliers, c_node) { in device_links_check_suppliers()
915 dev->links.status = DL_DEV_PROBING; in device_links_check_suppliers()
926 * Queues a device for a sync_state() callback when the device links write lock
927 * isn't held. This allows the sync_state() execution flow to use device links
949 list_for_each_entry(link, &dev->links.consumers, s_node) { in __device_links_queue_sync_state()
963 if (WARN_ON(!list_empty(&dev->links.defer_hook))) in __device_links_queue_sync_state()
967 list_add_tail(&dev->links.defer_hook, list); in __device_links_queue_sync_state()
985 list_for_each_entry_safe(dev, tmp, list, links.defer_hook) { in device_links_flush_sync_list()
986 list_del_init(&dev->links.defer_hook); in device_links_flush_sync_list()
1024 list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_hook) { in device_links_supplier_sync_state_resume()
1029 list_del_init(&dev->links.defer_hook); in device_links_supplier_sync_state_resume()
1047 if (list_empty(&sup->links.defer_hook) && dev_has_sync_state(sup)) in __device_links_supplier_defer_sync()
1048 list_add_tail(&sup->links.defer_hook, &deferred_sync); in __device_links_supplier_defer_sync()
1066 val = !list_empty(&dev->links.needs_suppliers) in waiting_for_supplier_show()
1067 && dev->links.need_for_probe; in waiting_for_supplier_show()
1075 * device_links_driver_bound - Update device links after probing its driver.
1076 * @dev: Device to update the links for.
1078 * The probe has been successful, so update links from this device to any
1081 * Also change the status of @dev's links to suppliers to "active".
1083 * Links without the DL_FLAG_MANAGED flag set are ignored.
1092 * the device links it needs to or make new device links as it needs in device_links_driver_bound()
1096 list_del_init(&dev->links.needs_suppliers); in device_links_driver_bound()
1102 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_links_driver_bound()
1107 * Links created during consumer probe may be in the "consumer in device_links_driver_bound()
1128 list_for_each_entry_safe(link, ln, &dev->links.suppliers, c_node) { in device_links_driver_bound()
1159 dev->links.status = DL_DEV_DRIVER_BOUND; in device_links_driver_bound()
1167 * __device_links_no_driver - Update links of a device without a driver.
1170 * Delete all non-persistent links from this device to any suppliers.
1172 * Persistent links stay around, but their status is changed to "available",
1176 * Links without the DL_FLAG_MANAGED flag set are ignored.
1182 list_for_each_entry_safe_reverse(link, ln, &dev->links.suppliers, c_node) { in __device_links_no_driver()
1195 if (link->supplier->links.status == DL_DEV_DRIVER_BOUND) { in __device_links_no_driver()
1203 dev->links.status = DL_DEV_NO_DRIVER; in __device_links_no_driver()
1207 * device_links_no_driver - Update links after failing driver probe.
1210 * Clean up leftover links to consumers for @dev and invoke
1211 * %__device_links_no_driver() to update links to suppliers for it as
1214 * Links without the DL_FLAG_MANAGED flag set are ignored.
1222 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_links_no_driver()
1244 * device_links_driver_cleanup - Update links after driver removal.
1247 * Update links to consumers for @dev by changing their status to "dormant" and
1248 * invoke %__device_links_no_driver() to update links to suppliers for it as
1251 * Links without the DL_FLAG_MANAGED flag set are ignored.
1259 list_for_each_entry_safe(link, ln, &dev->links.consumers, s_node) { in device_links_driver_cleanup()
1267 * autoremove the links between this @dev and its consumer in device_links_driver_cleanup()
1278 list_del_init(&dev->links.defer_hook); in device_links_driver_cleanup()
1285 * device_links_busy - Check if there are any busy links to consumers.
1296 * Links without the DL_FLAG_MANAGED flag set are ignored.
1305 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_links_busy()
1317 dev->links.status = DL_DEV_UNBINDING; in device_links_busy()
1327 * Walk the list of links to consumers for @dev and if any of them is in the
1336 * Links without the DL_FLAG_MANAGED flag set are ignored.
1345 list_for_each_entry(link, &dev->links.consumers, s_node) { in device_links_unbind_consumers()
1378 * device_links_purge - Delete existing links to other devices.
1389 list_del(&dev->links.needs_suppliers); in device_links_purge()
1393 * Delete all of the remaining links from this device to any other in device_links_purge()
1398 list_for_each_entry_safe_reverse(link, ln, &dev->links.suppliers, c_node) { in device_links_purge()
1403 list_for_each_entry_safe_reverse(link, ln, &dev->links.consumers, s_node) { in device_links_purge()
1478 list_add_tail(&dev->links.defer_hook, &deferred_fw_devlink); in fw_devlink_link_device()
1491 * fw_devlink_pause - Pause parsing of fwnode to create device links
1493 * Calling this function defers any fwnode parsing to create device links until
1499 * links.
1540 /** fw_devlink_resume - Resume parsing of fwnode to create device links
1570 list_for_each_entry_safe(dev, tmp, &probe_list, links.defer_hook) { in fw_devlink_resume()
1571 list_del_init(&dev->links.defer_hook); in fw_devlink_resume()
1575 /* Device links support end. */
2428 INIT_LIST_HEAD(&dev->links.consumers); in device_initialize()
2429 INIT_LIST_HEAD(&dev->links.suppliers); in device_initialize()
2430 INIT_LIST_HEAD(&dev->links.needs_suppliers); in device_initialize()
2431 INIT_LIST_HEAD(&dev->links.defer_hook); in device_initialize()
2432 dev->links.status = DL_DEV_NO_DRIVER; in device_initialize()