summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2005-01-04 05:34:25 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:34:25 -0800
commit0090012b4a061c53ac2f2c9a4b2b413235aa7547 (patch)
tree33fef69de4f57aee26b8d2fc83a07c46ce495b13 /include/linux
parent956cdd1b90acdc646bd4c7d3066539859f8b0f62 (diff)
[PATCH] IRQ resource deallocation: ACPI
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: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 7a1b2cad5e07..8b5d1f25ba0e 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -428,6 +428,15 @@ static inline int acpi_boot_table_init(void)
unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
+/*
+ * This function undoes the effect of one call to acpi_register_gsi().
+ * If this matches the last registration, any IRQ resources for gsi
+ * are freed.
+ */
+#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
+void acpi_unregister_gsi (u32 gsi);
+#endif
+
#ifdef CONFIG_ACPI_PCI
struct acpi_prt_entry {
@@ -453,6 +462,10 @@ struct pci_dev;
int acpi_pci_irq_enable (struct pci_dev *dev);
void acpi_penalize_isa_irq(int irq);
+#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
+void acpi_pci_irq_disable (struct pci_dev *dev);
+#endif
+
struct acpi_pci_driver {
struct acpi_pci_driver *next;
int (*add)(acpi_handle handle);