public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Problem with ACPI video
@ 2008-09-03 21:45 Luis Henriques
  2008-09-04  1:19 ` Zhang Rui
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Henriques @ 2008-09-03 21:45 UTC (permalink / raw)
  To: linux-acpi

It seems that there is a problem with my video card.  I got the
following message:

[...]

[   14.705248] input: Video Bus as /class/input/input4
[   14.757151] ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)
[   14.757624] proc_dir_entry 'VGA' already registered
[   14.757673] Pid: 3093, comm: modprobe Not tainted
2.6.27-rc5-00006-gbef69ea #1
[   14.757723]
[   14.757724] Call Trace:
[   14.757816]  [<ffffffff8032199c>] proc_register+0x1dc/0x210
[   14.757866]  [<ffffffff80321bed>] proc_mkdir_mode+0x3d/0x60
[   14.757913]  [<ffffffff80321c21>] proc_mkdir+0x11/0x20
[   14.757963]  [<ffffffffa01d27cc>] acpi_video_bus_add+0x1e9/0xd55 [video]
[   14.758011]  [<ffffffff8032cb98>] ? sysfs_do_create_link+0xc8/0x160
[   14.758060]  [<ffffffff803bfa16>] acpi_device_probe+0x49/0x8c
[   14.758108]  [<ffffffff803f7f02>] driver_probe_device+0xa2/0x1e0
[   14.758156]  [<ffffffff803f80cb>] __driver_attach+0x8b/0x90
[   14.758202]  [<ffffffff803f8040>] ? __driver_attach+0x0/0x90
[   14.758249]  [<ffffffff803f76ab>] bus_for_each_dev+0x6b/0xa0
[   14.758297]  [<ffffffff802c9636>] ? kmem_cache_alloc+0x86/0xc0
[   14.758344]  [<ffffffff803f7d4c>] driver_attach+0x1c/0x20
[   14.758391]  [<ffffffff803f6ef8>] bus_add_driver+0x1f8/0x270
[   14.758439]  [<ffffffffa00e5000>] ? acpi_video_init+0x0/0x5e [video]
[   14.758487]  [<ffffffff803f82b0>] driver_register+0x70/0x160
[   14.758535]  [<ffffffffa00e5000>] ? acpi_video_init+0x0/0x5e [video]
[   14.758582]  [<ffffffff803bfd4e>] acpi_bus_register_driver+0x3e/0x40
[   14.758630]  [<ffffffffa00e503c>] acpi_video_init+0x3c/0x5e [video]
[   14.758677]  [<ffffffff80209040>] _stext+0x40/0x1a0
[   14.758726]  [<ffffffff802704cd>] sys_init_module+0xad/0x1e0
[   14.758772]  [<ffffffff8020c62a>] system_call_fastpath+0x16/0x1b
[   14.758818]
[   14.768981] acpi device:29: registered as cooling_device3
[   14.769252] input: Video Bus as /class/input/input5
[   14.817141] ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)
[   14.905143] ACPI: Battery Slot [BAT1] (battery present)
[...]

It seems that acpi_video_bus_add function is invoked twice and, the
second time, it fails (maybe it is supposed to be invoked twice...).

Anyway, I can not tell you what was the first kernel where this problem
occured since the laptop is new and had this problem on all kernels I
tried (this one is Linus git-tree 2.6.27-rc5-00006-gbef69ea).

Also found out that I have two directories /proc/acpi/video/VGA/.

After looking at the code, I found the following code:

  if (!strcmp(device->pnp.bus_id, "VID")) {
        if (instance)
              device->pnp.bus_id[3] = '0' + instance;
        instance ++;
  }

in drivers/acpi/video.c.  Is this code supposed to solve a similar
problem as the one I am facing?

Please let me know whether you need any additional information to help
me solving this problem.

--
Luis


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problem with ACPI video
  2008-09-03 21:45 Problem with ACPI video Luis Henriques
@ 2008-09-04  1:19 ` Zhang Rui
  2008-09-04 19:44   ` Luis Henriques
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang Rui @ 2008-09-04  1:19 UTC (permalink / raw)
  To: Luis Henriques; +Cc: linux-acpi

On Wed, 2008-09-03 at 22:45 +0100, Luis Henriques wrote:
> It seems that there is a problem with my video card.  I got the
> following message:
> 
> [...]
> 
> [   14.705248] input: Video Bus as /class/input/input4
> [   14.757151] ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)
> [   14.757624] proc_dir_entry 'VGA' already registered
> [   14.757673] Pid: 3093, comm: modprobe Not tainted
> 2.6.27-rc5-00006-gbef69ea #1
> [   14.757723]
> [   14.757724] Call Trace:
> [   14.757816]  [<ffffffff8032199c>] proc_register+0x1dc/0x210
> [   14.757866]  [<ffffffff80321bed>] proc_mkdir_mode+0x3d/0x60
> [   14.757913]  [<ffffffff80321c21>] proc_mkdir+0x11/0x20
> [   14.757963]  [<ffffffffa01d27cc>] acpi_video_bus_add+0x1e9/0xd55 [video]
> [   14.758011]  [<ffffffff8032cb98>] ? sysfs_do_create_link+0xc8/0x160
> [   14.758060]  [<ffffffff803bfa16>] acpi_device_probe+0x49/0x8c
> [   14.758108]  [<ffffffff803f7f02>] driver_probe_device+0xa2/0x1e0
> [   14.758156]  [<ffffffff803f80cb>] __driver_attach+0x8b/0x90
> [   14.758202]  [<ffffffff803f8040>] ? __driver_attach+0x0/0x90
> [   14.758249]  [<ffffffff803f76ab>] bus_for_each_dev+0x6b/0xa0
> [   14.758297]  [<ffffffff802c9636>] ? kmem_cache_alloc+0x86/0xc0
> [   14.758344]  [<ffffffff803f7d4c>] driver_attach+0x1c/0x20
> [   14.758391]  [<ffffffff803f6ef8>] bus_add_driver+0x1f8/0x270
> [   14.758439]  [<ffffffffa00e5000>] ? acpi_video_init+0x0/0x5e [video]
> [   14.758487]  [<ffffffff803f82b0>] driver_register+0x70/0x160
> [   14.758535]  [<ffffffffa00e5000>] ? acpi_video_init+0x0/0x5e [video]
> [   14.758582]  [<ffffffff803bfd4e>] acpi_bus_register_driver+0x3e/0x40
> [   14.758630]  [<ffffffffa00e503c>] acpi_video_init+0x3c/0x5e [video]
> [   14.758677]  [<ffffffff80209040>] _stext+0x40/0x1a0
> [   14.758726]  [<ffffffff802704cd>] sys_init_module+0xad/0x1e0
> [   14.758772]  [<ffffffff8020c62a>] system_call_fastpath+0x16/0x1b
> [   14.758818]
> [   14.768981] acpi device:29: registered as cooling_device3
> [   14.769252] input: Video Bus as /class/input/input5
> [   14.817141] ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)
> [   14.905143] ACPI: Battery Slot [BAT1] (battery present)
> [...]
> 
> It seems that acpi_video_bus_add function is invoked twice and, the
> second time, it fails (maybe it is supposed to be invoked twice...).
> 
There are two ACPI video bus devices both named "VGA" in the ACPI
namespace, and each of them tries to create an entry "VGA"
under /proc/acpi/video/.
that's why this message is printed out.

> Anyway, I can not tell you what was the first kernel where this problem
> occured since the laptop is new and had this problem on all kernels I
> tried (this one is Linus git-tree 2.6.27-rc5-00006-gbef69ea).
> 
> Also found out that I have two directories /proc/acpi/video/VGA/.
> 
> After looking at the code, I found the following code:
> 
>   if (!strcmp(device->pnp.bus_id, "VID")) {
>         if (instance)
>               device->pnp.bus_id[3] = '0' + instance;
>         instance ++;
>   }
> 
> in drivers/acpi/video.c.  Is this code supposed to solve a similar
> problem as the one I am facing?
> 
yes.

> Please let me know whether you need any additional information to help
> me solving this problem.
There is a patch from Matthew that should solve this problem, which has
already hit the acpi test tree.
it would be great if you can get the source code and give it a try. :)

how to get the source code:
> git-clone git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6 acpi_test
> git-branch -r
> git-branch --track test origin/test
> git-checkout test

thanks,
rui


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problem with ACPI video
  2008-09-04  1:19 ` Zhang Rui
