Hi,

the following diff fixes a hang on boot when acpivideo(4) tries to
evaluate _DOD method for nonexistent video device.

Long story short, there are crappy laptops out there (like Samsung Q45)
that have modifications with advanced video cards (nVidia) and regular
Intel ones.  To save costs [or for whatever other reasons] manufacturer
uses the same ACPI config for both modifications.

In this case there are two acpivideo devices: NVID and GFX0 with ADRs
Zero and 0x00020000 respectively, so it seems natural to knock out NVID
by checking its ADR.  FWIW, Linux also checks for device presence in a
similar manner.

I've put this check in a top level, so that we won't get a "not
configured" message.

Cheers,
Mike

Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.187
diff -u -p -r1.187 acpi.c
--- acpi.c      22 Jul 2010 14:19:47 -0000      1.187
+++ acpi.c      24 Jul 2010 19:51:22 -0000
@@ -2217,6 +2217,11 @@ acpi_foundvideo(struct aml_node *node, void *arg)
        struct acpi_softc *sc = (struct acpi_softc *)arg;
        struct device *self = (struct device *)arg;
        struct acpi_attach_args aaa;
+       uint64_t addr;
+
+       if (aml_evalinteger(sc, node->parent, "_ADR", 0, NULL, &addr) == 0)
+               if (addr == 0)
+                       return (1);
 
        memset(&aaa, 0, sizeof(aaa));
        aaa.aaa_iot = sc->sc_iot;

Reply via email to