Skip to contentSkip to conversation

Problem with ACPI video

DISCUSSION Luis Henriques 4 participants 6 messages Sep 3, 2008 – Sep 8, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 38 lines · Luis Henriques

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)
Quoted 5 lines

[...]

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.

Quoted 8 lines

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:

Quoted 9 lines
  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.

Quoted 2 lines

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:

Quoted 4 lines

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

#2 lore raw
Quoted 7 lines · Zhang Rui
Quoted 3 lines

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?

Quoted 11 lines
Quoted 2 lines

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:

Quoted 4 lines

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

#3 lore raw
Quoted 5 lines · Luis Henriques
Quoted 2 lines · Zhang Rui
Quoted 2 lines

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...).

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 4 lines

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...

Quoted 24 lines
Quoted 1 line
Quoted 1 line

Please let me know whether you need any additional information to

help

Quoted 2 lines
Quoted 1 line

me solving this problem.

There is a patch from Matthew that should solve this problem, which

has

Quoted 2 lines

already hit the acpi test tree.
it would be great if you can get the source code and give it a

try. :)

Quoted 3 lines

how to get the source code:

Quoted 1 line

git-clone

git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6
acpi_test

Quoted 3 lines
Quoted 3 lines

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:

Quoted 6 lines
[   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

#4 lore raw
Quoted 12 lines · Zhang Rui
Quoted 11 lines · Luis Henriques
Quoted 2 lines · Zhang Rui
Quoted 2 lines

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...).

Quoted 4 lines

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.

Quoted 6 lines
Quoted 3 lines

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

#5 lore raw
Quoted 4 lines · Thomas Renninger

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.

Signature · 4 lines
  "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