2001-11-09 12:01:49

by Anders Fugmann

[permalink] [raw]
Subject: [PATCH] fix ACPI multible power entries

--- linux-2.4.14/drivers/acpi/ospm/button/bn_osl.c.orig Thu Nov 8 21:03:35 2001
+++ linux-2.4.14/drivers/acpi/ospm/button/bn_osl.c Fri Nov 9 12:52:57 2001
@@ -97,10 +97,13 @@
printk(KERN_WARNING "ACPI: Multiple power buttons detected, ignoring fixed-feature\n");
default:
printk(KERN_INFO "ACPI: Power Button (CM) found\n");
- bn_power_button = BN_TYPE_GENERIC;
- if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
- status = AE_ERROR;
+ /* Only create proc entry, if it has not been created before */
+ if (!bn_power_button) {
+ if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
}
+ bn_power_button = BN_TYPE_GENERIC;
break;
}
break;
@@ -130,9 +133,13 @@
default:
bn_sleep_button = BN_TYPE_GENERIC;
printk(KERN_INFO "ACPI: Sleep Button (CM) found\n");
- if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
- status = AE_ERROR;
+ /* Only create proc entry, if it has not been created before */
+ if (!bn_sleep_button) {
+ if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
}
+ bn_sleep_button = BN_TYPE_GENERIC;
break;
}
break;


Attachments:
acpi.diff (1.19 kB)

2001-11-09 19:11:28

by Andrew Grover

[permalink] [raw]
Subject: RE: [PATCH] fix ACPI multible power entries

We should already be handling multiple power button definitions, so I'm
confused why you're still seeing the problem. Could you please send me your
dmesg output and /proc/acpi/dsdt output?

Thanks -- Regards -- Andy

> -----Original Message-----
> From: Anders Peter Fugmann [mailto:[email protected]]
> Sent: Friday, November 09, 2001 4:01 AM
> To: [email protected]
> Cc: [email protected]
> Subject: [PATCH] fix ACPI multible power entries
> Importance: High
>
>
> Hi.
>
> In trying to get ACPI to work on my system, i was stumbled to see two
> button entries under /proc/acpi/button/.
>
> Attached is a patch which corrects this behaviour.
> The patch applies to 2.4.14.
>
> Regards
> Anders Fugmann
>
>
>

2001-11-09 19:18:49

by Matthew Dharm

[permalink] [raw]
Subject: Re: [PATCH] fix ACPI multible power entries

I see this too on 2.4.14. The boot messages indicate that one is
fixed-feature, whatever that means, and is being ignored. But there are
still two entries in the /proc tree.

I'm also getting a crash when I try to shutdown -- NULL pointer dereference
because something-or-other gets passed a NULL scope. Is this the right
place to report this, or should I be sending that data to another list.

Matt

On Fri, Nov 09, 2001 at 11:10:59AM -0800, Grover, Andrew wrote:
> We should already be handling multiple power button definitions, so I'm
> confused why you're still seeing the problem. Could you please send me your
> dmesg output and /proc/acpi/dsdt output?
>
> Thanks -- Regards -- Andy
>
> > -----Original Message-----
> > From: Anders Peter Fugmann [mailto:[email protected]]
> > Sent: Friday, November 09, 2001 4:01 AM
> > To: [email protected]
> > Cc: [email protected]
> > Subject: [PATCH] fix ACPI multible power entries
> > Importance: High
> >
> >
> > Hi.
> >
> > In trying to get ACPI to work on my system, i was stumbled to see two
> > button entries under /proc/acpi/button/.
> >
> > Attached is a patch which corrects this behaviour.
> > The patch applies to 2.4.14.
> >
> > Regards
> > Anders Fugmann
> >
> >
> >
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Matthew Dharm Home: [email protected]
Maintainer, Linux USB Mass Storage Driver

C: They kicked your ass, didn't they?
S: They were cheating!
-- The Chief and Stef
User Friendly, 11/19/1997


Attachments:
(No filename) (1.72 kB)
(No filename) (232.00 B)
Download all attachments

2001-11-10 10:20:45

by Anders Fugmann

[permalink] [raw]
Subject: Re: [PATCH] fix ACPI multible power entries

On 11/09/2001 08:10 PM, Grover, Andrew wrote:

> We should already be handling multiple power button definitions, so I'

> confused why you're still seeing the problem.

Strange - The code did not take good care of it. Thats why the patch :-)

> Could you please send me your dmesg output and /proc/acpi/dsdt output?

Dmesg:

tbxface-0099 [01] Acpi_load_tables : ACPI Tables successfully loaded
Parsing
Methods:...............................................................................................
..........................
121 Control Methods found and parsed (372 nodes total)
ACPI Namespace successfully loaded at root c02ee960
ACPI: Core Subsystem version [20011018]
evxfevnt-0081 [02] Acpi_enable : Transition to ACPI mode
successful
Executing device _INI methods:........................................
40 Devices found: 40 _STA, 0 _INI
Completing Region and Field initialization:..............
14/21 Regions, 0/0 Fields initialized (372 nodes total)
ACPI: Subsystem enabled
ACPI: System firmware supports S0 S1 S4 S5
Processor[0]: C0 C1
ACPI: Power Button (FF) found
ACPI: Multiple power buttons detected, ignoring fixed-feature
ACPI: Power Button (CM) found

Dsdt output is attatched, since it it binary.


>
> Thanks -- Regards -- Andy
>
>


Attachments:
dsdt (11.26 kB)