linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Need advices about PCI IRQ reference count tracking
@ 2014-07-16  3:34 Jiang Liu
  2014-07-16 18:04 ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Jiang Liu @ 2014-07-16  3:34 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci@vger.kernel.org

Hi Bjorn,
	When enabling ACPI based IOAPIC hotplug, we encountered an
issue with PCI IRQ reference count tracking and need your advices.
	In order to hot-remove an IOAPIC, we need to track and keep
balance of IOAPIC pin usage count. But acpi_pci_irq_enable() may
be called twice for a PCI device,
1) pci_acpi_init() if pci_routeirq is true
2) pci_enable_device()

So in function acpi_pci_irq_enable(), we need a way to track whether
an IOAPIC IRQ has been assigned to the PCI device. Previously we check
"if (dev->irq > 0)" for that, but that's wrong because dev->irq may
be set to non-zero in pci_read_irq() if BIOS has already assigned
a legacy IRQ for the device. So is it OK to add a flag into pci_dev
to track this information?

Another possible workaround is to disable IOAPIC hotplug when
pci_routeirq is set, but that sounds not the best solution.

Regards!
Gerry

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-17  3:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16  3:34 Need advices about PCI IRQ reference count tracking Jiang Liu
2014-07-16 18:04 ` Bjorn Helgaas
2014-07-16 18:37   ` Yinghai Lu
2014-07-17  3:02     ` Jiang Liu
2014-07-17  3:06       ` Yinghai Lu
2014-07-17  3:14         ` Jiang Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).