Lines Matching refs:node
53 int kfd_interrupt_init(struct kfd_node *node) in kfd_interrupt_init() argument
57 r = kfifo_alloc(&node->ih_fifo, in kfd_interrupt_init()
58 KFD_IH_NUM_ENTRIES * node->kfd->device_info.ih_ring_entry_size, in kfd_interrupt_init()
61 dev_err(node->adev->dev, "Failed to allocate IH fifo\n"); in kfd_interrupt_init()
65 if (!node->kfd->ih_wq) { in kfd_interrupt_init()
66 node->kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI | WQ_UNBOUND, in kfd_interrupt_init()
67 node->kfd->num_nodes); in kfd_interrupt_init()
68 if (unlikely(!node->kfd->ih_wq)) { in kfd_interrupt_init()
69 kfifo_free(&node->ih_fifo); in kfd_interrupt_init()
70 dev_err(node->adev->dev, "Failed to allocate KFD IH workqueue\n"); in kfd_interrupt_init()
74 spin_lock_init(&node->interrupt_lock); in kfd_interrupt_init()
76 INIT_WORK(&node->interrupt_work, interrupt_wq); in kfd_interrupt_init()
78 node->interrupts_active = true; in kfd_interrupt_init()
90 void kfd_interrupt_exit(struct kfd_node *node) in kfd_interrupt_exit() argument
99 spin_lock_irqsave(&node->interrupt_lock, flags); in kfd_interrupt_exit()
100 node->interrupts_active = false; in kfd_interrupt_exit()
101 spin_unlock_irqrestore(&node->interrupt_lock, flags); in kfd_interrupt_exit()
102 kfifo_free(&node->ih_fifo); in kfd_interrupt_exit()
108 bool enqueue_ih_ring_entry(struct kfd_node *node, const void *ih_ring_entry) in enqueue_ih_ring_entry() argument
110 if (kfifo_is_full(&node->ih_fifo)) { in enqueue_ih_ring_entry()
111 dev_warn_ratelimited(node->adev->dev, "KFD node %d ih_fifo overflow\n", in enqueue_ih_ring_entry()
112 node->node_id); in enqueue_ih_ring_entry()
116 kfifo_in(&node->ih_fifo, ih_ring_entry, node->kfd->device_info.ih_ring_entry_size); in enqueue_ih_ring_entry()
123 static bool dequeue_ih_ring_entry(struct kfd_node *node, u32 **ih_ring_entry) in dequeue_ih_ring_entry() argument
127 if (kfifo_is_empty(&node->ih_fifo)) in dequeue_ih_ring_entry()
130 count = kfifo_out_linear_ptr(&node->ih_fifo, ih_ring_entry, in dequeue_ih_ring_entry()
131 node->kfd->device_info.ih_ring_entry_size); in dequeue_ih_ring_entry()
132 WARN_ON(count != node->kfd->device_info.ih_ring_entry_size); in dequeue_ih_ring_entry()
133 return count == node->kfd->device_info.ih_ring_entry_size; in dequeue_ih_ring_entry()