Bug 5060 - acpi_video_device_write_state() busted
Summary: acpi_video_device_write_state() busted
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Video (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Luming Yu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-13 20:01 UTC by Ariel T. Glenn
Modified: 2005-09-09 09:17 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.13-rc6
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
patch against 2.6.13-rc6 (570 bytes, patch)
2005-08-21 19:17 UTC, Luming Yu
Details | Diff

Description Ariel T. Glenn 2005-08-13 20:01:05 UTC
Distribution:FC4, vanilla kernel NOT from FC4.
Hardware Environment: Dell XPS Gen 2 laptop
Software Environment: most modules unloaded, running from console,
most services shut down

Problem Description: acpi_video_device_write_state() calls 
acpi_video_device_set_state()
which calls acpi_evaluate_integer() with fourth arg NULL, causing 
an error so the set state call bails.

Steps to reproduce:
echo 0x20001f > /proc/acpi/debug_level
echo 0x80000001 > /proc/acpi/video/VID/LCD/state

check in log; you'll see something like this:
Aug 13 18:31:03 localhost kernel: acpi_video-0782 [13] acpi_video_device_writ:
----Entry
Aug 13 18:31:03 localhost kernel: acpi_video-0302 [14] acpi_video_device_set_:
----Entry
Aug 13 18:31:03 localhost kernel: acpi_utils-0250 [15] acpi_evaluate_integer :
----Entry
Aug 13 18:31:03 localhost kernel: acpi_utils-0253 [15] acpi_evaluate_integer :
----Exit- ****Exception****: AE_BAD_PARAMETER
Aug 13 18:31:03 localhost kernel: acpi_video-0307 [14] acpi_video_device_set_:
----Exit- 0000000000001001
Aug 13 18:31:03 localhost kernel: acpi_video-0797 [13] acpi_video_device_writ:
----Exit- FFFFFFFFFFFFFFF2

Here's the call that's bad:

        status = acpi_evaluate_integer(device->handle, "_DSS", &args, NULL);
(around line 305 in video.c)

Here's why it's bad:

acpi_status
acpi_evaluate_integer (
        acpi_handle             handle,
        acpi_string             pathname,
        struct acpi_object_list *arguments,
        unsigned long           *data)

...

ACPI_FUNCTION_TRACE("acpi_evaluate_integer");

        if (!data)
                return_ACPI_STATUS(AE_BAD_PARAMETER);

(around line 240 in util.c)

Since I don't know whether there should be an actual argument passed or
whether acpi_evaluate_integer shouldn't do that check, I didn't attach 
a patch.

I checked in
http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/release/2.6.13/broken-out/
but didn't find a fix for this.

I'm not adding attachments unless someone thinks they really need them.
Comment 1 Luming Yu 2005-08-21 19:17:47 UTC
Created attachment 5720 [details]
patch against 2.6.13-rc6

Thanks for the analysis, this patch should fix your problem.
Comment 2 Ariel T. Glenn 2005-08-21 20:17:54 UTC
I've been running with that very fix (with a different variable name) and it
works fine.
Thanks.

Ariel
Comment 3 Luming Yu 2005-08-22 05:44:13 UTC
closed means in base kernel. So just mark it as resolved.
Comment 4 Len Brown 2005-09-02 22:25:56 UTC
applied
Comment 5 Len Brown 2005-09-09 09:17:02 UTC
Shipped in 2.6.13-git9.
Closing.

Note You need to log in before you can comment on or make changes to this bug.