linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <jiang.liu@linux.intel.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: Need advices about PCI IRQ reference count tracking
Date: Thu, 17 Jul 2014 11:14:28 +0800	[thread overview]
Message-ID: <53C73F94.7060500@linux.intel.com> (raw)
In-Reply-To: <CAE9FiQX3nTCXvwfUwz9vx4HmO_mdUaFg57qN_YR-cYN0qWpQpg@mail.gmail.com>



On 2014/7/17 11:06, Yinghai Lu wrote:
> On Wed, Jul 16, 2014 at 8:02 PM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
>>
>>
>> On 2014/7/17 2:37, Yinghai Lu wrote:
>>> On Wed, Jul 16, 2014 at 11:04 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>>> [+cc Yinghai]
>>>>
>>>> On Tue, Jul 15, 2014 at 9:34 PM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
>>>>> 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?
>>>
>>> Why do you need to track it?
>>>
>>> When do you hot-remove ioapic with pci root bus, all the drivers for
>>> devices on that pci root bus should be stopped at first, so no one
>>> will use the ioapic before ioapic is being removed.
>> Hi Yinghai,
>>         By tracking IOAPIC pin usage count, we could release the
>> assigned IRQ number when there are no device uses an IOAPIC pin anymore.
> 
> Delay releasing IRQ number later when destroying irq domain?
Hi Yinghai,
	We could release IRQ number at runtime not only for IOAPIC
hotplug, but also for PCI device hotplug. For example, release IRQ
number if an IOAPIC pin is not used anymore after hot-removal of
a PCI device.

Regards!
Gerry

> 
> Yinghai
> 

      reply	other threads:[~2014-07-17  3:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C73F94.7060500@linux.intel.com \
    --to=jiang.liu@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).