Lines Matching +full:irq +full:- +full:start

1 // SPDX-License-Identifier: GPL-2.0-only
3 * IRQ offload/bypass manager
10 * Interrupts on Intel VT-d systems can allow interrupts to be received
11 * directly by a virtual machine. ARM IRQ Forwarding allows forwarded physical
23 MODULE_DESCRIPTION("IRQ bypass manager utility module");
35 if (prod->stop) in __connect()
36 prod->stop(prod); in __connect()
37 if (cons->stop) in __connect()
38 cons->stop(cons); in __connect()
40 if (prod->add_consumer) in __connect()
41 ret = prod->add_consumer(prod, cons); in __connect()
44 ret = cons->add_producer(cons, prod); in __connect()
45 if (ret && prod->del_consumer) in __connect()
46 prod->del_consumer(prod, cons); in __connect()
49 if (cons->start) in __connect()
50 cons->start(cons); in __connect()
51 if (prod->start) in __connect()
52 prod->start(prod); in __connect()
55 prod->consumer = cons; in __connect()
56 cons->producer = prod; in __connect()
65 if (prod->stop) in __disconnect()
66 prod->stop(prod); in __disconnect()
67 if (cons->stop) in __disconnect()
68 cons->stop(cons); in __disconnect()
70 cons->del_producer(cons, prod); in __disconnect()
72 if (prod->del_consumer) in __disconnect()
73 prod->del_consumer(prod, cons); in __disconnect()
75 if (cons->start) in __disconnect()
76 cons->start(cons); in __disconnect()
77 if (prod->start) in __disconnect()
78 prod->start(prod); in __disconnect()
80 prod->consumer = NULL; in __disconnect()
81 cons->producer = NULL; in __disconnect()
85 * irq_bypass_register_producer - register IRQ bypass producer
88 * @irq: Linux IRQ number of the underlying producer device
90 * Add the provided IRQ producer to the set of producers and connect with the
94 struct eventfd_ctx *eventfd, int irq) in irq_bypass_register_producer()
100 if (WARN_ON_ONCE(producer->eventfd)) in irq_bypass_register_producer()
101 return -EINVAL; in irq_bypass_register_producer()
103 producer->irq = irq; in irq_bypass_register_producer()
120 producer->eventfd = eventfd; in irq_bypass_register_producer()
126 * irq_bypass_unregister_producer - unregister IRQ bypass producer
129 * Remove a previously registered IRQ producer (note, it's safe to call this
135 unsigned long index = (unsigned long)producer->eventfd; in irq_bypass_unregister_producer()
137 if (!producer->eventfd) in irq_bypass_unregister_producer()
142 if (producer->consumer) in irq_bypass_unregister_producer()
143 __disconnect(producer, producer->consumer); in irq_bypass_unregister_producer()
146 producer->eventfd = NULL; in irq_bypass_unregister_producer()
151 * irq_bypass_register_consumer - register IRQ bypass consumer
155 * Add the provided IRQ consumer to the set of consumers and connect with the
165 if (WARN_ON_ONCE(consumer->eventfd)) in irq_bypass_register_consumer()
166 return -EINVAL; in irq_bypass_register_consumer()
168 if (!consumer->add_producer || !consumer->del_producer) in irq_bypass_register_consumer()
169 return -EINVAL; in irq_bypass_register_consumer()
186 consumer->eventfd = eventfd; in irq_bypass_register_consumer()
192 * irq_bypass_unregister_consumer - unregister IRQ bypass consumer
195 * Remove a previously registered IRQ consumer (note, it's safe to call this
201 unsigned long index = (unsigned long)consumer->eventfd; in irq_bypass_unregister_consumer()
203 if (!consumer->eventfd) in irq_bypass_unregister_consumer()
208 if (consumer->producer) in irq_bypass_unregister_consumer()
209 __disconnect(consumer->producer, consumer); in irq_bypass_unregister_consumer()
212 consumer->eventfd = NULL; in irq_bypass_unregister_consumer()