[PATCH] reduce AER init error information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PCI-Express AER support in kernel requires BIOS to provide _OSC support
to allow the AER Root port service driver to request for native control
of AER. If a root port supports AER capablity, but BIOS doesn't provide
_OSC for it, aerdriver will print many debug information to system console.
Below is a log example.

*******************Error information example************
Evaluate _OSC Set fails. Status = 0x0005
Evaluate _OSC Set fails. Status = 0x0005
aer_init: AER service init fails - Run ACPI _OSC fails
aer: probe of 0000:00:02.0:pcie01 failed with error 2
Evaluate _OSC Set fails. Status = 0x0005
Evaluate _OSC Set fails. Status = 0x0005
aer_init: AER service init fails - Run ACPI _OSC fails
aer: probe of 0000:00:04.0:pcie01 failed with error 2
Evaluate _OSC Set fails. Status = 0x0005
Evaluate _OSC Set fails. Status = 0x0005
aer_init: AER service init fails - Run ACPI _OSC fails
aer: probe of 0000:00:06.0:pcie01 failed with error 2
******************End of Error information example******


As _OSC is an optional capability of BIOS, such error information looks
like overly-verbosed. The patch against kernel 2.6.21 changes it to just
print one line report messages if aerdriver fails to attach the root port
service device.

Below is an example of new output.
AER service couldn't init device 0000:00:02.0:pcie01 - no _OSC support


Signed-off-by: Zhang Yanmin <[email protected]>

---

diff -Nraup linux-2.6.21/drivers/pci/pci-acpi.c linux-2.6.21_aer/drivers/pci/pci-acpi.c
--- linux-2.6.21/drivers/pci/pci-acpi.c	2007-02-05 02:44:54.000000000 +0800
+++ linux-2.6.21_aer/drivers/pci/pci-acpi.c	2007-04-30 22:03:08.000000000 +0800
@@ -55,8 +55,6 @@ acpi_query_osc (
 
 	status = acpi_evaluate_object(handle, "_OSC", &input, &output);
 	if (ACPI_FAILURE (status)) {
-		printk(KERN_DEBUG  
-			"Evaluate _OSC Set fails. Status = 0x%04x\n", status);
 		*ret_status = status;
 		return status;
 	}
@@ -124,11 +122,9 @@ acpi_run_osc (
 	in_params[3].buffer.pointer 	= (u8 *)context;
 
 	status = acpi_evaluate_object(handle, "_OSC", &input, &output);
-	if (ACPI_FAILURE (status)) {
-		printk(KERN_DEBUG  
-			"Evaluate _OSC Set fails. Status = 0x%04x\n", status);
+	if (ACPI_FAILURE (status))
 		return status;
-	}
+
 	out_obj = output.pointer;
 	if (out_obj->type != ACPI_TYPE_BUFFER) {
 		printk(KERN_DEBUG  
diff -Nraup linux-2.6.21/drivers/pci/pcie/aer/aerdrv_acpi.c linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv_acpi.c
--- linux-2.6.21/drivers/pci/pcie/aer/aerdrv_acpi.c	2007-02-05 02:44:54.000000000 +0800
+++ linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv_acpi.c	2007-04-30 21:06:43.000000000 +0800
@@ -27,10 +27,9 @@
  * Invoked when PCIE bus loads AER service driver. To avoid conflict with
  * BIOS AER support requires BIOS to yield AER control to OS native driver.
  **/
-int aer_osc_setup(struct pci_dev *dev)
+acpi_status aer_osc_setup(struct pci_dev *dev)
 {
-	int retval = OSC_METHOD_RUN_SUCCESS;
-	acpi_status status;
+	acpi_status status = AE_NOT_FOUND;
 	acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
 	struct pci_dev *pdev = dev;
 	struct pci_bus *parent;
@@ -51,18 +50,12 @@ int aer_osc_setup(struct pci_dev *dev)
 	}
 
 	if (!handle)
-		return OSC_METHOD_NOT_SUPPORTED;
+		return status;
 
 	pci_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
 	status = pci_osc_control_set(handle, OSC_PCI_EXPRESS_AER_CONTROL |
 		OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
-	if (ACPI_FAILURE(status)) {
-		if (status == AE_SUPPORT)
-			retval = OSC_METHOD_NOT_SUPPORTED;
-	 	else
-			retval = OSC_METHOD_RUN_FAILURE;
-	}
 
-	return retval;
+	return status;
 }
 
diff -Nraup linux-2.6.21/drivers/pci/pcie/aer/aerdrv_core.c linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv_core.c
--- linux-2.6.21/drivers/pci/pcie/aer/aerdrv_core.c	2007-02-05 02:44:54.000000000 +0800
+++ linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv_core.c	2007-04-30 22:33:16.000000000 +0800
@@ -733,19 +733,19 @@ void aer_delete_rootport(struct aer_rpc 
  **/
 int aer_init(struct pcie_device *dev)
 {
-	int status;
+	acpi_status	status;
 
 	/* Run _OSC Method */
 	status = aer_osc_setup(dev->port);
 
-	if(status != OSC_METHOD_RUN_SUCCESS) {
-		printk(KERN_DEBUG "%s: AER service init fails - %s\n",
-		__FUNCTION__,
-		(status == OSC_METHOD_NOT_SUPPORTED) ?
-			"No ACPI _OSC support" : "Run ACPI _OSC fails");
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_DEBUG "AER service couldn't init device %s - %s\n",
+		    dev->device.bus_id,
+		    (status == AE_SUPPORT || status == AE_NOT_FOUND) ?
+		    "no _OSC support" : "Run ACPI _OSC fails");
 
 		if (!forceload)
-			return status;
+			return -ENXIO;
 	}
 
 	return AER_SUCCESS;
diff -Nraup linux-2.6.21/drivers/pci/pcie/aer/aerdrv.h linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv.h
--- linux-2.6.21/drivers/pci/pcie/aer/aerdrv.h	2007-04-30 20:25:38.000000000 +0800
+++ linux-2.6.21_aer/drivers/pci/pcie/aer/aerdrv.h	2007-04-30 21:26:43.000000000 +0800
@@ -9,6 +9,8 @@
 #define _AERDRV_H_
 
 #include <linux/pcieport_if.h>
+#include <linux/acpi.h>
+#include <linux/pci-acpi.h>
 #include <linux/aer.h>
 
 #define AER_NONFATAL			0
@@ -18,10 +20,6 @@
 #define AER_ERROR_MASK			0x001fffff
 #define AER_ERROR(d)			(d & AER_ERROR_MASK)
 
-#define OSC_METHOD_RUN_SUCCESS		0
-#define OSC_METHOD_NOT_SUPPORTED	1
-#define OSC_METHOD_RUN_FAILURE		2
-
 /* Root Error Status Register Bits */
 #define ROOT_ERR_STATUS_MASKS			0x0f
 
@@ -120,6 +118,6 @@ extern void aer_delete_rootport(struct a
 extern int aer_init(struct pcie_device *dev);
 extern void aer_isr(struct work_struct *work);
 extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
-extern int aer_osc_setup(struct pci_dev *dev);
+extern acpi_status aer_osc_setup(struct pci_dev *dev);
 
 #endif //_AERDRV_H_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux