Lines Matching +full:single +full:- +full:chip

1 // SPDX-License-Identifier: GPL-2.0
15 * irq_reserve_ipi() - Setup an IPI to destination cpumask
32 return -EINVAL; in irq_reserve_ipi()
37 return -EINVAL; in irq_reserve_ipi()
43 return -EINVAL; in irq_reserve_ipi()
48 * If the underlying implementation uses a single HW irq on in irq_reserve_ipi()
49 * all cpus then we only need a single Linux irq number for in irq_reserve_ipi()
74 return -EINVAL; in irq_reserve_ipi()
78 virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE, NULL); in irq_reserve_ipi()
81 return -ENOMEM; in irq_reserve_ipi()
94 cpumask_copy(data->common->affinity, dest); in irq_reserve_ipi()
95 data->common->ipi_offset = offset; in irq_reserve_ipi()
102 return -EBUSY; in irq_reserve_ipi()
106 * irq_destroy_ipi() - unreserve an IPI that was previously allocated
123 return -EINVAL; in irq_destroy_ipi()
125 domain = data->domain; in irq_destroy_ipi()
127 return -EINVAL; in irq_destroy_ipi()
131 return -EINVAL; in irq_destroy_ipi()
140 return -EINVAL; in irq_destroy_ipi()
143 irq = irq + cpumask_first(dest) - data->common->ipi_offset; in irq_destroy_ipi()
154 * ipi_get_hwirq - Get the hwirq associated with an IPI to a CPU
178 * a single hardware irq for all cpus then the IPI send mechanism in ipi_get_hwirq()
181 if (irq_domain_is_ipi_per_cpu(data->domain)) in ipi_get_hwirq()
182 data = irq_get_irq_data(irq + cpu - data->common->ipi_offset); in ipi_get_hwirq()
188 static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data, in ipi_send_verify() argument
193 if (!chip || !data) in ipi_send_verify()
194 return -EINVAL; in ipi_send_verify()
196 if (!chip->ipi_send_single && !chip->ipi_send_mask) in ipi_send_verify()
197 return -EINVAL; in ipi_send_verify()
200 return -EINVAL; in ipi_send_verify()
204 return -EINVAL; in ipi_send_verify()
208 return -EINVAL; in ipi_send_verify()
211 return -EINVAL; in ipi_send_verify()
217 * __ipi_send_single - send an IPI to a target Linux SMP CPU
230 struct irq_chip *chip = irq_data_get_irq_chip(data); in __ipi_send_single() local
238 if (WARN_ON_ONCE(ipi_send_verify(chip, data, NULL, cpu))) in __ipi_send_single()
239 return -EINVAL; in __ipi_send_single()
241 if (!chip->ipi_send_single) { in __ipi_send_single()
242 chip->ipi_send_mask(data, cpumask_of(cpu)); in __ipi_send_single()
247 if (irq_domain_is_ipi_per_cpu(data->domain) && in __ipi_send_single()
248 cpu != data->common->ipi_offset) { in __ipi_send_single()
250 unsigned irq = data->irq + cpu - data->common->ipi_offset; in __ipi_send_single()
254 chip->ipi_send_single(data, cpu); in __ipi_send_single()
259 * __ipi_send_mask - send an IPI to target Linux SMP CPU(s)
272 struct irq_chip *chip = irq_data_get_irq_chip(data); in __ipi_send_mask() local
281 if (WARN_ON_ONCE(ipi_send_verify(chip, data, dest, 0))) in __ipi_send_mask()
282 return -EINVAL; in __ipi_send_mask()
284 if (chip->ipi_send_mask) { in __ipi_send_mask()
285 chip->ipi_send_mask(data, dest); in __ipi_send_mask()
289 if (irq_domain_is_ipi_per_cpu(data->domain)) { in __ipi_send_mask()
290 unsigned int base = data->irq; in __ipi_send_mask()
293 unsigned irq = base + cpu - data->common->ipi_offset; in __ipi_send_mask()
296 chip->ipi_send_single(data, cpu); in __ipi_send_mask()
300 chip->ipi_send_single(data, cpu); in __ipi_send_mask()
306 * ipi_send_single - Send an IPI to a single CPU
317 struct irq_chip *chip = data ? irq_data_get_irq_chip(data) : NULL; in ipi_send_single() local
319 if (WARN_ON_ONCE(ipi_send_verify(chip, data, NULL, cpu))) in ipi_send_single()
320 return -EINVAL; in ipi_send_single()
327 * ipi_send_mask - Send an IPI to target CPU(s)
338 struct irq_chip *chip = data ? irq_data_get_irq_chip(data) : NULL; in ipi_send_mask() local
340 if (WARN_ON_ONCE(ipi_send_verify(chip, data, dest, 0))) in ipi_send_mask()
341 return -EINVAL; in ipi_send_mask()