All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Murzov <intergalactic.anonymous@gmail.com>
To: "Carlos R. Mafra" <crmafra@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Len Brown <len.brown@intel.com>
Subject: Re: 3.5.0-rc2 bisected regression: Can't change brightness on Vaio laptop
Date: Fri, 15 Jun 2012 02:26:41 +0400	[thread overview]
Message-ID: <20120615022641.1556677f@garik> (raw)
In-Reply-To: <20120610163813.GA5721@Pilar.maths.private.cam.ac.uk>

Please follow the discussion here:
https://bugzilla.kernel.org/show_bug.cgi?id=43168


> Commit ea9f8856bd6d4 ("ACPI video: Harden video bus adding") breaks the
> backlight controls on my Vaio laptop.
> 
> After this patch the folder /sys/class/backlight becomes empty and
> I can't change the lcd brightness anymore.
> 
> This regression is present in v3.4.2 as well as in the current
> v3.5.0-rc2. 
> 
> I tried to manually revert that commit from v3.5.0-rc2, and the resulting
> patch below fixes the issue for me.
> 
> My config is here:
> http://www.damtp.cam.ac.uk/user/crm66/config-3.5-rc1
> 
> and the dmesg of v3.5.0-rc2 plus the patch below is here:
> http://www.damtp.cam.ac.uk/user/crm66/dmesg_v3.5-rc2+patch.txt
> 
> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index a576575..4612b1c 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -548,27 +548,27 @@ acpi_video_device_EDID(struct acpi_video_device *device,
>   *		1. 	The system BIOS should NOT automatically control the brightness 
>   *			level of the LCD when the power changes from AC to DC.
>   * Return Value:
> - *		-EINVAL	wrong arg.
> + * 		-1	wrong arg.
>   */
>  
>  static int
>  acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
>  {
> -	acpi_status status;
> +	u64 status = 0;
>  	union acpi_object arg0 = { ACPI_TYPE_INTEGER };
>  	struct acpi_object_list args = { 1, &arg0 };
>  
>  
> -	if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1)
> -		return -EINVAL;
> +	if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) {
> +		status = -1;
> +		goto Failed;
> +	}
>  	arg0.integer.value = (lcd_flag << 2) | bios_flag;
>  	video->dos_setting = arg0.integer.value;
> -	status = acpi_evaluate_object(video->device->handle, "_DOS",
> -		&args, NULL);
> -	if (ACPI_FAILURE(status))
> -		return -EIO;
> +	acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL);
>  
> -	return 0;
> +      Failed:
> +	return status;
>  }
>  
>  /*
> @@ -1343,17 +1343,15 @@ static int
>  acpi_video_bus_get_devices(struct acpi_video_bus *video,
>  			   struct acpi_device *device)
>  {
> -	int status;
> +	int status = 0;
>  	struct acpi_device *dev;
>  
> -	status = acpi_video_device_enumerate(video);
> -	if (status)
> -		return status;
> +	acpi_video_device_enumerate(video);
>  
>  	list_for_each_entry(dev, &device->children, node) {
>  
>  		status = acpi_video_bus_get_one_device(dev, video);
> -		if (status) {
> +		if (ACPI_FAILURE(status)) {
>  			printk(KERN_WARNING PREFIX
>  					"Can't attach device\n");
>  			continue;
> @@ -1655,9 +1653,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
>  	mutex_init(&video->device_list_lock);
>  	INIT_LIST_HEAD(&video->video_device_list);
>  
> -	error = acpi_video_bus_get_devices(video, device);
> -	if (error)
> -		goto err_free_video;
> +	acpi_video_bus_get_devices(video, device);
> +	acpi_video_bus_start_devices(video);
>  
>  	video->input = input = input_allocate_device();
>  	if (!input) {
> @@ -1695,13 +1692,9 @@ static int acpi_video_bus_add(struct acpi_device *device)
>  
>  	video->pm_nb.notifier_call = acpi_video_resume;
>  	video->pm_nb.priority = 0;
> -	error = register_pm_notifier(&video->pm_nb);
> -	if (error)
> -		goto err_stop_video;
>  
> -	error = input_register_device(input);
> -	if (error)
> -		goto err_unregister_pm_notifier;
> +	register_pm_notifier(&video->pm_nb);
> +	input_register_device(input);
>  
>  	return 0;
>  
> 

  reply	other threads:[~2012-06-14 22:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-10 16:38 3.5.0-rc2 bisected regression: Can't change brightness on Vaio laptop Carlos R. Mafra
2012-06-14 22:26 ` Igor Murzov [this message]
2012-06-15  0:16   ` Carlos R. Mafra
2012-06-21  3:00     ` Linus Torvalds

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=20120615022641.1556677f@garik \
    --to=intergalactic.anonymous@gmail.com \
    --cc=crmafra@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.