* [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
@ 2008-04-09 15:42 NoWhereMan
2008-04-09 23:12 ` Andrew Morton
0 siblings, 1 reply; 7+ messages in thread
From: NoWhereMan @ 2008-04-09 15:42 UTC (permalink / raw)
To: linux-kernel
>From : Edoardo Vacchi <uncommonnonsense@gmail.com>
When acpi_pci_link_crs_ignore is passed at boot to the kernel,
ignores the error about the _CRS method of LINK device and selects
IRQ from possible IRQ list returned by _PRS method.
Signed-off-by: Edoardo Vacchi <uncommonnonsense@gmail.com>
---
This is nothing more than the patch on comment #127 on bug #8896
http://bugzilla.kernel.org/show_bug.cgi?id=8896#c127
originally by Zhao Yakui <yakui.zhao@intel.com>
ported to 2.6.25 and wrapped into an additional check for the kernel parameter
(plus of course the defintion of the kernel param itself)
The patch provides a workaround for some buggy BIOSes such as Insyde
in Packard Bell EasyNote r1938 (of which I'm an unfortunate owner),
while still keeping boot safe for people not suffering from this bug
---
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 233c40c..ed54c63 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -297,6 +297,16 @@ static int acpi_pci_link_get_current(struct
acpi_pci_link *link)
return result;
}
+
+/*
+ * this is set when acpi_pci_link_crs_ignore is passed on boot
+ * it will ignore the -ENODEV error on buggy BIOSes
+ *
+ * workaround for bug #8896
+ *
+ */
+static int acpi_pci_link_crs_ignore; /* 0 or 1*/
+
static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
{
int result = 0;
@@ -385,9 +395,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
*link, int irq)
/* Query _CRS, set link->irq.active */
result = acpi_pci_link_get_current(link);
- if (result) {
- goto end;
- }
+ if (acpi_pci_link_crs_ignore && result == -ENODEV) {
+ /*
+ * Ignore the error about the _CRS method of Link device and
+ * select IRQ from the Possible IRQ list
+ * returned by _PRS method.
+ */
+ printk(KERN_WARNING "Ignore error LINK CRS method.\n");
+ link->irq.active = irq;
+ result = 0;
+ }
/*
* Is current setting not what we set?
@@ -412,7 +429,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
*link, int irq)
return result;
}
-/* --------------------------------------------------------------------------
+int __init acpi_pci_link_crs_ignore_set(char *str)
+{
+ acpi_pci_link_crs_ignore = 1;
+ return 1;
+}
+
+__setup("acpi_pci_link_crs_ignore", acpi_pci_link_crs_ignore_set);
+
+
+ /* --------------------------------------------------------------------------
PCI Link IRQ Management
--------------------------------------------------------------------------
*/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
2008-04-09 15:42 [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method NoWhereMan
@ 2008-04-09 23:12 ` Andrew Morton
2008-04-10 10:40 ` Zhao Yakui
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2008-04-09 23:12 UTC (permalink / raw)
To: NoWhereMan; +Cc: linux-kernel, linux-acpi, Len Brown, Zhao Yakui
On Wed, 9 Apr 2008 17:42:34 +0200
NoWhereMan <uncommonnonsense@gmail.com> wrote:
> >From : Edoardo Vacchi <uncommonnonsense@gmail.com>
>
> When acpi_pci_link_crs_ignore is passed at boot to the kernel,
> ignores the error about the _CRS method of LINK device and selects
> IRQ from possible IRQ list returned by _PRS method.
>
> Signed-off-by: Edoardo Vacchi <uncommonnonsense@gmail.com>
>
Let's add some cc's.
>
> This is nothing more than the patch on comment #127 on bug #8896
> http://bugzilla.kernel.org/show_bug.cgi?id=8896#c127
>
> originally by Zhao Yakui <yakui.zhao@intel.com>
>
> ported to 2.6.25 and wrapped into an additional check for the kernel parameter
> (plus of course the defintion of the kernel param itself)
>
> The patch provides a workaround for some buggy BIOSes such as Insyde
> in Packard Bell EasyNote r1938 (of which I'm an unfortunate owner),
> while still keeping boot safe for people not suffering from this bug
>
That patch is about four months old. Hopefully there was a reason why we
dodn't proceed with it?
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index 233c40c..ed54c63 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -297,6 +297,16 @@ static int acpi_pci_link_get_current(struct
> acpi_pci_link *link)
> return result;
> }
>
> +
> +/*
> + * this is set when acpi_pci_link_crs_ignore is passed on boot
> + * it will ignore the -ENODEV error on buggy BIOSes
> + *
> + * workaround for bug #8896
> + *
> + */
> +static int acpi_pci_link_crs_ignore; /* 0 or 1*/
> +
> static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
> {
> int result = 0;
> @@ -385,9 +395,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
> *link, int irq)
>
> /* Query _CRS, set link->irq.active */
> result = acpi_pci_link_get_current(link);
> - if (result) {
> - goto end;
> - }
> + if (acpi_pci_link_crs_ignore && result == -ENODEV) {
> + /*
> + * Ignore the error about the _CRS method of Link device and
> + * select IRQ from the Possible IRQ list
> + * returned by _PRS method.
> + */
> + printk(KERN_WARNING "Ignore error LINK CRS method.\n");
> + link->irq.active = irq;
> + result = 0;
> + }
>
> /*
> * Is current setting not what we set?
> @@ -412,7 +429,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
> *link, int irq)
> return result;
> }
>
> -/* --------------------------------------------------------------------------
> +int __init acpi_pci_link_crs_ignore_set(char *str)
> +{
> + acpi_pci_link_crs_ignore = 1;
> + return 1;
> +}
> +
> +__setup("acpi_pci_link_crs_ignore", acpi_pci_link_crs_ignore_set);
> +
> +
> + /* --------------------------------------------------------------------------
> PCI Link IRQ Management
> --------------------------------------------------------------------------
> */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
2008-04-09 23:12 ` Andrew Morton
@ 2008-04-10 10:40 ` Zhao Yakui
2008-04-10 12:23 ` NoWhereMan
0 siblings, 1 reply; 7+ messages in thread
From: Zhao Yakui @ 2008-04-10 10:40 UTC (permalink / raw)
To: NoWhereMan; +Cc: Andrew Morton, linux-kernel, linux-acpi, Len Brown
On Wed, 2008-04-09 at 16:12 -0700, Andrew Morton wrote:
> On Wed, 9 Apr 2008 17:42:34 +0200
> NoWhereMan <uncommonnonsense@gmail.com> wrote:
>
> > >From : Edoardo Vacchi <uncommonnonsense@gmail.com>
> >
> > When acpi_pci_link_crs_ignore is passed at boot to the kernel,
> > ignores the error about the _CRS method of LINK device and selects
> > IRQ from possible IRQ list returned by _PRS method.
> >
> > Signed-off-by: Edoardo Vacchi <uncommonnonsense@gmail.com>
> >
>
> Let's add some cc's.
>
> >
> > This is nothing more than the patch on comment #127 on bug #8896
> > http://bugzilla.kernel.org/show_bug.cgi?id=8896#c127
> >
> > originally by Zhao Yakui <yakui.zhao@intel.com>
> >
> > ported to 2.6.25 and wrapped into an additional check for the kernel parameter
> > (plus of course the defintion of the kernel param itself)
> >
> > The patch provides a workaround for some buggy BIOSes such as Insyde
> > in Packard Bell EasyNote r1938 (of which I'm an unfortunate owner),
> > while still keeping boot safe for people not suffering from this bug
> >
>
> That patch is about four months old. Hopefully there was a reason why we
> dodn't proceed with it?
It seems that the system can work after applying the patch.
But the patch depends on the returned result(-ENODEV).
> if (ACPI_FAILURE(status)) {
> ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
> result = -ENODEV;
> goto end;
> }
Now I am writing another workaround patch about this problem.
>
> > diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> > index 233c40c..ed54c63 100644
> > --- a/drivers/acpi/pci_link.c
> > +++ b/drivers/acpi/pci_link.c
> > @@ -297,6 +297,16 @@ static int acpi_pci_link_get_current(struct
> > acpi_pci_link *link)
> > return result;
> > }
> >
> > +
> > +/*
> > + * this is set when acpi_pci_link_crs_ignore is passed on boot
> > + * it will ignore the -ENODEV error on buggy BIOSes
> > + *
> > + * workaround for bug #8896
> > + *
> > + */
> > +static int acpi_pci_link_crs_ignore; /* 0 or 1*/
> > +
> > static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
> > {
> > int result = 0;
> > @@ -385,9 +395,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
> > *link, int irq)
> >
> > /* Query _CRS, set link->irq.active */
> > result = acpi_pci_link_get_current(link);
> > - if (result) {
> > - goto end;
> > - }
> > + if (acpi_pci_link_crs_ignore && result == -ENODEV) {
> > + /*
> > + * Ignore the error about the _CRS method of Link device and
> > + * select IRQ from the Possible IRQ list
> > + * returned by _PRS method.
> > + */
> > + printk(KERN_WARNING "Ignore error LINK CRS method.\n");
> > + link->irq.active = irq;
> > + result = 0;
> > + }
> >
> > /*
> > * Is current setting not what we set?
> > @@ -412,7 +429,16 @@ static int acpi_pci_link_set(struct acpi_pci_link
> > *link, int irq)
> > return result;
> > }
> >
> > -/* --------------------------------------------------------------------------
> > +int __init acpi_pci_link_crs_ignore_set(char *str)
> > +{
> > + acpi_pci_link_crs_ignore = 1;
> > + return 1;
> > +}
> > +
> > +__setup("acpi_pci_link_crs_ignore", acpi_pci_link_crs_ignore_set);
> > +
> > +
> > + /* --------------------------------------------------------------------------
> > PCI Link IRQ Management
> > --------------------------------------------------------------------------
> > */
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
2008-04-10 10:40 ` Zhao Yakui
@ 2008-04-10 12:23 ` NoWhereMan
2008-04-15 13:49 ` Zhao Yakui
0 siblings, 1 reply; 7+ messages in thread
From: NoWhereMan @ 2008-04-10 12:23 UTC (permalink / raw)
To: Zhao Yakui; +Cc: Andrew Morton, linux-kernel, linux-acpi, Len Brown
On Thu, Apr 10, 2008 at 12:40 PM, Zhao Yakui <yakui.zhao@intel.com> wrote:
> On Wed, 2008-04-09 at 16:12 -0700, Andrew Morton wrote:
> > That patch is about four months old. Hopefully there was a reason why we
> > dodn't proceed with it?
> It seems that the system can work after applying the patch.
> But the patch depends on the returned result(-ENODEV).
> > if (ACPI_FAILURE(status)) {
> > ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
> > result = -ENODEV;
> > goto end;
> > }
> Now I am writing another workaround patch about this problem.
I'll try to help, testing the new patch on my system
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
2008-04-10 12:23 ` NoWhereMan
@ 2008-04-15 13:49 ` Zhao Yakui
[not found] ` <f7430a760804150121ndfaf065j332ebf1cee3c572@mail.gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Zhao Yakui @ 2008-04-15 13:49 UTC (permalink / raw)
To: NoWhereMan; +Cc: Andrew Morton, linux-kernel, linux-acpi, Len Brown
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
On Thu, 2008-04-10 at 14:23 +0200, NoWhereMan wrote:
> On Thu, Apr 10, 2008 at 12:40 PM, Zhao Yakui <yakui.zhao@intel.com> wrote:
> > On Wed, 2008-04-09 at 16:12 -0700, Andrew Morton wrote:
>
> > > That patch is about four months old. Hopefully there was a reason why we
> > > dodn't proceed with it?
> > It seems that the system can work after applying the patch.
> > But the patch depends on the returned result(-ENODEV).
> > > if (ACPI_FAILURE(status)) {
> > > ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
> > > result = -ENODEV;
> > > goto end;
> > > }
> > Now I am writing another workaround patch about this problem.
>
Will you please try the workaround patch and see whether the problem can
be fixed?
Thanks.
> I'll try to help, testing the new patch on my system
[-- Attachment #2: crs_debug.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]
An integer is returned by _CRS/_PRS object of LINK device
for some broken bios( the HID of LINK device is "PNP0C0F").
In such case irq_number will be constructed as the Extended
IRQ descriptor.
The content of the buffer should be the following:
0x89,0x06,0x00,0x0D,0x01,0x0,0x00,0x00,0x00,0x79,0x00.
And the length of the buffer is 11.
---
drivers/acpi/resources/rsutils.c | 47 +++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/acpi/resources/rsutils.c
===================================================================
--- linux-2.6.orig/drivers/acpi/resources/rsutils.c
+++ linux-2.6/drivers/acpi/resources/rsutils.c
@@ -611,7 +611,11 @@ acpi_rs_get_method_data(acpi_handle hand
char *path, struct acpi_buffer *ret_buffer)
{
union acpi_operand_object *obj_desc;
+ struct acpi_namespace_node *device_node = NULL;
acpi_status status;
+ u8 *ptr = NULL;
+ u32 irq_number = 0;
+ struct acpica_device_id hid;
ACPI_FUNCTION_TRACE(rs_get_method_data);
@@ -622,9 +626,48 @@ acpi_rs_get_method_data(acpi_handle hand
status =
acpi_ut_evaluate_object(handle, path, ACPI_BTYPE_BUFFER, &obj_desc);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ /*
+ * An integer is returned by _CRS/_PRS object of LINK device
+ * for some broken bios( the HID of LINK device is "PNP0C0F").
+ * In such case irq_number will be constructed as the Extended
+ * IRQ descriptor.
+ * The content of the buffer should be the following:
+ * 0x89,0x06,0x00,0x0D,0x01,0x0,0x00,0x00,0x00,0x79,0x00.
+ * And the length of the buffer is 11.
+ */
+ device_node = acpi_ns_map_handle_to_node(handle);
+ status = acpi_ut_execute_HID(device_node, &hid);
+ /* Now only LINK device is supported */
+ if (ACPI_FAILURE(status) || ACPI_STRNCMP(hid.value,
+ "PNP0C0F", sizeof(hid.value))) {
+ ACPI_WARNING((AE_INFO , "Only LINK device supports "
+ " the workaround patch"));
+ return_ACPI_STATUS(AE_SUPPORT);
+ }
+
+ status = acpi_ut_evaluate_object(handle, path,
+ ACPI_BTYPE_INTEGER, &obj_desc);
+ if (ACPI_FAILURE(status))
+ return_ACPI_STATUS(status);
+
+ if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+ #define IRQ_OFFSET 5
+ char fixed_irq_buffer[] = { 0x89, 0x06, 0x0, 0x0D,
+ 0x01, 0x0, 0x0, 0x0, 0x0, 0x79, 0x0 };
+ irq_number = obj_desc->integer.value;
+ acpi_ut_remove_reference(obj_desc);
+ obj_desc = acpi_ut_create_buffer_object(
+ sizeof(fixed_irq_buffer));
+ if (!obj_desc)
+ return_ACPI_STATUS(AE_NO_MEMORY);
+
+ ptr = obj_desc->buffer.pointer;
+ ACPI_MEMCPY(ptr, fixed_irq_buffer,
+ sizeof(fixed_irq_buffer));
+ ptr += IRQ_OFFSET;
+ ACPI_MOVE_32_TO_32(ptr, &irq_number);
+ }
}
-
/*
* Make the call to create a resource linked list from the
* byte stream buffer that comes back from the method
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
[not found] ` <f7430a760804161154o77dd7fc5g622d3bbe4fa1183b@mail.gmail.com>
@ 2008-04-21 13:13 ` NoWhereMan
2008-04-22 13:37 ` Zhao Yakui
0 siblings, 1 reply; 7+ messages in thread
From: NoWhereMan @ 2008-04-21 13:13 UTC (permalink / raw)
To: Zhao Yakui; +Cc: Andrew Morton, linux-kernel, linux-acpi, Len Brown
patch is working; cc'ing to ML
On Wed, Apr 16, 2008 at 8:54 PM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> FYI it wasn't latest git but still rc7; I've fast-forwarded now to
> rc9, but if no significant changes were made on that part of acpi I'm
> sure it will work anyway
>
>
>
> On Wed, Apr 16, 2008 at 12:38 AM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> > hi Zhao,
> >
> > I've applied the patch to latest linus git, boot went flawlessly
> > (except the usual error messages about _CRS method) and both wireless
> > and USB work, so I'm assuming it worked.
> >
> > I'm attaching my dmesg just for reference. I've enabled ACPI debugging
> > in my kernel config.
> >
> > thank you a lot for your efforts with this bug
> >
> >
> >
> > On Tue, Apr 15, 2008 at 10:21 AM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> > > On Tue, Apr 15, 2008 at 3:49 PM, Zhao Yakui <yakui.zhao@intel.com> wrote:
> > >
> > > > Will you please try the workaround patch and see whether the problem can
> > > > be fixed?
> > > > Thanks.
> > >
> > > I will as soon as possible, thank you for your efforts!
> > >
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method
2008-04-21 13:13 ` NoWhereMan
@ 2008-04-22 13:37 ` Zhao Yakui
0 siblings, 0 replies; 7+ messages in thread
From: Zhao Yakui @ 2008-04-22 13:37 UTC (permalink / raw)
To: NoWhereMan; +Cc: Andrew Morton, linux-kernel, linux-acpi, Len Brown
On Mon, 2008-04-21 at 15:13 +0200, NoWhereMan wrote:
> patch is working; cc'ing to ML
>
Thanks for the test.
I will try to push Len to merge this patch.
> On Wed, Apr 16, 2008 at 8:54 PM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> > FYI it wasn't latest git but still rc7; I've fast-forwarded now to
> > rc9, but if no significant changes were made on that part of acpi I'm
> > sure it will work anyway
> >
> >
> >
> > On Wed, Apr 16, 2008 at 12:38 AM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> > > hi Zhao,
> > >
> > > I've applied the patch to latest linus git, boot went flawlessly
> > > (except the usual error messages about _CRS method) and both wireless
> > > and USB work, so I'm assuming it worked.
> > >
> > > I'm attaching my dmesg just for reference. I've enabled ACPI debugging
> > > in my kernel config.
> > >
> > > thank you a lot for your efforts with this bug
> > >
> > >
> > >
> > > On Tue, Apr 15, 2008 at 10:21 AM, NoWhereMan <uncommonnonsense@gmail.com> wrote:
> > > > On Tue, Apr 15, 2008 at 3:49 PM, Zhao Yakui <yakui.zhao@intel.com> wrote:
> > > >
> > > > > Will you please try the workaround patch and see whether the problem can
> > > > > be fixed?
> > > > > Thanks.
> > > >
> > > > I will as soon as possible, thank you for your efforts!
> > > >
> > >
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-04-22 5:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 15:42 [PATCH 2.6.25-rc7 001/001] ACPI: workaround for buggy BIOS to ignore error LINK CRS method NoWhereMan
2008-04-09 23:12 ` Andrew Morton
2008-04-10 10:40 ` Zhao Yakui
2008-04-10 12:23 ` NoWhereMan
2008-04-15 13:49 ` Zhao Yakui
[not found] ` <f7430a760804150121ndfaf065j332ebf1cee3c572@mail.gmail.com>
[not found] ` <f7430a760804151538v410f7c64m21d90cb9da8e9baa@mail.gmail.com>
[not found] ` <f7430a760804161154o77dd7fc5g622d3bbe4fa1183b@mail.gmail.com>
2008-04-21 13:13 ` NoWhereMan
2008-04-22 13:37 ` Zhao Yakui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox