• Kenji Kaneshige's avatar
    [PATCH] IRQ resource deallocation: ACPI · 0090012b
    Kenji Kaneshige authored
    Architecture dependent IRQ resources such as interrupt vector for PCI
    devices are allocated at pci_enable_device() time on i386, x86-64 and
    ia64 platform. Today, however, these IRQ resources are never
    deallocated even if they are no longer used. The following set of
    patches adds supports to deallocate IRQ resources at
    pci_disable_device() time.
    
    The motivation of the set of patches is as follows:
    
        - IRQ resources such as interrupt vectors should be freed if they
          are no longer used because the amount of these resources are
          limited. By deallocating IRQ resources, we can recycle them.
    
        - I think some hardwares will support hot-pluggable I/O units with
          I/O xAPICs in the near future. So I/O xAPIC hot-plug support by
          OS will be needed soon. IRQ resouces deallocation will be one of
          the most important stuff for I/O xAPIC hot-plug.
    
    For now, the following set of patches has ia64 implementation only.
    i386 and x86_64 implementations are TBD.
    
    
    
    
    This patch is ACPI portion of IRQ deallocation. This patch defines the
    following new interface. The implementation of this interface depends
    on each platform.
    
        o void acpi_unregister_gsi(u32 gsi)
    
            This is a opposite portion of acpi_register_gsi(). This has a
            responsibility for deallocating IRQ resources associated with
            the specified GSI number.
    
            We need to consider the case of shared interrupt. In the case
            of shared interrupt, acpi_register_gsi() is called multiple
            times for one gsi. That is, registrations and unregistrations
            can be nested.
    
            This function undoes the effect of one call to
            acpi_register_gsi(). If this matches the last registration,
            IRQ resources associated with the specified GSI number are
            freed.
    
    This patch also adds the following new function.
    
        o void acpi_pci_irq_disable (struct pci_dev *dev)
    
            This function is a opposite portion of
            acpi_pci_enable_irq(). It clears the device's linux IRQ number
            and calls acpi_unregister_gsi() to deallocate IRQ resources.
    Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    0090012b
pci_irq.c 12.7 KB