The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Fix oops in acer_wmi
@ 2008-08-23 21:05 Arjan van de Ven
  2008-08-24  1:19 ` Carlos Corbacho
  0 siblings, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2008-08-23 21:05 UTC (permalink / raw)
  To: linux-kernel, carlos, Rafael J. Wysocki

In the current kerneloops.org stats, acer_wmi is pretty high on the
list for 2.6.27-rc:
http://www.kerneloops.org/search.php?search=acer_wmi_init

this is due to a null pointer due to a misordered initialization...
when the DMI quirks get run, the "interface" variable might not have been initialized.
The patch below 1) prevents the oops and 2) runs the quirks again after all the "interface"
initialization has completed.

This oops is new in 2.6.27-rc and thus counts as a regression...


--- linux.trees.git/drivers/misc/acer-wmi.c~	2008-08-23 13:59:22.000000000 -0700
+++ linux.trees.git/drivers/misc/acer-wmi.c	2008-08-23 14:00:32.000000000 -0700
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
 
 static void set_quirks(void)
 {
+	if (!interface)
+		return;
+
 	if (quirks->mailled)
 		interface->capability |= ACER_CAP_MAILLED;
 
@@ -1237,6 +1240,8 @@ static int __init acer_wmi_init(void)
 		return -ENODEV;
 	}
 
+	set_quirks();
+
 	if (platform_driver_register(&acer_platform_driver)) {
 		printk(ACER_ERR "Unable to register platform driver.\n");
 		goto error_platform_register;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix oops in acer_wmi
  2008-08-23 21:05 Fix oops in acer_wmi Arjan van de Ven
@ 2008-08-24  1:19 ` Carlos Corbacho
  2008-08-24  4:45   ` Arjan van de Ven
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Corbacho @ 2008-08-24  1:19 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, Rafael J. Wysocki

On Saturday 23 August 2008 22:05:09 Arjan van de Ven wrote:
> this is due to a null pointer due to a misordered initialization...
> when the DMI quirks get run, the "interface" variable might not have been
> initialized. The patch below 1) prevents the oops and 2) runs the quirks
> again after all the "interface" initialization has completed.

Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>

(Although this patch is missing an SOB from yourself).

> This oops is new in 2.6.27-rc and thus counts as a regression...

NAK - I disagree. This has been broken since day one, there is nothing 
special, as far as I am concerned, about 2.6.27 in this respect.

(If this is showing up that much in kerneloops.org, then I would recommend 
CC'ing it to stable).

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix oops in acer_wmi
  2008-08-24  1:19 ` Carlos Corbacho
@ 2008-08-24  4:45   ` Arjan van de Ven
  2008-08-24  8:38     ` Carlos Corbacho
  0 siblings, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2008-08-24  4:45 UTC (permalink / raw)
  To: Carlos Corbacho, torvalds; +Cc: linux-kernel, Rafael J. Wysocki

On Sun, 24 Aug 2008 02:19:41 +0100

Linus, 
below is a patch for a bug that's showing quite hot on kerneloops.org; please consider merging

Carlos Corbacho <carlos@strangeworlds.co.uk> wrote:

> On Saturday 23 August 2008 22:05:09 Arjan van de Ven wrote:
> > this is due to a null pointer due to a misordered initialization...
> > when the DMI quirks get run, the "interface" variable might not
> > have been initialized. The patch below 1) prevents the oops and 2)
> > runs the quirks again after all the "interface" initialization has
> > completed.
> 
> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
> 
> (Although this patch is missing an SOB from yourself).

oh whoops; updated below
> 
> > This oops is new in 2.6.27-rc and thus counts as a regression...
> 
> NAK - I disagree. This has been broken since day one, there is
> nothing special, as far as I am concerned, about 2.6.27 in this
> respect.

interesting; I have no reports of this in kerneloops.org (but if this got introduced
in 2.6.26 that's possible; there's not that many 2.6.26 users yet);
you can see this yourself at
http://www.kerneloops.org/search.php?search=acer_wmi_init
on the left side it shows how often it happens for which versions/

I'll still call it a tentative regression ;=)

> 
> (If this is showing up that much in kerneloops.org, then I would
> recommend CC'ing it to stable).
> 

--
From: Arjan van de Ven <arjan@linux.intel.com>
Subject: Fix oops in acer_wmi driver (acer_wmi_init)

The acer_wmi driver does a DMI scan for quirks, and then sets flags into the
"interface" datastructure for some cases. However, the quirks happen real early
before "interface" is per se initialized from NULL.

The patch below 1) adds a NULL pointer check and 2) (re)runs the quirks at the
end, when "interface" has it's final value. 

Reported-by: kerneloops.org
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
CC: stable@vger.kernel.org
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>


--- linux.trees.git/drivers/misc/acer-wmi.c~	2008-08-23 13:59:22.000000000 -0700
+++ linux.trees.git/drivers/misc/acer-wmi.c	2008-08-23 14:00:32.000000000 -0700
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
 
 static void set_quirks(void)
 {
+	if (!interface)
+		return;
+
 	if (quirks->mailled)
 		interface->capability |= ACER_CAP_MAILLED;
 
@@ -1237,6 +1240,8 @@ static int __init acer_wmi_init(void)
 		return -ENODEV;
 	}
 
+	set_quirks();
+
 	if (platform_driver_register(&acer_platform_driver)) {
 		printk(ACER_ERR "Unable to register platform driver.\n");
 		goto error_platform_register;



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix oops in acer_wmi
  2008-08-24  4:45   ` Arjan van de Ven
@ 2008-08-24  8:38     ` Carlos Corbacho
  0 siblings, 0 replies; 4+ messages in thread
From: Carlos Corbacho @ 2008-08-24  8:38 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: torvalds, linux-kernel, Rafael J. Wysocki

On Sunday 24 August 2008 05:45:21 Arjan van de Ven wrote:
> interesting; I have no reports of this in kerneloops.org (but if this got
> introduced in 2.6.26 that's possible; there's not that many 2.6.26 users
> yet); you can see this yourself at
> http://www.kerneloops.org/search.php?search=acer_wmi_init
> on the left side it shows how often it happens for which versions/
>
> I'll still call it a tentative regression ;=)

My bad; this is just a 2.6.27 regression - I thought the offending patch that 
had caused this (83097aca8567a0bd593534853b71fe0fa9a75d69) went into 2.6.26 
as well, it didn't.

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-24  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-23 21:05 Fix oops in acer_wmi Arjan van de Ven
2008-08-24  1:19 ` Carlos Corbacho
2008-08-24  4:45   ` Arjan van de Ven
2008-08-24  8:38     ` Carlos Corbacho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox