Skip to contentSkip to conversation

ideapad: Check if acpi already handle backlight power to avoid a page fault

PATCH In review Jonathan Nieder 3 participants 8 messages Jan 11, 2012 – Jan 12, 2012 1 message not in the archive x86 platform drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CAFVLVSOp750X4L+qgR16Qc53V+jOKsxA-ujskx3K0BX9kQOzTw@mail.gmail.com

#1 lore raw

PATCH 1/1 ideapad: Check if acpi already handle backlight power to avoid a page fault

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

---

Quoted 2 lines · Artem X

I've compiled vanilla 3.1.6 with that patch and turning off blacklight was working.

This fixes an oops reported by a few people in the new ideapad-laptop backlight driver. See:

- http://thread.gmane.org/gmane.linux.kernel/1205259
- http://thread.gmane.org/gmane.linux.drivers.platform.x86.devel/2405
- http://bugs.debian.org/655377

Luckily the ideapad-laptop backlight driver was introduced in v3.1-rc1~14^2~29, so older kernels do not have this bug. Fix is already included in v3.2.

 drivers/platform/x86/ideapad-laptop.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/platform/x86/ideapad-laptop.c +2 -0
index 0c595410e788..0d94eec00f4d 100644
@@ -493,6 +493,8 @@ static void ideapad_backlight_notify_power(struct ideapad_private *priv)
 	unsigned long power;
 	struct backlight_device *blightdev = priv->blightdev;
 
+	if (!blightdev)
+		return;
 	if (read_ec_data(ideapad_handle, 0x18, &power))
 		return;
 	blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
Signature · 1 line
1.7.8.3
#2 lore raw
Quoted 9 lines · Jonathan Nieder

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

I believe René's last name is Bolldorf, not Bollford as in the "From" line. (The typo comes from the commit log and I forgot to check it before sending.) Either way --- sorry for the noise, and René, sorry for mangling your name.

Acked-by on v1 1/1
#3 lore raw
In reply to Jonathan Nieder

Thanks, and this is necessary for 3.1.y

Quoted 5 lines · Jonathan Nieder

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

Quoted 7 lines

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

Quoted 33 lines

---

Quoted 2 lines · Artem X

I've compiled vanilla 3.1.6 with that patch and turning off blacklight was working.

This fixes an oops reported by a few people in the new ideapad-laptop backlight driver. See:

- http://thread.gmane.org/gmane.linux.kernel/1205259
- http://thread.gmane.org/gmane.linux.drivers.platform.x86.devel/2405
- http://bugs.debian.org/655377

Luckily the ideapad-laptop backlight driver was introduced in v3.1-rc1~14^2~29, so older kernels do not have this bug. Fix is already included in v3.2.

 drivers/platform/x86/ideapad-laptop.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/platform/x86/ideapad-laptop.c +2 -0
index 0c595410e788..0d94eec00f4d 100644
@@ -493,6 +493,8 @@ static void ideapad_backlight_notify_power(struct ideapad_private *priv)
 	unsigned long power;
 	struct backlight_device *blightdev = priv->blightdev;
 
+	if (!blightdev)
+		return;
 	if (read_ec_data(ideapad_handle, 0x18, &power))
 		return;
 	blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
#4 lore raw
Quoted 11 lines · Ike Panhc

Thanks, and this is necessary for 3.1.y

Quoted 8 lines · Jonathan Nieder

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

Quoted 6 lines
Quoted 4 lines

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

#5 lore raw
Quoted 14 lines · Greg KH
Quoted 14 lines · Jonathan Nieder
Quoted 13 lines

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

[...]

Quoted 7 lines

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

Well, what did I do wrong this time?

- The patch is obviously correct and tested.
- It is a two-liner, plus context.
- It fixes exactly one thing.
- The bug bothers people, and I gave links to reports.
- It is an oops (a null pointer dereference).
- No unrelated "trivial" fixes in there.
- Follows SubmittingPatches rules, as far as I know.
- Patch was produced by cherry-picking the commit named above from Linus's tree.

#6 lore raw
Quoted 26 lines · Jonathan Nieder
Quoted 14 lines · Greg KH
Quoted 14 lines · Jonathan Nieder
Quoted 13 lines

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

[...]

Quoted 7 lines

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

Well, what did I do wrong this time?

Quoted 9 lines

- The patch is obviously correct and tested.
- It is a two-liner, plus context.
- It fixes exactly one thing.
- The bug bothers people, and I gave links to reports.
- It is an oops (a null pointer dereference).
- No unrelated "trivial" fixes in there.
- Follows SubmittingPatches rules, as far as I know.
- Patch was produced by cherry-picking the commit named above from Linus's tree.

Sorry, I missed the 3.1 in the subject line. That's what I get for processing email before my morning coffee...

This is all fine, I'll queue it up for the next release.

Oh wait, there isn't going to be another 3.1 kernel release, so this might not have been needed. I'll see if others really want another 3.1 release, and if so, I'll add this to it.

thanks,

greg k-h

#7 lore raw
Quoted 5 lines · Greg KH

This is all fine, I'll queue it up for the next release.

Oh wait, there isn't going to be another 3.1 kernel release, so this might not have been needed. I'll see if others really want another 3.1 release, and if so, I'll add this to it.

Thanks. Sounds good to me.

#8 lore raw
In reply to Jonathan Nieder
Quoted 21 lines · Jonathan Nieder

From: René Bollford <[email protected]>
Date: Sun, 23 Oct 2011 09:56:42 +0200

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

This patch avoid a page fault in the ideapad-laptop extras when turning the backlight power on or off.

---

Quoted 2 lines · Artem X

I've compiled vanilla 3.1.6 with that patch and turning off blacklight was working.

This fixes an oops reported by a few people in the new ideapad-laptop backlight driver. See:

Quoted 7 lines

- http://thread.gmane.org/gmane.linux.kernel/1205259
- http://thread.gmane.org/gmane.linux.drivers.platform.x86.devel/2405
- http://bugs.debian.org/655377

Luckily the ideapad-laptop backlight driver was introduced in v3.1-rc1~14^2~29, so older kernels do not have this bug. Fix is already included in v3.2.

Now applied, thanks.

greg k-h