@ 2008-09-04 19:44   ` Luis Henriques
  2008-09-05  1:02     ` Zhang Rui
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Henriques @ 2008-09-04 19:44 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-acpi

Zhang Rui wrote:
>> It seems that acpi_video_bus_add function is invoked twice and, the
>> second time, it fails (maybe it is supposed to be invoked twice...).
>>
> There are two ACPI video bus devices both named "VGA" in the ACPI
> namespace, and each of them tries to create an entry "VGA"
> under /proc/acpi/video/.
> that's why this message is printed out.

Sorry about my ignorance on the topic but... does this mean I do
actually have 2 devices?  If this is true, then I should actually have
"VGA1" and "VGA2" dirs in /proc, right?

>> Please let me know whether you need any additional information to help
>> me solving this problem.
> There is a patch from Matthew that should solve this problem, which has
> already hit the acpi test tree.
> it would be great if you can get the source code and give it a try. :)
> 
> how to get the source code:
>> git-clone git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6 acpi_test
>> git-branch -r
>> git-branch --track test origin/test
>> git-checkout test


Ok, tried this (or similar...) and it seems to be working just fine.
Or, at least, no more error message from kernel.  Also, in
/proc/acpi/video only one directory 'VGA' is being created.  Here's the
relevante dmesg part:

[   14.657009] ACPI: AC Adapter [ACAD] (on-line)
[   14.661005] acpi device:04: registered as cooling_device2
[   14.664019] input: Video Bus as /class/input/input4
[   14.716892] ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)

