Name: add_pcibios_disable_device_hook.patch Kernel Version: 2.6.9-rc2-mm1 Depends: none Change Log: - Chaged to use __attrubute__ ((weak)) instead of modifying all arch specific code. Description: This patch adds a hook 'pcibios_disable_device()' into pci_disable_device() to call architecture specific PCI resource deallocation code. It's a opposite part of pcibios_enable_device(). We need this hook to deallocate architecture specific PCI resource such as IRQ resource, etc.. This patch is just for adding the hook, so 'pcibios_disable_device()' is defined as a null function on all architecture so far. I tested this patch on i386, x86_64 and ia64. But it has not been tested on other architectures because I don't have these machines. Signed-off-by: Kenji Kaneshige --- linux-2.6.9-rc2-mm1-kanesige/drivers/pci/pci.c | 12 ++++++++++++ 1 files changed, 12 insertions(+) diff -puN drivers/pci/pci.c~add_pcibios_disable_device_hook drivers/pci/pci.c --- linux-2.6.9-rc2-mm1/drivers/pci/pci.c~add_pcibios_disable_device_hook 2004-09-27 11:10:54.000000000 +0900 +++ linux-2.6.9-rc2-mm1-kanesige/drivers/pci/pci.c 2004-09-27 16:24:43.944414436 +0900 @@ -392,6 +392,16 @@ pci_enable_device(struct pci_dev *dev) } /** + * pcibios_disable_device - disable arch specific PCI resources for device dev + * @dev: the PCI device to disable + * + * Disables architecture specific PCI resources for the device. This + * is the default implementation. Architecture implementations can + * override this. + */ +void __attribute__ ((weak)) pcibios_disable_device (struct pci_dev *dev) {} + +/** * pci_disable_device - Disable PCI device after use * @dev: PCI device to be disabled * @@ -411,6 +421,8 @@ pci_disable_device(struct pci_dev *dev) pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } + + pcibios_disable_device(dev); } /** _