diff options
-rw-r--r-- | include/linux/irqdomain.h | 1 | ||||
-rw-r--r-- | kernel/irq/irqdomain.c | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index bc2f5719dace..188eced6813e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -222,6 +222,7 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, | |||
222 | void *host_data); | 222 | void *host_data); |
223 | extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, | 223 | extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, |
224 | enum irq_domain_bus_token bus_token); | 224 | enum irq_domain_bus_token bus_token); |
225 | extern bool irq_domain_check_msi_remap(void); | ||
225 | extern void irq_set_default_host(struct irq_domain *host); | 226 | extern void irq_set_default_host(struct irq_domain *host); |
226 | extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs, | 227 | extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs, |
227 | irq_hw_number_t hwirq, int node, | 228 | irq_hw_number_t hwirq, int node, |
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 876e13172dc8..80c4f9312187 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -278,6 +278,31 @@ struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, | |||
278 | EXPORT_SYMBOL_GPL(irq_find_matching_fwspec); | 278 | EXPORT_SYMBOL_GPL(irq_find_matching_fwspec); |
279 | 279 | ||
280 | /** | 280 | /** |
281 | * irq_domain_check_msi_remap - Check whether all MSI irq domains implement | ||
282 | * IRQ remapping | ||
283 | * | ||
284 | * Return: false if any MSI irq domain does not support IRQ remapping, | ||
285 | * true otherwise (including if there is no MSI irq domain) | ||
286 | */ | ||
287 | bool irq_domain_check_msi_remap(void) | ||
288 | { | ||
289 | struct irq_domain *h; | ||
290 | bool ret = true; | ||
291 | |||
292 | mutex_lock(&irq_domain_mutex); | ||
293 | list_for_each_entry(h, &irq_domain_list, link) { | ||
294 | if (irq_domain_is_msi(h) && | ||
295 | !irq_domain_hierarchical_is_msi_remap(h)) { | ||
296 | ret = false; | ||
297 | break; | ||
298 | } | ||
299 | } | ||
300 | mutex_unlock(&irq_domain_mutex); | ||
301 | return ret; | ||
302 | } | ||
303 | EXPORT_SYMBOL_GPL(irq_domain_check_msi_remap); | ||
304 | |||
305 | /** | ||
281 | * irq_set_default_host() - Set a "default" irq domain | 306 | * irq_set_default_host() - Set a "default" irq domain |
282 | * @domain: default domain pointer | 307 | * @domain: default domain pointer |
283 | * | 308 | * |