public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix _STA checking in acpi_bus_add
@ 2004-01-02 23:35 Bjorn Helgaas
       [not found] ` <200401021635.25419.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2004-01-02 23:35 UTC (permalink / raw)
  To: Len Brown, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

In 2.6.1-rc1, acpi_bus_add() calls acpi_bus_get_status() to evaluate
_STA, but botches checking the return value.  The result is that _STA
is ignored (if it was evaluated correctly), or we check garbage (if
the evaluation failed).  Here's a patch to fix it:

===== drivers/acpi/scan.c 1.19 vs edited =====
--- 1.19/drivers/acpi/scan.c	Sun May 25 18:00:00 2003
+++ edited/drivers/acpi/scan.c	Fri Jan  2 16:14:25 2004
@@ -703,11 +703,11 @@
 	switch (type) {
 	case ACPI_BUS_TYPE_DEVICE:
 		result = acpi_bus_get_status(device);
-		if (!result)
-			break;
-		if (!device->status.present) 
+		if (ACPI_FAILURE(result) || !device->status.present) {
 			result = -ENOENT;
-		goto end;
+			goto end;
+		}
+		break;
 	default:
 		STRUCT_TO_INT(device->status) = 0x0F;
 		break;



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: [PATCH] Fix _STA checking in acpi_bus_add
@ 2004-01-26 17:20 Brown, Len
  0 siblings, 0 replies; 5+ messages in thread
From: Brown, Len @ 2004-01-26 17:20 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: ACPI Developers, Luck, Tony

> Now that you've applied this, we have to resolve the next issue
> I found while investigating this: the chipset config interface
> (CBN/CSFF) is reported as _STA==0x8, i.e., "functioning, but not
> present".  We can't find anything in the spec on how to interpret
> this.

Sounds like broken firmware. Not only is it !present, it is !enabled.

The _STA section of the ACPI spec says that if a device isn't
(present && enabled) then it shouldn't even decode its
hardware resources.

> The problem here is that since CBN/CSFF is !present, we won't
> enumerate devices under them.  Therefore, we will no longer find
> the AGP bridge on Big Sur.

Oof!


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-26 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-02 23:35 [PATCH] Fix _STA checking in acpi_bus_add Bjorn Helgaas
     [not found] ` <200401021635.25419.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2004-01-12 19:47   ` Bjorn Helgaas
2004-01-24  4:43   ` Len Brown
     [not found]     ` <1074919407.14755.6.camel-D2Zvc0uNKG8@public.gmane.org>
2004-01-26 16:15       ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2004-01-26 17:20 Brown, Len

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox