Lines Matching +full:smem +full:- +full:states

1 // SPDX-License-Identifier: GPL-2.0
4 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
19 #include <linux/soc/qcom/smem.h>
27 * The Qualcomm Shared Memory communication solution provides point-to-point
38 * ring buffer items from the smem heap and populate the allocation table. An
75 * This lists the various smem heap items relevant for the allocation table and
96 * struct qcom_smd_edge - representing a remote processor
111 * @smem_available: last available amount of smem triggering a channel scan
148 * SMD channel states.
177 * struct qcom_smd_channel - smd channel struct
232 * Format of the smd_info smem items, for byte aligned channels.
254 * Format of the smd_info smem items, for word aligned channels.
277 BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u8)); \
278 channel->info_word ? \
279 le32_to_cpu(channel->info_word->rx.param) : \
280 channel->info->rx.param; \
285 BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u32)); \
286 le32_to_cpu(channel->info_word ? \
287 channel->info_word->rx.param : \
288 channel->info->rx.param); \
293 BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u8)); \
294 if (channel->info_word) \
295 channel->info_word->rx.param = cpu_to_le32(value); \
297 channel->info->rx.param = value; \
302 BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u32)); \
303 if (channel->info_word) \
304 channel->info_word->rx.param = cpu_to_le32(value); \
306 channel->info->rx.param = cpu_to_le32(value); \
311 BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u8)); \
312 channel->info_word ? \
313 le32_to_cpu(channel->info_word->tx.param) : \
314 channel->info->tx.param; \
319 BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u32)); \
320 le32_to_cpu(channel->info_word ? \
321 channel->info_word->tx.param : \
322 channel->info->tx.param); \
327 BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u8)); \
328 if (channel->info_word) \
329 channel->info_word->tx.param = cpu_to_le32(value); \
331 channel->info->tx.param = value; \
336 BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u32)); \
337 if (channel->info_word) \
338 channel->info_word->tx.param = cpu_to_le32(value); \
340 channel->info->tx.param = cpu_to_le32(value); \
344 * struct qcom_smd_alloc_entry - channel allocation entry
372 struct qcom_smd_edge *edge = channel->edge; in qcom_smd_signal_channel()
374 if (edge->mbox_chan) { in qcom_smd_signal_channel()
380 mbox_send_message(edge->mbox_chan, NULL); in qcom_smd_signal_channel()
381 mbox_client_txdone(edge->mbox_chan, 0); in qcom_smd_signal_channel()
383 regmap_write(edge->ipc_regmap, edge->ipc_offset, BIT(edge->ipc_bit)); in qcom_smd_signal_channel()
406 channel->state = SMD_CHANNEL_CLOSED; in qcom_smd_channel_reset()
407 channel->pkt_size = 0; in qcom_smd_channel_reset()
416 struct rpmsg_endpoint *ept = &channel->qsept->ept; in qcom_smd_channel_set_callback()
419 spin_lock_irqsave(&channel->recv_lock, flags); in qcom_smd_channel_set_callback()
420 ept->cb = cb; in qcom_smd_channel_set_callback()
421 spin_unlock_irqrestore(&channel->recv_lock, flags); in qcom_smd_channel_set_callback()
435 return (head - tail) & (channel->fifo_size - 1); in qcom_smd_channel_get_rx_avail()
444 struct qcom_smd_edge *edge = channel->edge; in qcom_smd_channel_set_state()
447 if (channel->state == state) in qcom_smd_channel_set_state()
450 dev_dbg(&edge->dev, "set_state(%s, %d)\n", channel->name, state); in qcom_smd_channel_set_state()
459 channel->state = state; in qcom_smd_channel_set_state()
504 word_aligned = channel->info_word; in qcom_smd_channel_peek()
507 len = min_t(size_t, count, channel->fifo_size - tail); in qcom_smd_channel_peek()
510 channel->rx_fifo + tail, in qcom_smd_channel_peek()
517 channel->rx_fifo, in qcom_smd_channel_peek()
518 count - len, in qcom_smd_channel_peek()
535 tail &= (channel->fifo_size - 1); in qcom_smd_channel_advance()
544 struct rpmsg_endpoint *ept = &channel->qsept->ept; in qcom_smd_channel_recv_single()
553 if (tail + channel->pkt_size >= channel->fifo_size) { in qcom_smd_channel_recv_single()
554 ptr = channel->bounce_buffer; in qcom_smd_channel_recv_single()
555 len = qcom_smd_channel_peek(channel, ptr, channel->pkt_size); in qcom_smd_channel_recv_single()
557 ptr = channel->rx_fifo + tail; in qcom_smd_channel_recv_single()
558 len = channel->pkt_size; in qcom_smd_channel_recv_single()
561 ret = ept->cb(ept->rpdev, ptr, len, ept->priv, RPMSG_ADDR_ANY); in qcom_smd_channel_recv_single()
568 channel->pkt_size = 0; in qcom_smd_channel_recv_single()
586 if (remote_state != channel->remote_state) { in qcom_smd_channel_intr()
587 channel->remote_state = remote_state; in qcom_smd_channel_intr()
590 wake_up_interruptible_all(&channel->state_change_event); in qcom_smd_channel_intr()
597 wake_up_interruptible_all(&channel->fblockread_event); in qcom_smd_channel_intr()
600 if (channel->state != SMD_CHANNEL_OPENED) in qcom_smd_channel_intr()
610 if (!channel->pkt_size && avail >= SMD_PACKET_HEADER_LEN) { in qcom_smd_channel_intr()
613 channel->pkt_size = le32_to_cpu(pktlen); in qcom_smd_channel_intr()
614 } else if (channel->pkt_size && avail >= channel->pkt_size) { in qcom_smd_channel_intr()
653 spin_lock(&edge->channels_lock); in qcom_smd_edge_intr()
654 list_for_each_entry(channel, &edge->channels, list) { in qcom_smd_edge_intr()
655 spin_lock(&channel->recv_lock); in qcom_smd_edge_intr()
657 spin_unlock(&channel->recv_lock); in qcom_smd_edge_intr()
659 spin_unlock(&edge->channels_lock); in qcom_smd_edge_intr()
662 * Creating a new channel requires allocating an smem entry, so we only in qcom_smd_edge_intr()
663 * have to scan if the amount of available space in smem have changed in qcom_smd_edge_intr()
666 available = qcom_smem_get_free_space(edge->remote_pid); in qcom_smd_edge_intr()
667 if (available != edge->smem_available) { in qcom_smd_edge_intr()
668 edge->smem_available = available; in qcom_smd_edge_intr()
673 schedule_work(&edge->scan_work); in qcom_smd_edge_intr()
675 schedule_work(&edge->state_work); in qcom_smd_edge_intr()
687 unsigned mask = channel->fifo_size - 1; in qcom_smd_get_tx_avail()
692 return mask - ((head - tail) & mask); in qcom_smd_get_tx_avail()
706 word_aligned = channel->info_word; in qcom_smd_write_fifo()
709 len = min_t(size_t, count, channel->fifo_size - head); in qcom_smd_write_fifo()
711 smd_copy_to_fifo(channel->tx_fifo + head, in qcom_smd_write_fifo()
718 smd_copy_to_fifo(channel->tx_fifo, in qcom_smd_write_fifo()
720 count - len, in qcom_smd_write_fifo()
725 head &= (channel->fifo_size - 1); in qcom_smd_write_fifo()
732 * qcom_smd_send - write data to smd channel
752 if (channel->info_word && len % 4) in __qcom_smd_send()
753 return -EINVAL; in __qcom_smd_send()
756 if (tlen >= channel->fifo_size) in __qcom_smd_send()
757 return -EINVAL; in __qcom_smd_send()
763 spin_lock_irqsave(&channel->tx_lock, flags); in __qcom_smd_send()
766 channel->state == SMD_CHANNEL_OPENED) { in __qcom_smd_send()
768 ret = -EAGAIN; in __qcom_smd_send()
775 spin_unlock_irqrestore(&channel->tx_lock, flags); in __qcom_smd_send()
777 ret = wait_event_interruptible(channel->fblockread_event, in __qcom_smd_send()
779 channel->state != SMD_CHANNEL_OPENED); in __qcom_smd_send()
783 spin_lock_irqsave(&channel->tx_lock, flags); in __qcom_smd_send()
789 if (channel->state != SMD_CHANNEL_OPENED) { in __qcom_smd_send()
790 ret = -EPIPE; in __qcom_smd_send()
807 spin_unlock_irqrestore(&channel->tx_lock, flags); in __qcom_smd_send()
818 struct qcom_smd_edge *edge = channel->edge; in qcom_smd_channel_open()
825 bb_size = min(channel->fifo_size, SZ_4K); in qcom_smd_channel_open()
826 channel->bounce_buffer = kmalloc(bb_size, GFP_KERNEL); in qcom_smd_channel_open()
827 if (!channel->bounce_buffer) in qcom_smd_channel_open()
828 return -ENOMEM; in qcom_smd_channel_open()
834 ret = wait_event_interruptible_timeout(channel->state_change_event, in qcom_smd_channel_open()
835 channel->remote_state == SMD_CHANNEL_OPENING || in qcom_smd_channel_open()
836 channel->remote_state == SMD_CHANNEL_OPENED, in qcom_smd_channel_open()
839 dev_err(&edge->dev, "remote side did not enter opening state\n"); in qcom_smd_channel_open()
846 ret = wait_event_interruptible_timeout(channel->state_change_event, in qcom_smd_channel_open()
847 channel->remote_state == SMD_CHANNEL_OPENED, in qcom_smd_channel_open()
850 dev_err(&edge->dev, "remote side did not enter open state\n"); in qcom_smd_channel_open()
858 return -ETIMEDOUT; in qcom_smd_channel_open()
868 kfree(channel->bounce_buffer); in qcom_smd_channel_close()
869 channel->bounce_buffer = NULL; in qcom_smd_channel_close()
882 spin_lock_irqsave(&edge->channels_lock, flags); in qcom_smd_find_channel()
883 list_for_each_entry(channel, &edge->channels, list) { in qcom_smd_find_channel()
884 if (!strcmp(channel->name, name)) { in qcom_smd_find_channel()
889 spin_unlock_irqrestore(&edge->channels_lock, flags); in qcom_smd_find_channel()
908 struct qcom_smd_edge *edge = qsdev->edge; in qcom_smd_create_ept()
914 ret = wait_event_interruptible_timeout(edge->new_channel_event, in qcom_smd_create_ept()
920 if (channel->state != SMD_CHANNEL_CLOSED) { in qcom_smd_create_ept()
921 dev_err(&rpdev->dev, "channel %s is busy\n", channel->name); in qcom_smd_create_ept()
929 ept = &qsept->ept; in qcom_smd_create_ept()
931 kref_init(&ept->refcount); in qcom_smd_create_ept()
933 ept->rpdev = rpdev; in qcom_smd_create_ept()
934 ept->cb = cb; in qcom_smd_create_ept()
935 ept->priv = priv; in qcom_smd_create_ept()
936 ept->ops = &qcom_smd_endpoint_ops; in qcom_smd_create_ept()
938 channel->qsept = qsept; in qcom_smd_create_ept()
939 qsept->qsch = channel; in qcom_smd_create_ept()
948 channel->qsept = NULL; in qcom_smd_create_ept()
949 kref_put(&ept->refcount, __ept_release); in qcom_smd_create_ept()
956 struct qcom_smd_channel *ch = qsept->qsch; in qcom_smd_destroy_ept()
959 ch->qsept = NULL; in qcom_smd_destroy_ept()
960 kref_put(&ept->refcount, __ept_release); in qcom_smd_destroy_ept()
967 return __qcom_smd_send(qsept->qsch, data, len, true); in qcom_smd_send()
974 return __qcom_smd_send(qsept->qsch, data, len, false); in qcom_smd_trysend()
981 struct qcom_smd_channel *channel = qsept->qsch; in qcom_smd_poll()
984 poll_wait(filp, &channel->fblockread_event, wait); in qcom_smd_poll()
1004 key = "qcom,smd-channels"; in qcom_smd_match_channel()
1018 struct qcom_smd_endpoint *qept = to_smd_endpoint(rpdev->ept); in qcom_smd_announce_create()
1019 struct qcom_smd_channel *channel = qept->qsch; in qcom_smd_announce_create()
1023 spin_lock_irqsave(&channel->recv_lock, flags); in qcom_smd_announce_create()
1025 spin_unlock_irqrestore(&channel->recv_lock, flags); in qcom_smd_announce_create()
1028 schedule_work(&channel->edge->state_work); in qcom_smd_announce_create()
1060 struct qcom_smd_edge *edge = channel->edge; in qcom_smd_create_device()
1062 dev_dbg(&edge->dev, "registering '%s'\n", channel->name); in qcom_smd_create_device()
1066 return -ENOMEM; in qcom_smd_create_device()
1069 qsdev->edge = edge; in qcom_smd_create_device()
1072 qsdev->rpdev.ops = &qcom_smd_device_ops; in qcom_smd_create_device()
1075 rpdev = &qsdev->rpdev; in qcom_smd_create_device()
1076 strncpy(rpdev->id.name, channel->name, RPMSG_NAME_SIZE); in qcom_smd_create_device()
1077 rpdev->src = RPMSG_ADDR_ANY; in qcom_smd_create_device()
1078 rpdev->dst = RPMSG_ADDR_ANY; in qcom_smd_create_device()
1080 rpdev->dev.of_node = qcom_smd_match_channel(edge->of_node, channel->name); in qcom_smd_create_device()
1081 rpdev->dev.parent = &edge->dev; in qcom_smd_create_device()
1082 rpdev->dev.release = qcom_smd_release_device; in qcom_smd_create_device()
1093 return -ENOMEM; in qcom_smd_create_chrdev()
1095 qsdev->edge = edge; in qcom_smd_create_chrdev()
1096 qsdev->rpdev.ops = &qcom_smd_device_ops; in qcom_smd_create_chrdev()
1097 qsdev->rpdev.dev.parent = &edge->dev; in qcom_smd_create_chrdev()
1098 qsdev->rpdev.dev.release = qcom_smd_release_device; in qcom_smd_create_chrdev()
1100 return rpmsg_chrdev_register_device(&qsdev->rpdev); in qcom_smd_create_chrdev()
1105 * retrieving and validating the smem items involved.
1121 return ERR_PTR(-ENOMEM); in qcom_smd_create_channel()
1123 channel->edge = edge; in qcom_smd_create_channel()
1124 channel->name = kstrdup(name, GFP_KERNEL); in qcom_smd_create_channel()
1125 if (!channel->name) { in qcom_smd_create_channel()
1126 ret = -ENOMEM; in qcom_smd_create_channel()
1130 spin_lock_init(&channel->tx_lock); in qcom_smd_create_channel()
1131 spin_lock_init(&channel->recv_lock); in qcom_smd_create_channel()
1132 init_waitqueue_head(&channel->fblockread_event); in qcom_smd_create_channel()
1133 init_waitqueue_head(&channel->state_change_event); in qcom_smd_create_channel()
1135 info = qcom_smem_get(edge->remote_pid, smem_info_item, &info_size); in qcom_smd_create_channel()
1146 channel->info_word = info; in qcom_smd_create_channel()
1148 channel->info = info; in qcom_smd_create_channel()
1150 dev_err(&edge->dev, in qcom_smd_create_channel()
1152 ret = -EINVAL; in qcom_smd_create_channel()
1156 fifo_base = qcom_smem_get(edge->remote_pid, smem_fifo_item, &fifo_size); in qcom_smd_create_channel()
1165 dev_dbg(&edge->dev, "new channel '%s' info-size: %zu fifo-size: %zu\n", in qcom_smd_create_channel()
1168 channel->tx_fifo = fifo_base; in qcom_smd_create_channel()
1169 channel->rx_fifo = fifo_base + fifo_size; in qcom_smd_create_channel()
1170 channel->fifo_size = fifo_size; in qcom_smd_create_channel()
1177 kfree(channel->name); in qcom_smd_create_channel()
1203 alloc_tbl = qcom_smem_get(edge->remote_pid, in qcom_channel_scan_worker()
1210 eflags = le32_to_cpu(entry->flags); in qcom_channel_scan_worker()
1211 if (test_bit(i, edge->allocated[tbl])) in qcom_channel_scan_worker()
1214 if (entry->ref_count == 0) in qcom_channel_scan_worker()
1217 if (!entry->name[0]) in qcom_channel_scan_worker()
1223 if ((eflags & SMD_CHANNEL_FLAGS_EDGE_MASK) != edge->edge_id) in qcom_channel_scan_worker()
1226 cid = le32_to_cpu(entry->cid); in qcom_channel_scan_worker()
1230 channel = qcom_smd_create_channel(edge, info_id, fifo_id, entry->name); in qcom_channel_scan_worker()
1234 spin_lock_irqsave(&edge->channels_lock, flags); in qcom_channel_scan_worker()
1235 list_add(&channel->list, &edge->channels); in qcom_channel_scan_worker()
1236 spin_unlock_irqrestore(&edge->channels_lock, flags); in qcom_channel_scan_worker()
1238 dev_dbg(&edge->dev, "new channel found: '%s'\n", channel->name); in qcom_channel_scan_worker()
1239 set_bit(i, edge->allocated[tbl]); in qcom_channel_scan_worker()
1241 wake_up_interruptible_all(&edge->new_channel_event); in qcom_channel_scan_worker()
1245 schedule_work(&edge->state_work); in qcom_channel_scan_worker()
1249 * This per edge worker scans smem for any new channels and register these. It
1253 * LOCKING: edge->channels_lock only needs to cover the list operations, as the
1270 spin_lock_irqsave(&edge->channels_lock, flags); in qcom_channel_state_worker()
1271 list_for_each_entry(channel, &edge->channels, list) { in qcom_channel_state_worker()
1272 if (channel->state != SMD_CHANNEL_CLOSED) in qcom_channel_state_worker()
1280 if (channel->registered) in qcom_channel_state_worker()
1283 spin_unlock_irqrestore(&edge->channels_lock, flags); in qcom_channel_state_worker()
1285 channel->registered = true; in qcom_channel_state_worker()
1286 spin_lock_irqsave(&edge->channels_lock, flags); in qcom_channel_state_worker()
1288 channel->registered = true; in qcom_channel_state_worker()
1295 list_for_each_entry(channel, &edge->channels, list) { in qcom_channel_state_worker()
1296 if (channel->state != SMD_CHANNEL_OPENING && in qcom_channel_state_worker()
1297 channel->state != SMD_CHANNEL_OPENED) in qcom_channel_state_worker()
1305 spin_unlock_irqrestore(&edge->channels_lock, flags); in qcom_channel_state_worker()
1307 strncpy(chinfo.name, channel->name, sizeof(chinfo.name)); in qcom_channel_state_worker()
1310 rpmsg_unregister_device(&edge->dev, &chinfo); in qcom_channel_state_worker()
1311 channel->registered = false; in qcom_channel_state_worker()
1312 spin_lock_irqsave(&edge->channels_lock, flags); in qcom_channel_state_worker()
1314 spin_unlock_irqrestore(&edge->channels_lock, flags); in qcom_channel_state_worker()
1329 INIT_LIST_HEAD(&edge->channels); in qcom_smd_parse_edge()
1330 spin_lock_init(&edge->channels_lock); in qcom_smd_parse_edge()
1332 INIT_WORK(&edge->scan_work, qcom_channel_scan_worker); in qcom_smd_parse_edge()
1333 INIT_WORK(&edge->state_work, qcom_channel_state_worker); in qcom_smd_parse_edge()
1335 edge->of_node = of_node_get(node); in qcom_smd_parse_edge()
1337 key = "qcom,smd-edge"; in qcom_smd_parse_edge()
1338 ret = of_property_read_u32(node, key, &edge->edge_id); in qcom_smd_parse_edge()
1344 edge->remote_pid = QCOM_SMEM_HOST_ANY; in qcom_smd_parse_edge()
1345 key = "qcom,remote-pid"; in qcom_smd_parse_edge()
1346 of_property_read_u32(node, key, &edge->remote_pid); in qcom_smd_parse_edge()
1348 edge->mbox_client.dev = dev; in qcom_smd_parse_edge()
1349 edge->mbox_client.knows_txdone = true; in qcom_smd_parse_edge()
1350 edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0); in qcom_smd_parse_edge()
1351 if (IS_ERR(edge->mbox_chan)) { in qcom_smd_parse_edge()
1352 if (PTR_ERR(edge->mbox_chan) != -ENODEV) { in qcom_smd_parse_edge()
1353 ret = PTR_ERR(edge->mbox_chan); in qcom_smd_parse_edge()
1357 edge->mbox_chan = NULL; in qcom_smd_parse_edge()
1362 ret = -ENODEV; in qcom_smd_parse_edge()
1366 edge->ipc_regmap = syscon_node_to_regmap(syscon_np); in qcom_smd_parse_edge()
1367 if (IS_ERR(edge->ipc_regmap)) { in qcom_smd_parse_edge()
1368 ret = PTR_ERR(edge->ipc_regmap); in qcom_smd_parse_edge()
1373 ret = of_property_read_u32_index(node, key, 1, &edge->ipc_offset); in qcom_smd_parse_edge()
1379 ret = of_property_read_u32_index(node, key, 2, &edge->ipc_bit); in qcom_smd_parse_edge()
1386 ret = of_property_read_string(node, "label", &edge->name); in qcom_smd_parse_edge()
1388 edge->name = node->name; in qcom_smd_parse_edge()
1399 node->name, edge); in qcom_smd_parse_edge()
1405 edge->irq = irq; in qcom_smd_parse_edge()
1411 edge->of_node = NULL; in qcom_smd_parse_edge()
1425 list_for_each_entry_safe(channel, tmp, &edge->channels, list) { in qcom_smd_edge_release()
1426 list_del(&channel->list); in qcom_smd_edge_release()
1427 kfree(channel->name); in qcom_smd_edge_release()
1439 return sprintf(buf, "%s\n", edge->name); in rpmsg_name_show()
1450 * qcom_smd_register_edge() - register an edge based on an device_node
1464 return ERR_PTR(-ENOMEM); in qcom_smd_register_edge()
1466 init_waitqueue_head(&edge->new_channel_event); in qcom_smd_register_edge()
1468 edge->dev.parent = parent; in qcom_smd_register_edge()
1469 edge->dev.release = qcom_smd_edge_release; in qcom_smd_register_edge()
1470 edge->dev.of_node = node; in qcom_smd_register_edge()
1471 edge->dev.groups = qcom_smd_edge_groups; in qcom_smd_register_edge()
1472 dev_set_name(&edge->dev, "%s:%pOFn", dev_name(parent), node); in qcom_smd_register_edge()
1473 ret = device_register(&edge->dev); in qcom_smd_register_edge()
1476 put_device(&edge->dev); in qcom_smd_register_edge()
1480 ret = qcom_smd_parse_edge(&edge->dev, node, edge); in qcom_smd_register_edge()
1482 dev_err(&edge->dev, "failed to parse smd edge\n"); in qcom_smd_register_edge()
1488 dev_err(&edge->dev, "failed to register chrdev for edge\n"); in qcom_smd_register_edge()
1492 schedule_work(&edge->scan_work); in qcom_smd_register_edge()
1497 if (!IS_ERR_OR_NULL(edge->mbox_chan)) in qcom_smd_register_edge()
1498 mbox_free_channel(edge->mbox_chan); in qcom_smd_register_edge()
1500 device_unregister(&edge->dev); in qcom_smd_register_edge()
1513 * qcom_smd_unregister_edge() - release an edge and its children
1520 disable_irq(edge->irq); in qcom_smd_unregister_edge()
1521 cancel_work_sync(&edge->scan_work); in qcom_smd_unregister_edge()
1522 cancel_work_sync(&edge->state_work); in qcom_smd_unregister_edge()
1524 ret = device_for_each_child(&edge->dev, NULL, qcom_smd_remove_device); in qcom_smd_unregister_edge()
1526 dev_warn(&edge->dev, "can't remove smd device: %d\n", ret); in qcom_smd_unregister_edge()
1528 mbox_free_channel(edge->mbox_chan); in qcom_smd_unregister_edge()
1529 device_unregister(&edge->dev); in qcom_smd_unregister_edge()
1540 /* Wait for smem */ in qcom_smd_probe()
1542 if (PTR_ERR(p) == -EPROBE_DEFER) in qcom_smd_probe()
1545 for_each_available_child_of_node(pdev->dev.of_node, node) in qcom_smd_probe()
1546 qcom_smd_register_edge(&pdev->dev, node); in qcom_smd_probe()
1566 ret = device_for_each_child(&pdev->dev, NULL, qcom_smd_remove_edge); in qcom_smd_remove()
1568 dev_warn(&pdev->dev, "can't remove smd device: %d\n", ret); in qcom_smd_remove()
1583 .name = "qcom-smd",