]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix device attribute node create failed with multi gpu
authorKevin Wang <kevin1.wang@amd.com>
Fri, 22 May 2020 14:06:17 +0000 (22:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 May 2020 19:51:45 +0000 (15:51 -0400)
commit217a24660542e7be602d2af91eb00fcf6b6f8247
tree3e3466a7759eb37694cb3fbb48c97c34acf82822
parent55c9b19c642190f8ee83a34262a2ba09075c1d81
drm/amdgpu: fix device attribute node create failed with multi gpu

the origin design will use varible of "attr->states" to save node
supported states on current gpu device, but for multi gpu device, when
probe second gpu device, the driver will check attribute node states
from previous gpu device wthether to create attribute node.
it will cause other gpu device create attribute node faild.

1. add member attr_list into amdgpu_device to link supported device attribute node.
2. add new structure "struct amdgpu_device_attr_entry{}" to track device attribute state.
3. drop member "states" from amdgpu_device_attr.

v2:
1. move "attr_list" into amdgpu_pm and rename to "pm_attr_list".
2. refine create & remove device node functions parameter.

fix:
drm/amdgpu: optimize amdgpu device attribute code

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h