Linux MM tree latest commits
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: mhopf@suse.de, julia@diku.dk, lenb@kernel.org, mjg@redhat.com,
	oneukum@suse.de, rui.zhang@intel.com
Subject: + acpi-pm-traverse-video_device_list-for-backlight-restoration.patch added to -mm tree
Date: Wed, 04 Aug 2010 12:57:29 -0700	[thread overview]
Message-ID: <201008041957.o74JvUfv006459@imap1.linux-foundation.org> (raw)


The patch titled
     acpi/pm: traverse video_device_list for backlight restoration
has been added to the -mm tree.  Its filename is
     acpi-pm-traverse-video_device_list-for-backlight-restoration.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: acpi/pm: traverse video_device_list for backlight restoration
From: Matthias Hopf <mhopf@suse.de>

acpi_video_bus_get_devices() explicitly calls
acpi_video_device_enumerate() before acpi_video_bus_get_one_device(),
which does acpi_video_device_bind().

In _enumerate(), active_list[] is created, with .bind_info explicitly set
to NULL, while the related .bind_info entry in video_device_list is set to
the acpi_video_device ptr in _bind().

The .bind_info is later used in acpi_video_resume() to re-set the
backlight - but it's only evaluated on the active_list[], on which all
.bind_info are NULL by construction.  This results in backlight not being
restored, if the BIOS doesn't do this by itself already.


The patch resolves this by replacing the active_list[] traversal by a
video_device_list traversal, but due to the nature of the issue I'm unsure
whether the original issue isn't of more principal quality.  I don't understand
why the list is (partially) transformed into an array in the first place,
especially as both the array *and* the list are used in the code...


.bind_info in active_list[] is NULL by construction - and used to
determine the acpi_video_device pointer during backlight restoration
during resume.

Using the list instead fixes backlight restoration for systems where the
BIOS doesn't do this by itself already.

Signed-off-by: Matthias Hopf <mhopf@suse.de>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/acpi/video.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/acpi/video.c~acpi-pm-traverse-video_device_list-for-backlight-restoration drivers/acpi/video.c
--- a/drivers/acpi/video.c~acpi-pm-traverse-video_device_list-for-backlight-restoration
+++ a/drivers/acpi/video.c
@@ -2346,7 +2346,6 @@ static int acpi_video_resume(struct noti
 {
 	struct acpi_video_bus *video;
 	struct acpi_video_device *video_device;
-	int i;
 
 	switch (val) {
 	case PM_HIBERNATION_PREPARE:
@@ -2359,11 +2358,12 @@ static int acpi_video_resume(struct noti
 
 	dev_info(&video->device->dev, "Restoring backlight state\n");
 
-	for (i = 0; i < video->attached_count; i++) {
-		video_device = video->attached_array[i].bind_info;
+	mutex_lock(&video->device_list_lock);
+	list_for_each_entry(video_device, &video->video_device_list, entry) {
 		if (video_device && video_device->backlight)
 			acpi_video_set_brightness(video_device->backlight);
 	}
+	mutex_unlock(&video->device_list_lock);
 
 	return NOTIFY_OK;
 }
_

Patches currently in -mm which might be from mhopf@suse.de are

acpi-pm-traverse-video_device_list-for-backlight-restoration.patch


                 reply	other threads:[~2010-08-04 19:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008041957.o74JvUfv006459@imap1.linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=julia@diku.dk \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhopf@suse.de \
    --cc=mjg@redhat.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox