[PATCH] [RESEND] 2.4.27-pre3 backout acpi_fixed_pwr_button

From: O.Sezer
Date: Wed May 19 2004 - 05:31:16 EST


Marcelo:

2.4.27-pre3 still seems to have the acpi_fixed_pwr_button and
acpi_fixed_sleep_button changes in it, which oopses for me
upon module unload. Sergey Vlasov's response to my report is
attached. The original oops report is here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=108405180820535&w=2

If you don't have another fix for it, please apply the included
patch in order to back that out.

Regards,
Özkan Sezer
X-UIDL: 1084210475.26274.qsol01,S=4197
X-Mozilla-Status: 0011
X-Mozilla-Status2: 00000000
Return-Path: <vsu@xxxxxxxxxxx>
Delivered-To: sezero@xxxxxxxxxxxxxxx
Received: (qmail 26269 invoked from network); 10 May 2004 17:34:35 -0000
Received: from unknown ([212.252.122.201])
(envelope-sender <>)
by qsol01.superonline.com (qmail-ldap-1.03) with QMQP
for <>; 10 May 2004 17:34:35 -0000
Delivered-To: CLUSTERHOST vfep01.superonline.com sezero@xxxxxxxxxxxxxxx
Received: (qmail 32592 invoked from network); 10 May 2004 17:34:15 -0000
Received: from unknown (HELO ns1.murom.ru) ([213.177.124.6])
(envelope-sender <vsu@xxxxxxxxxxx>)
by vfep01.superonline.com (qmail-ldap-1.03) with SMTP
for <sezero@xxxxxxxxxxxxxxx>; 10 May 2004 17:34:14 -0000
Received: from [172.16.7.8] (helo=sirius.home)
by ns1.murom.ru with smtp (Exim 4.30)
id 1BNEfC-0002tR-7Z
for sezero@xxxxxxxxxxxxxxx; Mon, 10 May 2004 21:34:02 +0400
From: Sergey Vlasov <vsu@xxxxxxxxxxx>
Subject: Re: OOPS : 2.4.27-pre2 + latest ACPI
Date: Mon, 10 May 2004 21:34:02 +0400
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Message-Id: <pan.2004.05.10.17.34.01.383608@xxxxxxxxxxx>
References: <409D50AE.2020908@xxxxxxxxxxxxxxx> <409D52D3.5080500@xxxxxxxxxxxxxxx> <409DE596.8000808@xxxxxxxxxxxxxxx>
To: "O.Sezer" <sezero@xxxxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
MIME-Version: 1.0
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 8bit
X-MailScanner-Information: Please contact the ISP for more information
X-MailScanner: Found to be clean
X-MailScanner-From: vsu@xxxxxxxxxxx
X-Spam-Checker-Version: SpamAssassin 2.60-superonline (1.212-2003-09-23-exp)
on vfep03
X-Spam-Version: SpamAssassin Superonline
X-Spam-Status: No, hits=0.0 required=40.0 tests=BAYES_50 autolearn=no
version=2.60-superonline
X-Spam-Level:

On Sun, 09 May 2004 11:02:30 +0300, O.Sezer wrote:

> I backed-out the new module hunks and the
> oops went-away. Seems like there are still
> problems with the module unloading code.

Looks like a free memory access - at acpi_button_remove() button->handle
was trashed by 0x5a5a5a5a.

Does the patch below (on top of the new ACPI changes) fix this? Seems
that the special handling for fixed-feature buttons is unneeded at least
for 2.4.x - acpi_bus_unregister_driver() works for them.


--- linux/drivers/acpi/button.c.button-rmmod-oops 2004-05-09 19:45:09 +0400
+++ linux/drivers/acpi/button.c 2004-05-10 21:18:56 +0400
@@ -69,8 +69,6 @@
-------------------------------------------------------------------------- */

static struct proc_dir_entry *acpi_button_dir;
-extern struct acpi_device *acpi_fixed_pwr_button;
-extern struct acpi_device *acpi_fixed_sleep_button;

static int
acpi_button_read_info (
@@ -514,12 +512,6 @@
{
ACPI_FUNCTION_TRACE("acpi_button_exit");

- if(acpi_fixed_pwr_button)
- acpi_button_remove(acpi_fixed_pwr_button, ACPI_BUS_TYPE_POWER_BUTTON);
-
- if(acpi_fixed_sleep_button)
- acpi_button_remove(acpi_fixed_sleep_button, ACPI_BUS_TYPE_SLEEP_BUTTON);
-
acpi_bus_unregister_driver(&acpi_button_driver);

remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
--- linux/drivers/acpi/bus.c.button-rmmod-oops 2004-05-09 19:45:09 +0400
+++ linux/drivers/acpi/bus.c 2004-05-10 21:21:06 +0400
@@ -1769,23 +1769,15 @@
}


-struct acpi_device *acpi_fixed_pwr_button;
-struct acpi_device *acpi_fixed_sleep_button;
-
-EXPORT_SYMBOL(acpi_fixed_pwr_button);
-EXPORT_SYMBOL(acpi_fixed_sleep_button);
-
static int
acpi_bus_scan_fixed (
struct acpi_device *root)
{
int result = 0;
+ struct acpi_device *device = NULL;

ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");

- acpi_fixed_pwr_button = NULL;
- acpi_fixed_sleep_button = NULL;
-
if (!root)
return_VALUE(-ENODEV);

@@ -1793,11 +1785,11 @@
* Enumerate all fixed-feature devices.
*/
if (acpi_fadt.pwr_button == 0)
- result = acpi_bus_add(&acpi_fixed_pwr_button, acpi_root,
+ result = acpi_bus_add(&device, acpi_root,
NULL, ACPI_BUS_TYPE_POWER_BUTTON);

if (acpi_fadt.sleep_button == 0)
- result = acpi_bus_add(&acpi_fixed_sleep_button, acpi_root,
+ result = acpi_bus_add(&device, acpi_root,
NULL, ACPI_BUS_TYPE_SLEEP_BUTTON);

return_VALUE(result);

--- ./drivers/acpi/Makefile.orig
+++ ./drivers/acpi/Makefile
@@ -14,7 +14,7 @@

EXTRA_CFLAGS += $(ACPI_CFLAGS)

-export-objs := acpi_ksyms.o processor.o bus.o
+export-objs := acpi_ksyms.o processor.o

obj-$(CONFIG_ACPI) := acpi_ksyms.o