All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Valdis.Kletnieks@vt.edu
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: linux-next 20160512 - ACPI issue with screen brightness
Date: Sat, 21 May 2016 11:29:33 +0800	[thread overview]
Message-ID: <20160521032933.GA12918@aaronlu.sh.intel.com> (raw)
In-Reply-To: <29833.1463789712@turing-police.cc.vt.edu>

On Fri, May 20, 2016 at 08:15:12PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 20 May 2016 15:17:20 +0800, Aaron Lu said:
> > On Fri, May 20, 2016 at 03:02:08AM -0400, Valdis.Kletnieks@vt.edu wrote:
> > > With the patches reverted:
> > > 
> > > [/sys/class/backlight/acpi_video0] grep . *bright*
> > > actual_brightness:95
> > > brightness:95
> > > max_brightness:95
> > > 
> > > And the weird part inside the kernel - on a kernel that has the problem,
> > > /sys/class/backlight is *empty* - only '.' and '..' entries.
> > > 
> > > No, I don't understand why the acpi_video0 entry isn't created when that
> > > commit is in place.
> >
> > The commit probably makes acpi_video_init_brightness bail out for some
> > reason, adding debug prints under those "if (result)" in
> > acpi_video_init_brightness should help to identify where it goes wrong.
> >
> > And your acpidump please, thanks.
> 
> The dmesg output:
> 
> [    1.966400] ACPI: Power Button [PWRF]
> [    1.969759] ACPI: Video Device [VID] (multi-head: yes  rom: yes  post: no)
> [    1.969829] acpi_evaluate_BCL failed, 4097
> [    1.969866] acpi_evaluate_BCL failed, 4097
> [    1.969898] acpi_evaluate_BCL failed, 4097
> [    1.969930] acpi_evaluate_BCL failed, 4097
> [    1.969961] acpi_evaluate_BCL failed, 4097
> [    1.969994] acpi_evaluate_BCL failed, 4097
> [    1.970045] acpi_evaluate_BCL failed, 4097
> [    1.970077] acpi_evaluate_BCL failed, 4097

My bad, I see the problem here: the acpi_video_device_lcd_query_levels
called in acpi_video_run_bcl_for_osi didn't do the proper conversion.
The acpi_handle is a "void *" so there is no warnings...

> [    1.970621] acpi_evaluate_BCL failed, 5

This error messages means there is no _BCL but the acpidump shows that
there is.

Anyway, please apply this patch on top of the existing one and attach
dmesg, thanks, this can at least fix the above 4097 errors and let's see
if things start to change:

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 69b321580fa3..bdef49074372 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -765,6 +765,9 @@ int acpi_video_get_levels(struct acpi_device *device,
 	int result = 0;
 	u32 value;
 
+	pr_info("%s for device %s, handle %p\n", __func__, dev_name(&device->dev),
+						device->handle);
+
 	if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,
 								&obj))) {
 		pr_err("Could not query available LCD brightness level\n");
@@ -1747,7 +1750,8 @@ static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video)
 
 	mutex_lock(&video->device_list_lock);
 	list_for_each_entry(dev, &video->video_device_list, entry) {
-		if (!acpi_video_device_lcd_query_levels(dev, &levels))
+		if (!acpi_video_device_lcd_query_levels(dev->dev->handle,
+							&levels))
 			kfree(levels);
 	}
 	mutex_unlock(&video->device_list_lock);

-Aaron

> [    1.970652] Could not query available LCD brightness level
> [    1.970692] acpi_video_get_levels failed, -19
> [    1.973516] ACPI Error: Current brightness invalid (20160422/video-368)
> [    1.973528] acpi_video_bqc_quirk failed, -22
> [    1.973567] acpi_evaluate_BCL failed, 5
> [    1.973597] Could not query available LCD brightness level
> [    1.973636] acpi_video_get_levels failed, -19
> [    1.973672] acpi_evaluate_BCL failed, 5
> [    1.973701] Could not query available LCD brightness level
> [    1.973741] acpi_video_get_levels failed, -19
> [    1.973777] acpi_evaluate_BCL failed, 5
> [    1.973807] Could not query available LCD brightness level
> [    1.973847] acpi_video_get_levels failed, -19
> [    1.973882] acpi_evaluate_BCL failed, 5
> [    1.973911] Could not query available LCD brightness level
> [    1.973951] acpi_video_get_levels failed, -19
> [    1.973986] acpi_evaluate_BCL failed, 5
> [    1.974439] Could not query available LCD brightness level
> [    1.974479] acpi_video_get_levels failed, -19
> [    1.974529] acpi_evaluate_BCL failed, 5
> [    1.974565] Could not query available LCD brightness level
> [    1.974603] acpi_video_get_levels failed, -19
> [    1.977783] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:14/LNXVIDEO:00/input/input4
> [    1.980879] thermal LNXTHERM:00: registered as thermal_zone0
> [    1.980884] ACPI: Thermal Zone [THM] (64 C)

  reply	other threads:[~2016-05-21  3:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 18:41 linux-next 20160512 - ACPI issue with screen brightness Valdis Kletnieks
2016-05-17 20:50 ` Rafael J. Wysocki
2016-05-19 22:53   ` Valdis.Kletnieks
2016-05-20  3:05     ` Valdis.Kletnieks
2016-05-20  3:05       ` Valdis.Kletnieks
2016-05-20  5:45       ` Aaron Lu
2016-05-20  7:02         ` Valdis.Kletnieks
2016-05-20  7:17           ` Aaron Lu
2016-05-20  7:35             ` Aaron Lu
2016-05-21  0:15             ` Valdis.Kletnieks
2016-05-21  3:29               ` Aaron Lu [this message]
2016-05-21  7:55                 ` [PATCH] ACPI / Thermal / video: fix max_level incorrect value Aaron Lu
2016-05-25  5:15                   ` Aaron Lu
2016-05-26  1:49                     ` Valdis.Kletnieks
2016-05-26  5:15                       ` Aaron Lu
2016-05-27  0:42                         ` Zhang, Rui

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=20160521032933.GA12918@aaronlu.sh.intel.com \
    --to=aaron.lu@intel.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@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.