diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-06-19 19:37:14 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-06-22 12:21:11 -0400 |
commit | f8f37ca78915b51a73bf240409fcda30d811b76b (patch) | |
tree | 4b18d25fdeb18fe640af6357a00d698ea2de74cf /arch/x86 | |
parent | 0323b9690448e1d1ada91dac9d8fa62f7285751a (diff) |
x86/msi: Create named irq domains
Use the fwnode to create named irq domains so diagnosis works.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235444.299024560@linutronix.de
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic/msi.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index d79dc2afa536..9b18be764422 100644 --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c | |||
@@ -136,13 +136,20 @@ static struct msi_domain_info pci_msi_domain_info = { | |||
136 | .handler_name = "edge", | 136 | .handler_name = "edge", |
137 | }; | 137 | }; |
138 | 138 | ||
139 | void arch_init_msi_domain(struct irq_domain *parent) | 139 | void __init arch_init_msi_domain(struct irq_domain *parent) |
140 | { | 140 | { |
141 | struct fwnode_handle *fn; | ||
142 | |||
141 | if (disable_apic) | 143 | if (disable_apic) |
142 | return; | 144 | return; |
143 | 145 | ||
144 | msi_default_domain = pci_msi_create_irq_domain(NULL, | 146 | fn = irq_domain_alloc_named_fwnode("PCI-MSI"); |
145 | &pci_msi_domain_info, parent); | 147 | if (fn) { |
148 | msi_default_domain = | ||
149 | pci_msi_create_irq_domain(fn, &pci_msi_domain_info, | ||
150 | parent); | ||
151 | irq_domain_free_fwnode(fn); | ||
152 | } | ||
146 | if (!msi_default_domain) | 153 | if (!msi_default_domain) |
147 | pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n"); | 154 | pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n"); |
148 | } | 155 | } |
@@ -230,13 +237,20 @@ static struct irq_domain *dmar_get_irq_domain(void) | |||
230 | { | 237 | { |
231 | static struct irq_domain *dmar_domain; | 238 | static struct irq_domain *dmar_domain; |
232 | static DEFINE_MUTEX(dmar_lock); | 239 | static DEFINE_MUTEX(dmar_lock); |
240 | struct fwnode_handle *fn; | ||
233 | 241 | ||
234 | mutex_lock(&dmar_lock); | 242 | mutex_lock(&dmar_lock); |
235 | if (dmar_domain == NULL) | 243 | if (dmar_domain) |
236 | dmar_domain = msi_create_irq_domain(NULL, &dmar_msi_domain_info, | 244 | goto out; |
245 | |||
246 | fn = irq_domain_alloc_named_fwnode("DMAR-MSI"); | ||
247 | if (fn) { | ||
248 | dmar_domain = msi_create_irq_domain(fn, &dmar_msi_domain_info, | ||
237 | x86_vector_domain); | 249 | x86_vector_domain); |
250 | irq_domain_free_fwnode(fn); | ||
251 | } | ||
252 | out: | ||
238 | mutex_unlock(&dmar_lock); | 253 | mutex_unlock(&dmar_lock); |
239 | |||
240 | return dmar_domain; | 254 | return dmar_domain; |
241 | } | 255 | } |
242 | 256 | ||
@@ -326,9 +340,10 @@ static struct msi_domain_info hpet_msi_domain_info = { | |||
326 | 340 | ||
327 | struct irq_domain *hpet_create_irq_domain(int hpet_id) | 341 | struct irq_domain *hpet_create_irq_domain(int hpet_id) |
328 | { | 342 | { |
329 | struct irq_domain *parent; | ||
330 | struct irq_alloc_info info; | ||
331 | struct msi_domain_info *domain_info; | 343 | struct msi_domain_info *domain_info; |
344 | struct irq_domain *parent, *d; | ||
345 | struct irq_alloc_info info; | ||
346 | struct fwnode_handle *fn; | ||
332 | 347 | ||
333 | if (x86_vector_domain == NULL) | 348 | if (x86_vector_domain == NULL) |
334 | return NULL; | 349 | return NULL; |
@@ -349,7 +364,16 @@ struct irq_domain *hpet_create_irq_domain(int hpet_id) | |||
349 | else | 364 | else |
350 | hpet_msi_controller.name = "IR-HPET-MSI"; | 365 | hpet_msi_controller.name = "IR-HPET-MSI"; |
351 | 366 | ||
352 | return msi_create_irq_domain(NULL, domain_info, parent); | 367 | fn = irq_domain_alloc_named_id_fwnode(hpet_msi_controller.name, |
368 | hpet_id); | ||
369 | if (!fn) { | ||
370 | kfree(domain_info); | ||
371 | return NULL; | ||
372 | } | ||
373 | |||
374 | d = msi_create_irq_domain(fn, domain_info, parent); | ||
375 | irq_domain_free_fwnode(fn); | ||
376 | return d; | ||
353 | } | 377 | } |
354 | 378 | ||
355 | int hpet_assign_irq(struct irq_domain *domain, struct hpet_dev *dev, | 379 | int hpet_assign_irq(struct irq_domain *domain, struct hpet_dev *dev, |