Thanks!
--
Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problem with ACPI video
  2008-09-04 19:44   ` Luis Henriques
@ 2008-09-05  1:02     ` Zhang Rui
  2008-09-08  0:20       ` Thomas Renninger
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang Rui @ 2008-09-05  1:02 UTC (permalink / raw)
  To: Luis Henriques; +Cc: linux-acpi

On Fri, 2008-09-05 at 03:44 +0800, Luis Henriques wrote:
> Zhang Rui wrote:
> >> It seems that acpi_video_bus_add function is invoked twice and, the
> >> second time, it fails (maybe it is supposed to be invoked
> twice...).
> >>
> > There are two ACPI video bus devices both named "VGA" in the ACPI
> > namespace, and each of them tries to create an entry "VGA"
> > under /proc/acpi/video/.
> > that's why this message is printed out.
> 
> Sorry about my ignorance on the topic but... does this mean I do
> actually have 2 devices?  If this is true, then I should actually have
> "VGA1" and "VGA2" dirs in /proc, right?
No, because the video driver tries to register two "VGA" procfs entry,
we get two "VGA" dirs in /proc...

> >> Please let me know whether you need any additional information to
> help
> >> me solving this problem.
> > There is a patch from Matthew that should solve this problem, which
> has
> > already hit the acpi test tree.
> > it would be great if you can get the source code and give it a
> try. :)
> >
> > how to get the source code:
> >> git-clone
> git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6
> acpi_test
> >> git-branch -r
> >> git-branch --track test origin/test
> >> git-checkout test
> 
> 
> Ok, tried this (or similar...) and it seems to be working just fine.
> Or, at least, no more error message from kernel.  Also, in
> /proc/acpi/video only one directory 'VGA' is being created.  Here's
> the
> relevante dmesg part:
> 
> [   14.657009] ACPI: AC Adapter [ACAD] (on-line)
> [   14.661005] acpi device:04: registered as cooling_device2
> [   14.664019] input: Video Bus as /class/input/input4
> [   14.716892] ACPI: Video Device [VGA] (multi-head: yes  rom: no
> post: no)
> 
that's great.
thanks for testing, we'll try to push these patches upstream.

thanks,
rui


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problem with ACPI video
  2008-09-05  1:02     ` Zhang Rui
@ 2008-09-08  0:20       ` Thomas Renninger
  2008-09-08  3:33         ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Renninger @ 2008-09-08  0:20 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Luis Henriques, linux-acpi

On Friday 05 September 2008 03:02:41 am Zhang Rui wrote:
> On Fri, 2008-09-05 at 03:44 +0800, Luis Henriques wrote:
> > Zhang Rui wrote:
> > >> It seems that acpi_video_bus_add function is invoked twice and, the
> > >> second time, it fails (maybe it is supposed to be invoked
> >
> > twice...).
> >
> > > There are two ACPI video bus devices both named "VGA" in the ACPI
> > > namespace, and each of them tries to create an entry "VGA"
> > > under /proc/acpi/video/.
> > > that's why this message is printed out.
> >
> > Sorry about my ignorance on the topic but... does this mean I do
> > actually have 2 devices?  If this is true, then I should actually have
> > "VGA1" and "VGA2" dirs in /proc, right?
>
> No, because the video driver tries to register two "VGA" procfs entry,
> we get two "VGA" dirs in /proc...
I expect Luis wants to know why there are two ACPI graphics devices
in his BIOS tables.
In most BIOSes a device for an integrated and a shared graphics solution is 
implemented in ACPI tables, read more here:
http://en.wikipedia.org/wiki/Graphics_processing_unit
(Integrated graphics solutions, or shared graphics solutions)

The reason is that it seems ACPI cannot easily check whether the graphics card 
is available at all and provide a _STA function to easily let the OS check 
that.

But you always only should have one of above devices available at a time.
The same name can be used in ACPI for different devices (in different scopes), 
which is shown by above graphics cards problem and this shows that the ACPI
proc implementation is broken by design in this respect. Anyway we always came 
away (and still do if not available dummy graphics devices are ignored, this 
is what the new patch does) with it. And sysfs will do better anyway.

The vendor could theoretically remove one implementation when the machine
is sold, but I expect it is easier for them to not do that and thus being able 
to use the same BIOS tables for models with a shared or integrated graphics
solution and let OS check which one to use.

         Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problem with ACPI video
  2008-09-08  0:20       ` Thomas Renninger
@ 2008-09-08  3:33         ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 6+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-09-08  3:33 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: Zhang Rui, Luis Henriques, linux-acpi

On Mon, 08 Sep 2008, Thomas Renninger wrote:
> which is shown by above graphics cards problem and this shows that the ACPI
> proc implementation is broken by design in this respect. Anyway we always came 
> away (and still do if not available dummy graphics devices are ignored, this 
> is what the new patch does) with it. And sysfs will do better anyway.

Not anymore.  Dual GPU laptops are being sold already.  Time to fix that
hideous design bug properly, or just remove that part of the /proc interface
outright.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-08  3:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 21:45 Problem with ACPI video Luis Henriques
2008-09-04  1:19 ` Zhang Rui
2008-09-04 19:44   ` Luis Henriques
2008-09-05  1:02     ` Zhang Rui
2008-09-08  0:20       ` Thomas Renninger
2008-09-08  3:33         ` Henrique de Moraes Holschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox