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@xxxxxxx> 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@xxxxxxx> Cc: Zhang Rui <rui.zhang@xxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Cc: Matthew Garrett <mjg@xxxxxxxxxx> Cc: Julia Lawall <julia@xxxxxxx> Cc: Oliver Neukum <oneukum@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- 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@xxxxxxx are acpi-pm-traverse-video_device_list-for-backlight-restoration.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html