Jonathan Gray <[email protected]> wrote:
> On Tue, Nov 08, 2022 at 11:44:06PM +0330, Ali Farzanrad wrote:
> > >Synopsis:  HP ProBook 4530s laptop, kernel panic on suspend
> > >Category:  kernel
> > >Environment:
> >     System      : OpenBSD 7.2
> >     Details     : OpenBSD 7.2 (GENERIC.MP) #0: Wed Oct 26 12:01:47 MDT 2022
> >                      
> > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > 
> >     Architecture: OpenBSD.amd64
> >     Machine     : amd64
> > >Description:
> >     I had an upgrade from (I think) OpenBSD 6.7 to 7.2 and then ran
> >     sysmerge (to ignore my configs) and sysclean (with rm -rf) to
> >     cleanup files.
> >     I also did syspatch.
> >     After upgrade whenever I try to suspend I receive kernel panic.
> >     I don't remember if it did suspend correctly before, but I had a
> >     different HP ProBook 4530s without radeon video graphics which
> >     did suspend correctly.
> >     Maybe it is related to radeondrm.
> > >How-To-Repeat:
> >     start apmd: rcctl -f start apmd
> >     then zzz or ZZZ
> > >Fix:
> >     I have no idea.
> >     When I did zzz, I received these kernel messages:
> >     WARNING !list_empty(&lock->head) failed at 
> > /usr/src/sys/dev/pcidrm/drm_modeset_lock.c:270
> >     uvm_fault(0xffffffff823201f8, 0x20, 0, 1) -> e
> >     kernel: page fault trap, code=0
> >     Stopped at      mtx_enter_try+0x3e:     movl    0x8(%rdi),%edi
> >         TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
> >     *373147  24736      0     0x14000 0x40000200    0K acpi0
> >     mtx_enter_try(18) at mtx_enter_try+0x3e
> >     mtx_enter(18) at mtx_enter+0x35
> >     __ww_mutex_lock(18,ffff800000e96fc0,0,0) at __ww_mutex_lock+0x33
> >     modeset_lock(18,ffff800000e96fc0,0,0) at modeset_lock+0x197
> >     drm_modeset_lock_all_ctx(ffff8000002a0000,ffff800000e96fc0) at 
> > drm_modeset_lock_all_ctx+0x9c
> >     drm_modeset_lock_all(ffff8000002a0000) at drm_modeset_lock_all+0xc0
> >     radeon_suspend_kms(ffff8000002a0000,1,1,0) at radeon_suspend_kms+0x69
> >     radeondrm_activate_kms(ffff80000029c000,2) at 
> > radeondrm_activate_kms+0x53
> >     config_activate_children(ffff800000132500,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff80000029b000,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff800000132300,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff80000002f300,2) at 
> > config_activate_children+0x85
> >     config_suspend_all(2) at config_suspend_all+0x1aa
> >     sleep_state(ffff80000002c400,1) at sleep_state+0xcf
> >     end trace frame: 0xffff800022abb5f0, count: 0
> >     https://www.openbsd.org/ddb.html describes the minimum info required in 
> > bug
> >     reports.  Insufficient info makes it difficult to find and fix bugs.
> >     ddb{0}> bt
> >     mtx_enter_try(18) at mtx_enter_try+0x3e
> >     mtx_enter(18) at mtx_enter+0x35
> >     __ww_mutex_lock(18,ffff800000e96fc0,0,0) at __ww_mutex_lock+0x33
> >     modeset_lock(18,ffff800000e96fc0,0,0) at modeset_lock+0x197
> >     drm_modeset_lock_all_ctx(ffff8000002a0000,ffff800000e96fc0) at 
> > drm_modeset_lock_all_ctx+0x9c
> >     drm_modeset_lock_all(ffff8000002a0000) at drm_modeset_lock_all+0xc0
> >     radeon_suspend_kms(ffff8000002a0000,1,1,0) at radeon_suspend_kms+0x69
> >     radeondrm_activate_kms(ffff80000029c000,2) at 
> > radeondrm_activate_kms+0x53
> >     config_activate_children(ffff800000132500,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff80000029b000,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff800000132300,2) at 
> > config_activate_children+0x85
> >     config_activate_children(ffff80000002f300,2) at 
> > config_activate_children+0x85
> >     config_suspend_all(2) at config_suspend_all+0x1aa
> >     sleep_state(ffff80000002c400,1) at sleep_state+0xcf
> >     acpi_sleep_task(ffff80000002c400,1) at acpi_sleep_task+0x1d
> >     acpi_thread(ffff8000001288f0) at acpi_thread+0x1b8
> >     end trace frame: 0x0, count: -16
> >     ddb{0}>
> 
> Try the following patch.
> 
> You may also be able to switch this machine to only use the Radeon
> in the bios settings.
> 
> Index: sys/dev/pci/drm/radeon/radeon_kms.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/drm/radeon/radeon_kms.c,v
> retrieving revision 1.90
> diff -u -p -r1.90 radeon_kms.c
> --- sys/dev/pci/drm/radeon/radeon_kms.c       15 Jul 2022 17:57:26 -0000      
> 1.90
> +++ sys/dev/pci/drm/radeon/radeon_kms.c       9 Nov 2022 02:24:00 -0000
> @@ -874,7 +874,7 @@ radeondrm_activate_kms(struct device *se
>       struct radeon_device *rdev = (struct radeon_device *)self;
>       int rv = 0;
>  
> -     if (rdev->ddev == NULL)
> +     if (rdev->ddev == NULL || radeon_fatal_error)
>               return (0);
>  
>       switch (act) {
> 

Yes that works, both suspend and hibernate works as expected I guess.

At first I installed the kernel as /bsd.jg which somehow cause hibernate
not working, but when I installed it as /bsd hibernate works as expected
too.

Reply via email to