FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

[amdgpu] Fix reproducible crash when running sysctl -a #113

Closed ghost closed 5 years ago

ghost commented 5 years ago

When running sysctl -a the system immediately panics. This is on an Acer Aspire E5-551G with an 'AMD A10-7300 Radeon R6' APU.

amdgpu_get_pp_num_states() at amdgpu_get_pp_num_states+0x76/frame 0xfffffe004a9f3680
sysctl_handle_attr() at sysctl_handle_attr+0x71/frame 0xfffffe004a9f36d0
sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8b/frame 0xfffffe004a9f3710

In amdgpu_get_pp_num_states() adev->powerplay.pp_funcs->get_pp_num_states could be false, and data would be left uninitialized. Always initializing data to zero fixes the crash.

I wonder how this ever worked on Linux? Maybe get_pp_num_states is never false there.

johalun commented 5 years ago

Thanks! Maybe something to upstream?