diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2005-09-28 16:03:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 18:36:58 -0400 |
commit | fe89cf4c4b7a3d9a0ff95eb0506aa7c9baaccda1 (patch) | |
tree | 496c9092452395e6d616adedab53e7ac85b199b6 /drivers/pci/hotplug | |
parent | c8920f0c8b3b42537ab4a54ff92c11daf48fdfec (diff) |
[PATCH] cpqphp: add pci_enable_device()
Add pci_{enable,disable}_device() calls. Without pci_enable_device(),
dev->irq is garbage, and cpqphp relies on it.
This fixes a problem reported by Bruno Redondi. He reported a flood
of ACPI interrupts, that caused kacpid to run 100% of the time:
http://bugzilla.kernel.org/show_bug.cgi?id=5312
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/cpqphp_core.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 8c6d3987d461..9aed8efe6a11 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -794,12 +794,21 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
794 | u32 rc; | 794 | u32 rc; |
795 | struct controller *ctrl; | 795 | struct controller *ctrl; |
796 | struct pci_func *func; | 796 | struct pci_func *func; |
797 | int err; | ||
798 | |||
799 | err = pci_enable_device(pdev); | ||
800 | if (err) { | ||
801 | printk(KERN_ERR MY_NAME ": cannot enable PCI device %s (%d)\n", | ||
802 | pci_name(pdev), err); | ||
803 | return err; | ||
804 | } | ||
797 | 805 | ||
798 | // Need to read VID early b/c it's used to differentiate CPQ and INTC discovery | 806 | // Need to read VID early b/c it's used to differentiate CPQ and INTC discovery |
799 | rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); | 807 | rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); |
800 | if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { | 808 | if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { |
801 | err(msg_HPC_non_compaq_or_intel); | 809 | err(msg_HPC_non_compaq_or_intel); |
802 | return -ENODEV; | 810 | rc = -ENODEV; |
811 | goto err_disable_device; | ||
803 | } | 812 | } |
804 | dbg("Vendor ID: %x\n", vendor_id); | 813 | dbg("Vendor ID: %x\n", vendor_id); |
805 | 814 | ||
@@ -807,7 +816,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
807 | dbg("revision: %d\n", rev); | 816 | dbg("revision: %d\n", rev); |
808 | if (rc || ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!rev))) { | 817 | if (rc || ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!rev))) { |
809 | err(msg_HPC_rev_error); | 818 | err(msg_HPC_rev_error); |
810 | return -ENODEV; | 819 | rc = -ENODEV; |
820 | goto err_disable_device; | ||
811 | } | 821 | } |
812 | 822 | ||
813 | /* Check for the proper subsytem ID's | 823 | /* Check for the proper subsytem ID's |
@@ -820,18 +830,20 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
820 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); | 830 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); |
821 | if (rc) { | 831 | if (rc) { |
822 | err("%s : pci_read_config_word failed\n", __FUNCTION__); | 832 | err("%s : pci_read_config_word failed\n", __FUNCTION__); |
823 | return rc; | 833 | goto err_disable_device; |
824 | } | 834 | } |
825 | dbg("Subsystem Vendor ID: %x\n", subsystem_vid); | 835 | dbg("Subsystem Vendor ID: %x\n", subsystem_vid); |
826 | if ((subsystem_vid != PCI_VENDOR_ID_COMPAQ) && (subsystem_vid != PCI_VENDOR_ID_INTEL)) { | 836 | if ((subsystem_vid != PCI_VENDOR_ID_COMPAQ) && (subsystem_vid != PCI_VENDOR_ID_INTEL)) { |
827 | err(msg_HPC_non_compaq_or_intel); | 837 | err(msg_HPC_non_compaq_or_intel); |
828 | return -ENODEV; | 838 | rc = -ENODEV; |
839 | goto err_disable_device; | ||
829 | } | 840 | } |
830 | 841 | ||
831 | ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); | 842 | ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); |
832 | if (!ctrl) { | 843 | if (!ctrl) { |
833 | err("%s : out of memory\n", __FUNCTION__); | 844 | err("%s : out of memory\n", __FUNCTION__); |
834 | return -ENOMEM; | 845 | rc = -ENOMEM; |
846 | goto err_disable_device; | ||
835 | } | 847 | } |
836 | memset(ctrl, 0, sizeof(struct controller)); | 848 | memset(ctrl, 0, sizeof(struct controller)); |
837 | 849 | ||
@@ -1264,6 +1276,8 @@ err_free_bus: | |||
1264 | kfree(ctrl->pci_bus); | 1276 | kfree(ctrl->pci_bus); |
1265 | err_free_ctrl: | 1277 | err_free_ctrl: |
1266 | kfree(ctrl); | 1278 | kfree(ctrl); |
1279 | err_disable_device: | ||
1280 | pci_disable_device(pdev); | ||
1267 | return rc; | 1281 | return rc; |
1268 | } | 1282 | } |
1269 | 1283 | ||