> Date: Sun, 19 Apr 2020 14:49:12 +0200
> From: Alexander Shendi <[email protected]>
> 
> >Synopsis:    Kernel panic using standard /bsd kernel
> >Category:    kernel, amd64
> >Environment:
>       System      : OpenBSD 6.7
>       Details     : OpenBSD 6.7-beta (GENERIC.MP) #140: Sat Apr 18 22:50:48 
> MDT 2020
>                        
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>       Architecture: OpenBSD.amd64
>       Machine     : amd64
> >Description:
>       I upgraded from OpenBSD 6.6-STABLE to -current via "sysupgrade -s".
>         Upon rebooting the machine paniced. Panic message:
>         "INT3472" at acpi0 not configured
>         acpipci0 at apic0 PCI0: 0x000000000 x000000011 x00000001
>         "INT33D3" at acpi0 not configured
>         "INT33D4" at acpi0 not configured
>         "INT33D2" at acpi0 not configured
>         acpicmos0 at acpi0
>         "INT344B" at acpi0 not configured
>         "NXP3001" at acpi0 not configured
>         "ELAN9308" at acpi0 not configured
>         "INT347A" at acpi0 not configured
>         "INT33BE" at acpi0 not configured
>         "INT347E" at acpi0 not configured
>         "INT3403" at acpi0 not configured
>         "INT3403" at acpi0 not configured
>         "INT3403" at acpi0 not configured
>         "INT3305" at acpi0 not configured
>         "PNP0C14" at acpi0 not configured
>         "INT33A1" at acpi0 not configured
>         acpibtn0 at acpi0: PWRB
>         acpiac0 at acpi0: AC unit online
>         acpibat0 at acpi0: BAT1 model "AHA22135001" serial 2210 type LION oem 
> "SMP"
>         acpibtn1 at acpi0: LIDD
>         "QCI0703" at acpi0 not configured
>         "INT3400" at acpi0 not configured
>         "USBC000" at acpi0 not configured
>         acpivideo0 at acpi0: GFX0
>         acpivout0 at acpivideo0: DD1F
>         uvm_fault(0xffffffff81fe5bc0, 0x0, 0, 1) -> e
>         kernel: page fault trap, code=0
>         Stopped at        acpivout_attach+0xfe:      movl   0(%rax),%ecx
>         ddb{0}>

It's crashing on line 166 of acpivout.c:

        if (level < sc->sc_bcl[0])

(Note there was a diff in snaps that is now committed).

Apparently sc_bcl is NULL.  That shouldn't happen but we have no
protection against it.  Diff below should make sure things don't go
off the rails.

Bigger question is why the _BCL method isn't returning a proper list
of values.  Judging from the included acpi dump it should...


Index: dev/acpi/acpivout.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpivout.c,v
retrieving revision 1.22
diff -u -p -r1.22 acpivout.c
--- dev/acpi/acpivout.c 19 Apr 2020 15:05:14 -0000      1.22
+++ dev/acpi/acpivout.c 19 Apr 2020 15:38:31 -0000
@@ -114,12 +114,14 @@ acpivout_attach(struct device *parent, s
            ws_get_param || ws_set_param)
                return;
 
-       ws_get_param = acpivout_get_param;
-       ws_set_param = acpivout_set_param;
-
        acpivout_get_bcl(sc);
+       if (sc->sc_bcl_len == 0)
+               return;
 
        sc->sc_brightness = acpivout_get_brightness(sc);
+
+       ws_get_param = acpivout_get_param;
+       ws_set_param = acpivout_set_param;
 }
 
 int

Reply via email to