Skip to content

Commit 6461934

Browse files
Marc ZyngierKAGA-KOKO
authored andcommitted
irqdomain: Let irq_find_host default to DOMAIN_BUS_WIRED
At the beginning of times, irq_find_host() was simple. Each device node implemented at most one irq domain, and we were happy. Over time, things have become more complex, and we now have nodes implementing a plurality of domains, tagged by "bus_token". Crutially, users of irq_find_host() all expect the most basic domain to be returned, and not any other domain such as a bus-specific MSI domain. So let's change irq_find_host() to first look for a DOMAIN_BUS_WIRED domain, and only if this fails fallback to DOMAIN_BUS_ANY. Note that this is consistent with what irq_create_fwspec_mapping is already doing, see 530cbe1 ("irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token"). Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Rob Herring <robh@kernel.org> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lkml.kernel.org/r/20180508121438.11301-6-marc.zyngier@arm.com
1 parent 8a22a3e commit 6461934

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/linux/irqdomain.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,13 @@ static inline struct irq_domain *irq_find_matching_host(struct device_node *node
301301

302302
static inline struct irq_domain *irq_find_host(struct device_node *node)
303303
{
304-
return irq_find_matching_host(node, DOMAIN_BUS_ANY);
304+
struct irq_domain *d;
305+
306+
d = irq_find_matching_host(node, DOMAIN_BUS_WIRED);
307+
if (!d)
308+
d = irq_find_matching_host(node, DOMAIN_BUS_ANY);
309+
310+
return d;
305311
}
306312

307313
/**

0 commit comments

Comments
 (0)