* [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected
@ 2009-11-25 9:16 Zhang Rui
2009-11-25 21:39 ` Len Brown
0 siblings, 1 reply; 5+ messages in thread
From: Zhang Rui @ 2009-11-25 9:16 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi@vger.kernel.org, Zhang, Rui
Some buggy BIOS exports multiple ACPI video bus devices for the same
VGA controller, and multiple backlight control methods as well.
This may mess up the ACPI video backlight control.
http://bugzilla.kernel.org/show_bug.cgi?id=13577
We should at least send out a warning message in this case.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/video.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
Index: linux-2.6/drivers/acpi/video.c
===================================================================
--- linux-2.6.orig/drivers/acpi/video.c
+++ linux-2.6/drivers/acpi/video.c
@@ -2233,12 +2233,36 @@ static int acpi_video_resume(struct acpi
return AE_OK;
}
+static acpi_status
+acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
+ void **return_value)
+{
+ struct acpi_device *device = context;
+ struct acpi_device *sibling;
+ int result;
+
+ if (handle == device->handle)
+ return AE_CTRL_TERMINATE;
+
+ result = acpi_bus_get_device(handle, &sibling);
+ if (result)
+ return AE_OK;
+
+ if (!strcmp(acpi_device_name(sibling), ACPI_VIDEO_BUS_NAME))
+ printk(KERN_WARNING FW_BUG "Duplicate ACPI video bus "
+ "devices for the same VGA controller\n");
+ return AE_OK;
+}
+
static int acpi_video_bus_add(struct acpi_device *device)
{
struct acpi_video_bus *video;
struct input_dev *input;
int error;
+ acpi_walk_namespace(ACPI_TYPE_DEVICE, device->parent->handle,
+ 1, acpi_video_bus_match, device, NULL);
+
video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
if (!video)
return -ENOMEM;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected
2009-11-25 9:16 [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected Zhang Rui
@ 2009-11-25 21:39 ` Len Brown
2009-11-26 1:05 ` Zhang Rui
0 siblings, 1 reply; 5+ messages in thread
From: Len Brown @ 2009-11-25 21:39 UTC (permalink / raw)
To: Zhang Rui; +Cc: linux-acpi@vger.kernel.org
On Wed, 25 Nov 2009, Zhang Rui wrote:
>
> Some buggy BIOS exports multiple ACPI video bus devices for the same
> VGA controller, and multiple backlight control methods as well.
> This may mess up the ACPI video backlight control.
> http://bugzilla.kernel.org/show_bug.cgi?id=13577
>
> We should at least send out a warning message in this case.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/video.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> Index: linux-2.6/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/video.c
> +++ linux-2.6/drivers/acpi/video.c
> @@ -2233,12 +2233,36 @@ static int acpi_video_resume(struct acpi
> return AE_OK;
> }
>
> +static acpi_status
> +acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
> + void **return_value)
> +{
> + struct acpi_device *device = context;
> + struct acpi_device *sibling;
> + int result;
> +
> + if (handle == device->handle)
> + return AE_CTRL_TERMINATE;
> +
> + result = acpi_bus_get_device(handle, &sibling);
> + if (result)
> + return AE_OK;
> +
> + if (!strcmp(acpi_device_name(sibling), ACPI_VIDEO_BUS_NAME))
> + printk(KERN_WARNING FW_BUG "Duplicate ACPI video bus "
> + "devices for the same VGA controller\n");
what is somebody supposed to _do_ when they see this message?
thanks,
-Len
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected
2009-11-25 21:39 ` Len Brown
@ 2009-11-26 1:05 ` Zhang Rui
2009-11-26 5:10 ` Matthew Garrett
0 siblings, 1 reply; 5+ messages in thread
From: Zhang Rui @ 2009-11-26 1:05 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi@vger.kernel.org
On Thu, 2009-11-26 at 05:39 +0800, Len Brown wrote:
> On Wed, 25 Nov 2009, Zhang Rui wrote:
>
> >
> > Some buggy BIOS exports multiple ACPI video bus devices for the same
> > VGA controller, and multiple backlight control methods as well.
> > This may mess up the ACPI video backlight control.
> > http://bugzilla.kernel.org/show_bug.cgi?id=13577
> >
> > We should at least send out a warning message in this case.
> >
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> > drivers/acpi/video.c | 24 ++++++++++++++++++++++++
> > 1 file changed, 24 insertions(+)
> >
> > Index: linux-2.6/drivers/acpi/video.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/acpi/video.c
> > +++ linux-2.6/drivers/acpi/video.c
> > @@ -2233,12 +2233,36 @@ static int acpi_video_resume(struct acpi
> > return AE_OK;
> > }
> >
> > +static acpi_status
> > +acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
> > + void **return_value)
> > +{
> > + struct acpi_device *device = context;
> > + struct acpi_device *sibling;
> > + int result;
> > +
> > + if (handle == device->handle)
> > + return AE_CTRL_TERMINATE;
> > +
> > + result = acpi_bus_get_device(handle, &sibling);
> > + if (result)
> > + return AE_OK;
> > +
> > + if (!strcmp(acpi_device_name(sibling), ACPI_VIDEO_BUS_NAME))
> > + printk(KERN_WARNING FW_BUG "Duplicate ACPI video bus "
> > + "devices for the same VGA controller\n");
>
> what is somebody supposed to _do_ when they see this message?
>
I think this warning message gives us clues when debugging backlight
issues.
Say we see a bug report that brightness switching doesn't work and find
out that there is such a warning message in the dmesg output, then we
can see which video bus device under this VGA controller actually works.
If this bug is not rare, then we can set up a dmi list to choose the
working video bus device for these laptops.
thanks,
rui
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected
2009-11-26 1:05 ` Zhang Rui
@ 2009-11-26 5:10 ` Matthew Garrett
2009-12-29 2:40 ` Len Brown
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2009-11-26 5:10 UTC (permalink / raw)
To: Zhang Rui; +Cc: Len Brown, linux-acpi@vger.kernel.org
On Thu, Nov 26, 2009 at 09:05:33AM +0800, Zhang Rui wrote:
> If this bug is not rare, then we can set up a dmi list to choose the
> working video bus device for these laptops.
Any time somebody says "we can set up a dmi list", we've already failed.
Does Windows work on this system without platform-specific drivers? If
so, Linux is wrong and a dmi approach is incorrect. Does Windows require
a platform-specific driver? If so, Linux should also require a
platform-specific driver and a dmi approach in the core code is
incorrect.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected
2009-11-26 5:10 ` Matthew Garrett
@ 2009-12-29 2:40 ` Len Brown
0 siblings, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-12-29 2:40 UTC (permalink / raw)
To: Matthew Garrett; +Cc: Zhang Rui, linux-acpi@vger.kernel.org
lets do this:
take this patch and modify it so that by default it fixes the bug
filed in http://bugzilla.kernel.org/show_bug.cgi?id=13577
ie. by default do what Windows 2006 seems to do and use the 1st
and ignore the duplicates.
continue to print out the warning, so we have some clue
how much we see this in the field.
and also modify the patch so that in case we are guessing wrong
about windows compatibility, we go back to current behaviour
and allow multiple devices. say video.allow_duplicates or something
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-29 2:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 9:16 [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected Zhang Rui
2009-11-25 21:39 ` Len Brown
2009-11-26 1:05 ` Zhang Rui
2009-11-26 5:10 ` Matthew Garrett
2009-12-29 2:40 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox