From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: lenb@kernel.org, us15@os.inf.tu-dresden.de, gregkh@suse.de,
davej@redhat.com
Subject: [PATCH] reduce AER init error information
Date: Sun, 29 Apr 2007 15:38:04 +0800 [thread overview]
Message-ID: <1177832284.14017.270.camel@ymzhang> (raw)
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 <yanmin.zhang@intel.com>
---
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_
next reply other threads:[~2007-04-29 7:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-29 7:38 Zhang, Yanmin [this message]
2007-05-29 14:10 ` [PATCH] reduce AER init error information Michal Piotrowski
2007-05-29 15:57 ` Greg KH
2007-05-29 21:06 ` Linus Torvalds
2007-06-01 12:04 ` Greg KH
2007-06-04 3:49 ` Zhang, Yanmin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1177832284.14017.270.camel@ymzhang \
--to=yanmin_zhang@linux.intel.com \
--cc=davej@redhat.com \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=us15@os.inf.tu-dresden.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox