Lines Matching refs:dev

85 static void __mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl)  in __mei_me_cl_del()  argument
101 void mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_del() argument
103 down_write(&dev->me_clients_rwsem); in mei_me_cl_del()
104 __mei_me_cl_del(dev, me_cl); in mei_me_cl_del()
105 up_write(&dev->me_clients_rwsem); in mei_me_cl_del()
114 void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_add() argument
116 down_write(&dev->me_clients_rwsem); in mei_me_cl_add()
117 list_add(&me_cl->list, &dev->me_clients); in mei_me_cl_add()
118 up_write(&dev->me_clients_rwsem); in mei_me_cl_add()
132 static struct mei_me_client *__mei_me_cl_by_uuid(struct mei_device *dev, in __mei_me_cl_by_uuid() argument
138 WARN_ON(!rwsem_is_locked(&dev->me_clients_rwsem)); in __mei_me_cl_by_uuid()
140 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid()
160 struct mei_me_client *mei_me_cl_by_uuid(struct mei_device *dev, in mei_me_cl_by_uuid() argument
165 down_read(&dev->me_clients_rwsem); in mei_me_cl_by_uuid()
166 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_by_uuid()
167 up_read(&dev->me_clients_rwsem); in mei_me_cl_by_uuid()
183 struct mei_me_client *mei_me_cl_by_id(struct mei_device *dev, u8 client_id) in mei_me_cl_by_id() argument
188 down_read(&dev->me_clients_rwsem); in mei_me_cl_by_id()
189 list_for_each_entry(__me_cl, &dev->me_clients, list) { in mei_me_cl_by_id()
195 up_read(&dev->me_clients_rwsem); in mei_me_cl_by_id()
212 static struct mei_me_client *__mei_me_cl_by_uuid_id(struct mei_device *dev, in __mei_me_cl_by_uuid_id() argument
218 WARN_ON(!rwsem_is_locked(&dev->me_clients_rwsem)); in __mei_me_cl_by_uuid_id()
220 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid_id()
241 struct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev, in mei_me_cl_by_uuid_id() argument
246 down_read(&dev->me_clients_rwsem); in mei_me_cl_by_uuid_id()
247 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, client_id); in mei_me_cl_by_uuid_id()
248 up_read(&dev->me_clients_rwsem); in mei_me_cl_by_uuid_id()
261 void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid) in mei_me_cl_rm_by_uuid() argument
265 dev_dbg(dev->dev, "remove %pUl\n", uuid); in mei_me_cl_rm_by_uuid()
267 down_write(&dev->me_clients_rwsem); in mei_me_cl_rm_by_uuid()
268 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_rm_by_uuid()
269 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid()
271 up_write(&dev->me_clients_rwsem); in mei_me_cl_rm_by_uuid()
283 void mei_me_cl_rm_by_uuid_id(struct mei_device *dev, const uuid_le *uuid, u8 id) in mei_me_cl_rm_by_uuid_id() argument
287 dev_dbg(dev->dev, "remove %pUl %d\n", uuid, id); in mei_me_cl_rm_by_uuid_id()
289 down_write(&dev->me_clients_rwsem); in mei_me_cl_rm_by_uuid_id()
290 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); in mei_me_cl_rm_by_uuid_id()
291 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid_id()
293 up_write(&dev->me_clients_rwsem); in mei_me_cl_rm_by_uuid_id()
303 void mei_me_cl_rm_all(struct mei_device *dev) in mei_me_cl_rm_all() argument
307 down_write(&dev->me_clients_rwsem); in mei_me_cl_rm_all()
308 list_for_each_entry_safe(me_cl, next, &dev->me_clients, list) in mei_me_cl_rm_all()
309 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_all()
310 up_write(&dev->me_clients_rwsem); in mei_me_cl_rm_all()
536 list_add_tail(&cb->list, &cl->dev->ctrl_wr_list); in mei_cl_enqueue_ctrl_wr_cb()
574 struct mei_device *dev; in mei_cl_flush_queues() local
576 if (WARN_ON(!cl || !cl->dev)) in mei_cl_flush_queues()
579 dev = cl->dev; in mei_cl_flush_queues()
581 cl_dbg(dev, cl, "remove list entry belonging to cl\n"); in mei_cl_flush_queues()
582 mei_io_tx_list_free_cl(&cl->dev->write_list, cl, fp); in mei_cl_flush_queues()
583 mei_io_tx_list_free_cl(&cl->dev->write_waiting_list, cl, fp); in mei_cl_flush_queues()
586 mei_io_list_flush_cl(&cl->dev->ctrl_wr_list, cl); in mei_cl_flush_queues()
587 mei_io_list_flush_cl(&cl->dev->ctrl_rd_list, cl); in mei_cl_flush_queues()
603 static void mei_cl_init(struct mei_cl *cl, struct mei_device *dev) in mei_cl_init() argument
617 cl->dev = dev; in mei_cl_init()
626 struct mei_cl *mei_cl_allocate(struct mei_device *dev) in mei_cl_allocate() argument
634 mei_cl_init(cl, dev); in mei_cl_allocate()
650 struct mei_device *dev; in mei_cl_link() local
653 if (WARN_ON(!cl || !cl->dev)) in mei_cl_link()
656 dev = cl->dev; in mei_cl_link()
658 id = find_first_zero_bit(dev->host_clients_map, MEI_CLIENTS_MAX); in mei_cl_link()
660 dev_err(dev->dev, "id exceeded %d", MEI_CLIENTS_MAX); in mei_cl_link()
664 if (dev->open_handle_count >= MEI_MAX_OPEN_HANDLE_COUNT) { in mei_cl_link()
665 dev_err(dev->dev, "open_handle_count exceeded %d", in mei_cl_link()
670 dev->open_handle_count++; in mei_cl_link()
673 list_add_tail(&cl->link, &dev->file_list); in mei_cl_link()
675 set_bit(id, dev->host_clients_map); in mei_cl_link()
679 cl_dbg(dev, cl, "link cl\n"); in mei_cl_link()
692 struct mei_device *dev; in mei_cl_unlink() local
698 if (WARN_ON(!cl->dev)) in mei_cl_unlink()
701 dev = cl->dev; in mei_cl_unlink()
703 cl_dbg(dev, cl, "unlink client"); in mei_cl_unlink()
708 if (dev->open_handle_count > 0) in mei_cl_unlink()
709 dev->open_handle_count--; in mei_cl_unlink()
713 clear_bit(cl->host_client_id, dev->host_clients_map); in mei_cl_unlink()
727 void mei_host_client_init(struct mei_device *dev) in mei_host_client_init() argument
729 mei_set_devstate(dev, MEI_DEV_ENABLED); in mei_host_client_init()
730 dev->reset_count = 0; in mei_host_client_init()
732 schedule_work(&dev->bus_rescan_work); in mei_host_client_init()
734 pm_runtime_mark_last_busy(dev->dev); in mei_host_client_init()
735 dev_dbg(dev->dev, "rpm: autosuspend\n"); in mei_host_client_init()
736 pm_request_autosuspend(dev->dev); in mei_host_client_init()
745 bool mei_hbuf_acquire(struct mei_device *dev) in mei_hbuf_acquire() argument
747 if (mei_pg_state(dev) == MEI_PG_ON || in mei_hbuf_acquire()
748 mei_pg_in_transition(dev)) { in mei_hbuf_acquire()
749 dev_dbg(dev->dev, "device is in pg\n"); in mei_hbuf_acquire()
753 if (!dev->hbuf_is_ready) { in mei_hbuf_acquire()
754 dev_dbg(dev->dev, "hbuf is not ready\n"); in mei_hbuf_acquire()
758 dev->hbuf_is_ready = false; in mei_hbuf_acquire()
771 struct mei_device *dev = cl->dev; in mei_cl_wake_all() local
775 cl_dbg(dev, cl, "Waking up reading client!\n"); in mei_cl_wake_all()
780 cl_dbg(dev, cl, "Waking up writing client!\n"); in mei_cl_wake_all()
785 cl_dbg(dev, cl, "Waking up waiting for event clients!\n"); in mei_cl_wake_all()
790 cl_dbg(dev, cl, "Waking up ctrl write clients!\n"); in mei_cl_wake_all()
803 struct mei_device *dev = cl->dev; in mei_cl_set_disconnected() local
810 mei_io_tx_list_free_cl(&dev->write_list, cl, NULL); in mei_cl_set_disconnected()
811 mei_io_tx_list_free_cl(&dev->write_waiting_list, cl, NULL); in mei_cl_set_disconnected()
812 mei_io_list_flush_cl(&dev->ctrl_rd_list, cl); in mei_cl_set_disconnected()
813 mei_io_list_flush_cl(&dev->ctrl_wr_list, cl); in mei_cl_set_disconnected()
862 struct mei_device *dev; in mei_cl_send_disconnect() local
865 dev = cl->dev; in mei_cl_send_disconnect()
867 ret = mei_hbm_cl_disconnect_req(dev, cl); in mei_cl_send_disconnect()
874 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_send_disconnect()
875 cl->timer_count = dev->timeouts.connect; in mei_cl_send_disconnect()
876 mei_schedule_stall_timer(dev); in mei_cl_send_disconnect()
894 struct mei_device *dev = cl->dev; in mei_cl_irq_disconnect() local
900 slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_disconnect()
924 struct mei_device *dev; in __mei_cl_disconnect() local
928 dev = cl->dev; in __mei_cl_disconnect()
938 if (mei_hbuf_acquire(dev)) { in __mei_cl_disconnect()
941 cl_err(dev, cl, "failed to disconnect.\n"); in __mei_cl_disconnect()
946 mutex_unlock(&dev->device_lock); in __mei_cl_disconnect()
950 dev->timeouts.cl_connect); in __mei_cl_disconnect()
951 mutex_lock(&dev->device_lock); in __mei_cl_disconnect()
956 cl_dbg(dev, cl, "timeout on disconnect from FW client.\n"); in __mei_cl_disconnect()
964 cl_dbg(dev, cl, "successfully disconnected from FW client.\n"); in __mei_cl_disconnect()
981 struct mei_device *dev; in mei_cl_disconnect() local
984 if (WARN_ON(!cl || !cl->dev)) in mei_cl_disconnect()
987 dev = cl->dev; in mei_cl_disconnect()
989 cl_dbg(dev, cl, "disconnecting"); in mei_cl_disconnect()
999 if (dev->dev_state == MEI_DEV_POWERING_DOWN || in mei_cl_disconnect()
1000 dev->dev_state == MEI_DEV_POWER_DOWN) { in mei_cl_disconnect()
1001 cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n"); in mei_cl_disconnect()
1006 rets = pm_runtime_get(dev->dev); in mei_cl_disconnect()
1008 pm_runtime_put_noidle(dev->dev); in mei_cl_disconnect()
1009 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_disconnect()
1015 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_disconnect()
1016 pm_runtime_mark_last_busy(dev->dev); in mei_cl_disconnect()
1017 pm_runtime_put_autosuspend(dev->dev); in mei_cl_disconnect()
1033 struct mei_device *dev; in mei_cl_is_other_connecting() local
1036 dev = cl->dev; in mei_cl_is_other_connecting()
1038 list_for_each_entry(cb, &dev->ctrl_rd_list, list) { in mei_cl_is_other_connecting()
1057 struct mei_device *dev; in mei_cl_send_connect() local
1060 dev = cl->dev; in mei_cl_send_connect()
1062 ret = mei_hbm_cl_connect_req(dev, cl); in mei_cl_send_connect()
1069 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_send_connect()
1070 cl->timer_count = dev->timeouts.connect; in mei_cl_send_connect()
1071 mei_schedule_stall_timer(dev); in mei_cl_send_connect()
1087 struct mei_device *dev = cl->dev; in mei_cl_irq_connect() local
1096 slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_connect()
1124 struct mei_device *dev; in mei_cl_connect() local
1128 if (WARN_ON(!cl || !cl->dev || !me_cl)) in mei_cl_connect()
1131 dev = cl->dev; in mei_cl_connect()
1143 rets = pm_runtime_get(dev->dev); in mei_cl_connect()
1145 pm_runtime_put_noidle(dev->dev); in mei_cl_connect()
1146 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_connect()
1157 if (!mei_cl_is_other_connecting(cl) && mei_hbuf_acquire(dev)) { in mei_cl_connect()
1163 mutex_unlock(&dev->device_lock); in mei_cl_connect()
1169 dev->timeouts.cl_connect); in mei_cl_connect()
1170 mutex_lock(&dev->device_lock); in mei_cl_connect()
1174 mei_io_list_flush_cl(&dev->ctrl_rd_list, cl); in mei_cl_connect()
1175 mei_io_list_flush_cl(&dev->ctrl_wr_list, cl); in mei_cl_connect()
1191 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_connect()
1192 pm_runtime_mark_last_busy(dev->dev); in mei_cl_connect()
1193 pm_runtime_put_autosuspend(dev->dev); in mei_cl_connect()
1211 struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev) in mei_cl_alloc_linked() argument
1216 cl = mei_cl_allocate(dev); in mei_cl_alloc_linked()
1388 struct mei_device *dev = cl->dev; in mei_cl_vt_support_check() local
1390 if (!dev->hbm_f_vt_supported) in mei_cl_vt_support_check()
1484 struct mei_device *dev = cl->dev; in mei_cl_irq_notify() local
1491 slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_notify()
1499 ret = mei_hbm_cl_notify_req(dev, cl, request); in mei_cl_irq_notify()
1506 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_irq_notify()
1524 struct mei_device *dev; in mei_cl_notify_request() local
1529 if (WARN_ON(!cl || !cl->dev)) in mei_cl_notify_request()
1532 dev = cl->dev; in mei_cl_notify_request()
1534 if (!dev->hbm_f_ev_supported) { in mei_cl_notify_request()
1535 cl_dbg(dev, cl, "notifications not supported\n"); in mei_cl_notify_request()
1542 rets = pm_runtime_get(dev->dev); in mei_cl_notify_request()
1544 pm_runtime_put_noidle(dev->dev); in mei_cl_notify_request()
1545 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_notify_request()
1556 if (mei_hbuf_acquire(dev)) { in mei_cl_notify_request()
1557 if (mei_hbm_cl_notify_req(dev, cl, request)) { in mei_cl_notify_request()
1561 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_notify_request()
1564 mutex_unlock(&dev->device_lock); in mei_cl_notify_request()
1569 dev->timeouts.cl_connect); in mei_cl_notify_request()
1570 mutex_lock(&dev->device_lock); in mei_cl_notify_request()
1578 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_notify_request()
1579 pm_runtime_mark_last_busy(dev->dev); in mei_cl_notify_request()
1580 pm_runtime_put_autosuspend(dev->dev); in mei_cl_notify_request()
1595 struct mei_device *dev; in mei_cl_notify() local
1597 if (!cl || !cl->dev) in mei_cl_notify()
1600 dev = cl->dev; in mei_cl_notify()
1605 cl_dbg(dev, cl, "notify event"); in mei_cl_notify()
1628 struct mei_device *dev; in mei_cl_notify_get() local
1633 if (WARN_ON(!cl || !cl->dev)) in mei_cl_notify_get()
1636 dev = cl->dev; in mei_cl_notify_get()
1638 if (!dev->hbm_f_ev_supported) { in mei_cl_notify_get()
1639 cl_dbg(dev, cl, "notifications not supported\n"); in mei_cl_notify_get()
1652 mutex_unlock(&dev->device_lock); in mei_cl_notify_get()
1654 mutex_lock(&dev->device_lock); in mei_cl_notify_get()
1676 struct mei_device *dev; in mei_cl_read_start() local
1680 if (WARN_ON(!cl || !cl->dev)) in mei_cl_read_start()
1683 dev = cl->dev; in mei_cl_read_start()
1689 cl_err(dev, cl, "no such me client\n"); in mei_cl_read_start()
1708 rets = pm_runtime_get(dev->dev); in mei_cl_read_start()
1710 pm_runtime_put_noidle(dev->dev); in mei_cl_read_start()
1711 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_read_start()
1716 if (mei_hbuf_acquire(dev)) { in mei_cl_read_start()
1717 rets = mei_hbm_cl_flow_control_req(dev, cl); in mei_cl_read_start()
1726 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_read_start()
1727 pm_runtime_mark_last_busy(dev->dev); in mei_cl_read_start()
1728 pm_runtime_put_autosuspend(dev->dev); in mei_cl_read_start()
1779 is_gsc = ((!is_hbm) && cb->cl->dev->hbm_f_gsc_supported && mei_ext_hdr_is_gsc(cb->ext_hdr)); in mei_msg_hdr_init()
1841 struct mei_device *dev; in mei_cl_irq_write() local
1855 if (WARN_ON(!cl || !cl->dev)) in mei_cl_irq_write()
1858 dev = cl->dev; in mei_cl_irq_write()
1869 cl_dbg(dev, cl, "No flow control credentials: not sending.\n"); in mei_cl_irq_write()
1877 hbuf_slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_write()
1884 dr_slots = mei_dma_ring_empty_slots(dev); in mei_cl_irq_write()
1913 } else if ((u32)hbuf_slots == mei_hbuf_depth(dev)) { in mei_cl_irq_write()
1923 mei_dma_ring_write(dev, buf->data + cb->buf_idx, buf_len); in mei_cl_irq_write()
1924 rets = mei_write_message(dev, mei_hdr, hdr_len, data, data_len); in mei_cl_irq_write()
1941 list_move_tail(&cb->list, &dev->write_waiting_list); in mei_cl_irq_write()
1967 struct mei_device *dev; in mei_cl_write() local
1981 if (WARN_ON(!cl || !cl->dev)) in mei_cl_write()
1987 dev = cl->dev; in mei_cl_write()
1992 cl_dbg(dev, cl, "buf_len=%zd\n", buf_len); in mei_cl_write()
1997 rets = pm_runtime_get(dev->dev); in mei_cl_write()
1999 pm_runtime_put_noidle(dev->dev); in mei_cl_write()
2000 cl_err(dev, cl, "rpm: get failed %zd\n", rets); in mei_cl_write()
2022 cl_dbg(dev, cl, "No flow control credentials: not sending.\n"); in mei_cl_write()
2027 if (!mei_hbuf_acquire(dev)) { in mei_cl_write()
2028 cl_dbg(dev, cl, "Cannot acquire the host buffer: not sending.\n"); in mei_cl_write()
2033 hbuf_slots = mei_hbuf_empty_slots(dev); in mei_cl_write()
2040 dr_slots = mei_dma_ring_empty_slots(dev); in mei_cl_write()
2064 mei_dma_ring_write(dev, buf->data, buf_len); in mei_cl_write()
2065 rets = mei_write_message(dev, mei_hdr, hdr_len, data, data_len); in mei_cl_write()
2081 mei_tx_cb_enqueue(cb, &dev->write_waiting_list); in mei_cl_write()
2083 mei_tx_cb_enqueue(cb, &dev->write_list); in mei_cl_write()
2088 mutex_unlock(&dev->device_lock); in mei_cl_write()
2093 mutex_lock(&dev->device_lock); in mei_cl_write()
2097 mei_io_tx_list_free_cl(&dev->write_list, cl, NULL); in mei_cl_write()
2098 mei_io_tx_list_free_cl(&dev->write_waiting_list, cl, NULL); in mei_cl_write()
2116 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_write()
2117 pm_runtime_mark_last_busy(dev->dev); in mei_cl_write()
2118 pm_runtime_put_autosuspend(dev->dev); in mei_cl_write()
2135 struct mei_device *dev = cl->dev; in mei_cl_complete() local
2144 pm_runtime_mark_last_busy(dev->dev); in mei_cl_complete()
2145 pm_request_autosuspend(dev->dev); in mei_cl_complete()
2183 void mei_cl_all_disconnect(struct mei_device *dev) in mei_cl_all_disconnect() argument
2187 list_for_each_entry(cl, &dev->file_list, link) in mei_cl_all_disconnect()
2192 static struct mei_cl *mei_cl_dma_map_find(struct mei_device *dev, u8 buffer_id) in mei_cl_dma_map_find() argument
2196 list_for_each_entry(cl, &dev->file_list, link) in mei_cl_dma_map_find()
2214 struct mei_device *dev = cl->dev; in mei_cl_irq_dma_map() local
2220 slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_dma_map()
2227 ret = mei_hbm_cl_dma_map_req(dev, cl); in mei_cl_irq_dma_map()
2234 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_irq_dma_map()
2250 struct mei_device *dev = cl->dev; in mei_cl_irq_dma_unmap() local
2256 slots = mei_hbuf_empty_slots(dev); in mei_cl_irq_dma_unmap()
2263 ret = mei_hbm_cl_dma_unmap_req(dev, cl); in mei_cl_irq_dma_unmap()
2270 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_irq_dma_unmap()
2276 cl->dma.vaddr = dmam_alloc_coherent(cl->dev->dev, size, in mei_cl_dma_alloc()
2290 dmam_free_coherent(cl->dev->dev, in mei_cl_dma_free()
2317 struct mei_device *dev; in mei_cl_dma_alloc_and_map() local
2321 if (WARN_ON(!cl || !cl->dev)) in mei_cl_dma_alloc_and_map()
2324 dev = cl->dev; in mei_cl_dma_alloc_and_map()
2326 if (!dev->hbm_f_cd_supported) { in mei_cl_dma_alloc_and_map()
2327 cl_dbg(dev, cl, "client dma is not supported\n"); in mei_cl_dma_alloc_and_map()
2340 if (mei_cl_dma_map_find(dev, buffer_id)) { in mei_cl_dma_alloc_and_map()
2341 cl_dbg(dev, cl, "client dma with id %d is already allocated\n", in mei_cl_dma_alloc_and_map()
2346 rets = pm_runtime_get(dev->dev); in mei_cl_dma_alloc_and_map()
2348 pm_runtime_put_noidle(dev->dev); in mei_cl_dma_alloc_and_map()
2349 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_dma_alloc_and_map()
2355 pm_runtime_put_noidle(dev->dev); in mei_cl_dma_alloc_and_map()
2365 if (mei_hbuf_acquire(dev)) { in mei_cl_dma_alloc_and_map()
2366 if (mei_hbm_cl_dma_map_req(dev, cl)) { in mei_cl_dma_alloc_and_map()
2370 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_dma_alloc_and_map()
2375 mutex_unlock(&dev->device_lock); in mei_cl_dma_alloc_and_map()
2378 dev->timeouts.cl_connect); in mei_cl_dma_alloc_and_map()
2379 mutex_lock(&dev->device_lock); in mei_cl_dma_alloc_and_map()
2390 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_dma_alloc_and_map()
2391 pm_runtime_mark_last_busy(dev->dev); in mei_cl_dma_alloc_and_map()
2392 pm_runtime_put_autosuspend(dev->dev); in mei_cl_dma_alloc_and_map()
2410 struct mei_device *dev; in mei_cl_dma_unmap() local
2414 if (WARN_ON(!cl || !cl->dev)) in mei_cl_dma_unmap()
2417 dev = cl->dev; in mei_cl_dma_unmap()
2419 if (!dev->hbm_f_cd_supported) { in mei_cl_dma_unmap()
2420 cl_dbg(dev, cl, "client dma is not supported\n"); in mei_cl_dma_unmap()
2431 rets = pm_runtime_get(dev->dev); in mei_cl_dma_unmap()
2433 pm_runtime_put_noidle(dev->dev); in mei_cl_dma_unmap()
2434 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_dma_unmap()
2444 if (mei_hbuf_acquire(dev)) { in mei_cl_dma_unmap()
2445 if (mei_hbm_cl_dma_unmap_req(dev, cl)) { in mei_cl_dma_unmap()
2449 list_move_tail(&cb->list, &dev->ctrl_rd_list); in mei_cl_dma_unmap()
2454 mutex_unlock(&dev->device_lock); in mei_cl_dma_unmap()
2457 dev->timeouts.cl_connect); in mei_cl_dma_unmap()
2458 mutex_lock(&dev->device_lock); in mei_cl_dma_unmap()
2468 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_dma_unmap()
2469 pm_runtime_mark_last_busy(dev->dev); in mei_cl_dma_unmap()
2470 pm_runtime_put_autosuspend(dev->dev); in mei_cl_dma_unmap()