Skip to contentSkip to conversation

ACPI video: Ignore AE_AML_PACKAGE_LIMIT errors after _DOD evaluation.

PATCH In review Igor Murzov 2 participants 4 messages Oct 9, 2012 – Oct 10, 2012 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI video: Ignore AE_AML_PACKAGE_LIMIT errors after _DOD evaluation.

This should fix brightness controls on some laptops.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47861

---
 drivers/acpi/video.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/acpi/video.c +6 -2
index 1e0a9e1..01bb58d 100644
@@ -1349,8 +1349,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
 	struct acpi_device *dev;
 
 	status = acpi_video_device_enumerate(video);
-	if (status)
-		return status;
+	if (status) {
+		if (status == AE_AML_PACKAGE_LIMIT)
+			status = 0; /* Ignore this error */
+		else
+			return status;
+	}
 
 	list_for_each_entry(dev, &device->children, node) {
 
Signature · 1 line
1.7.12
#1 lore raw
Quoted 4 lines · On Wednesday 10 of October 2012 02:19:06 Igor Murzov wrote:

This should fix brightness controls on some laptops.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47861

Put more detials into the changelog, please. The BZ entry linked above may or may not be accessible when the changelog is read by someone.

Quoted 10 lines
---
 drivers/acpi/video.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/acpi/video.c +0 -0
index 1e0a9e1..01bb58d 100644
@@ -1349,8 +1349,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
 	struct acpi_device *dev;

drivers/acpi/video.c acpi_video_bus_get_devices(struct acpi_video_bus *video, · line 1357

Quoted 10 lines
drivers/acpi/video.c +6 -2
 
 	status = acpi_video_device_enumerate(video);
-	if (status)
-		return status;
+	if (status) {
+		if (status == AE_AML_PACKAGE_LIMIT)
+			status = 0; /* Ignore this error */
+		else
+			return status;
+	}

First off, please add a comment explaining _why_ we're ignoring the error.

Second, what about adding just:

if (status == AE_AML_PACKAGE_LIMIT)

	status = 0;

before the "if (status)" check?

drivers/acpi/video.c acpi_video_bus_get_devices(struct acpi_video_bus *video, · line 1359

Quoted 2 lines
drivers/acpi/video.c +0 -0
 	list_for_each_entry(dev, &device->children, node) {

Thanks,
Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw
Quoted 20 lines · On Wed, 10 Oct 2012 00:58:10 +0200 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 4 lines · On Wednesday 10 of October 2012 02:19:06 Igor Murzov wrote:

This should fix brightness controls on some laptops.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47861

Put more detials into the changelog, please. The BZ entry linked above may or may not be accessible when the changelog is read by someone.

Quoted 11 lines
---
 drivers/acpi/video.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/acpi/video.c +0 -0
index 1e0a9e1..01bb58d 100644
@@ -1349,8 +1349,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
 	struct acpi_device *dev;
 
Quoted 11 lines

drivers/acpi/video.c acpi_video_bus_get_devices(struct acpi_video_bus *video, · line 1357

Quoted 9 lines
drivers/acpi/video.c +6 -2
 	status = acpi_video_device_enumerate(video);
-	if (status)
-		return status;
+	if (status) {
+		if (status == AE_AML_PACKAGE_LIMIT)
+			status = 0; /* Ignore this error */
+		else
+			return status;
+	}

First off, please add a comment explaining _why_ we're ignoring the error.

The problem is that i'm not sure if it's ok to ignore AE_AML_PACKAGE_LIMIT here. Stefan Wilkens in bugzilla claims that video module works fine on his Compaq 6720s in spite of the fact that acpi_video_device_enumerate() is not able to find any video device on his laptop. This fix is just the most obvious one, not necessarily the proper one.

Quoted 6 lines

Second, what about adding just:

if (status == AE_AML_PACKAGE_LIMIT)

	status = 0;

before the "if (status)" check?

Ok

-- Igor

Quoted 5 lines

drivers/acpi/video.c acpi_video_bus_get_devices(struct acpi_video_bus *video, · line 1359

Quoted 2 lines
drivers/acpi/video.c +0 -0
 	list_for_each_entry(dev, &device->children, node) {

Thanks,
Rafael

#3 lore raw
Quoted 35 lines · On Wednesday 10 of October 2012 04:43:40 Igor Murzov wrote:
Quoted 20 lines · On Wed, 10 Oct 2012 00:58:10 +0200 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 4 lines · On Wednesday 10 of October 2012 02:19:06 Igor Murzov wrote:

This should fix brightness controls on some laptops.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47861

Put more detials into the changelog, please. The BZ entry linked above may or may not be accessible when the changelog is read by someone.

Quoted 11 lines
---
 drivers/acpi/video.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/acpi/video.c +0 -0
index 1e0a9e1..01bb58d 100644
@@ -1349,8 +1349,12 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
 	struct acpi_device *dev;
 
Quoted 11 lines

drivers/acpi/video.c acpi_video_bus_get_devices(struct acpi_video_bus *video, · line 1357

Quoted 9 lines
drivers/acpi/video.c +6 -2
 	status = acpi_video_device_enumerate(video);
-	if (status)
-		return status;
+	if (status) {
+		if (status == AE_AML_PACKAGE_LIMIT)
+			status = 0; /* Ignore this error */
+		else
+			return status;
+	}

First off, please add a comment explaining _why_ we're ignoring the error.

Quoted 2 lines

The problem is that i'm not sure if it's ok to ignore AE_AML_PACKAGE_LIMIT here.

This should be written in a comment, then. :-)

Quoted 6 lines

Stefan Wilkens in bugzilla
claims that video module works fine on his Compaq 6720s in spite of the fact that acpi_video_device_enumerate() is not able to find any video device on his laptop. This fix is just the most obvious one, not necessarily the proper one.

So say something like "there are systems known to return AE_AML_PACKAGE_LIMIT here, apparently for no valid reason" in a comment. And give a reference to the BZ entry in the changelog.

There are too many places where we have put workarounds like this without documenting them properly and now we have problems when we need to change something.

Thanks,
Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.