Bug 11968

Summary: ACPI: inconsistent acpi event format
Product: Drivers Reporter: Yi Yang (yi.y.yang)
Component: PlatformAssignee: Zhang Rui (rui.zhang)
Status: REJECTED INVALID    
Severity: normal CC: acpi-bugzilla, yi.y.yang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.* Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 56331    
Attachments: A program acpi-event-listen.c
A patch to fix this bug

Description Yi Yang 2008-11-06 18:15:33 UTC
Latest working kernel version: None
Earliest failing kernel version: All 2.6.*
Distribution: Fedora 9
Hardware Environment: Acer Netbook Aspire One
Software Environment: Fedora 9
Problem Description: Event format acpi generates for /proc/acpi/event is different from that for generic netlink interface. Here are i got:

From /proc/acpi/event, i got the following events when i suspend and
resume Acer's Aspire One:

battery BAT1 00000080 00000000
battery BAT1 00000081 00000000
ac_adapter ACAD 00000080 00000001
battery BAT1 00000080 00000000

But from generic netlink socket, i got the following events when i suspend
and resume Acer's Aspire One:

battery PNP0C0A:00 00000080 00000000
battery PNP0C0A:00 00000081 00000000
ac_adapter ACPI0003:00 00000080 00000001
battery PNP0C0A:00 00000080 00000000

Such inconsistent event format will make acpid or hald confused

Steps to reproduce:
1. Run a program using ACPI generic netlink interface to get acpi events, you can use the first attached program (gcc acpi-event-listen.c -o acpi-event-listen).
2. Run acpi_listen to get acpi events in the sametime in another console.
3. pm-suspend
4. Press 'Fn' or 'power button' to resume it.
5. Compare events from acpi-event-listen and acpi_listen.
Comment 1 Yi Yang 2008-11-06 18:19:33 UTC
Created attachment 18714 [details]
A program acpi-event-listen.c

A program acpi-event-listen.c, you can make it using the command:

gcc acpi-event-listen.c -o acpi-event-listen

acpi-event-listen uses acpi generic netlink interface to get acpi events.
Comment 2 Yi Yang 2008-11-06 18:23:13 UTC
Created attachment 18715 [details]
A patch to fix this bug

This patch fixed this bug, it has been sent to linux-acpi@vger.kernel.org, this bug just is for tracking its status.
Comment 3 Zhang Rui 2008-11-10 00:12:13 UTC
no, this is not a bug.

>From /proc/acpi/event, i got the following events when i suspend and
>resume Acer's Aspire One:
>battery BAT1 00000080 00000000
>...
BAT1 is gotten from BIOS, which is arbitrary and even meaningless sometimes.

>But from generic netlink socket, i got the following events when i suspend
>and resume Acer's Aspire One:
>battery PNP0C0A:00 00000080 00000000
>...
Exporting ACPI events via netlink is part of ACPI sysfs conversion task.
and instead of the pnp_id, the bus_id in sysfs is unique for every ACPI device.

these changes are made to get rid of the old procfs I/F.
Yi, thanks for your effort on this.
Comment 4 Zhang Rui 2008-11-10 00:13:01 UTC
Reject this INVALID bug.
Comment 5 Yi Yang 2008-11-10 01:24:24 UTC
(In reply to comment #3)
> no, this is not a bug.
> 
> >From /proc/acpi/event, i got the following events when i suspend and
> >resume Acer's Aspire One:
> >battery BAT1 00000080 00000000
> >...
> BAT1 is gotten from BIOS, which is arbitrary and even meaningless sometimes.
Do you mean events from /proc/acpi/event may be meaningless sometimes? But acpid and hal worked well in the past.

> 
> >But from generic netlink socket, i got the following events when i suspend
> >and resume Acer's Aspire One:
> >battery PNP0C0A:00 00000080 00000000
> >...
> Exporting ACPI events via netlink is part of ACPI sysfs conversion task.
> and instead of the pnp_id, the bus_id in sysfs is unique for every ACPI
> device.
> 
> these changes are made to get rid of the old procfs I/F.
> Yi, thanks for your effort on this.
>