aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/aer/aerdrv_acpi.c
diff options
context:
space:
mode:
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>2007-06-05 23:44:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:08 -0400
commit8d29bfb79e632fe318f4c01c9c2e8faacb89b800 (patch)
tree696caa373f8340153bd18655ed4f61b035823f16 /drivers/pci/pcie/aer/aerdrv_acpi.c
parentf477836457730a2b925f625023ec4e5bf11015be (diff)
PCI: fix AER driver error information
Below patch fixes aer driver error information and enables aer driver although CONFIG_ACPI=n. As a matter of fact, the new patch is created from below 2 patches plus a minor patch apply fuzz fixing. Because the second patch fixed a compilation error introduced by the first patch, I merge them to facilitate bisect. 1) http://marc.info/?l=linux-kernel&m=117783233918191&w=2; 2) http://marc.info/?l=linux-mm-commits&m=118046936720790&w=2 Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pcie/aer/aerdrv_acpi.c')
-rw-r--r--drivers/pci/pcie/aer/aerdrv_acpi.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
index fa68e89ebec9..1a1eb45a779e 100644
--- a/drivers/pci/pcie/aer/aerdrv_acpi.c
+++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
@@ -20,19 +20,18 @@
20 20
21/** 21/**
22 * aer_osc_setup - run ACPI _OSC method 22 * aer_osc_setup - run ACPI _OSC method
23 * @pciedev: pcie_device which AER is being enabled on
23 * 24 *
24 * Return: 25 * @return: Zero on success. Nonzero otherwise.
25 * Zero if success. Nonzero for otherwise.
26 * 26 *
27 * Invoked when PCIE bus loads AER service driver. To avoid conflict with 27 * Invoked when PCIE bus loads AER service driver. To avoid conflict with
28 * BIOS AER support requires BIOS to yield AER control to OS native driver. 28 * BIOS AER support requires BIOS to yield AER control to OS native driver.
29 **/ 29 **/
30int aer_osc_setup(struct pci_dev *dev) 30int aer_osc_setup(struct pcie_device *pciedev)
31{ 31{
32 int retval = OSC_METHOD_RUN_SUCCESS; 32 acpi_status status = AE_NOT_FOUND;
33 acpi_status status; 33 struct pci_dev *pdev = pciedev->port;
34 acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); 34 acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev);
35 struct pci_dev *pdev = dev;
36 struct pci_bus *parent; 35 struct pci_bus *parent;
37 36
38 while (!handle) { 37 while (!handle) {
@@ -50,19 +49,20 @@ int aer_osc_setup(struct pci_dev *dev)
50 pdev = parent->self; 49 pdev = parent->self;
51 } 50 }
52 51
53 if (!handle) 52 if (handle) {
54 return OSC_METHOD_NOT_SUPPORTED; 53 pci_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
54 status = pci_osc_control_set(handle,
55 OSC_PCI_EXPRESS_AER_CONTROL |
56 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
57 }
55 58
56 pci_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
57 status = pci_osc_control_set(handle, OSC_PCI_EXPRESS_AER_CONTROL |
58 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
59 if (ACPI_FAILURE(status)) { 59 if (ACPI_FAILURE(status)) {
60 if (status == AE_SUPPORT) 60 printk(KERN_DEBUG "AER service couldn't init device %s - %s\n",
61 retval = OSC_METHOD_NOT_SUPPORTED; 61 pciedev->device.bus_id,
62 else 62 (status == AE_SUPPORT || status == AE_NOT_FOUND) ?
63 retval = OSC_METHOD_RUN_FAILURE; 63 "no _OSC support" : "Run ACPI _OSC fails");
64 return -1;
64 } 65 }
65 66
66 return retval; 67 return 0;
67} 68}
68