drm/amdgpu: optimize the gpu reset for XGMI setup V2
authorEvan Quan <evan.quan@amd.com>
Thu, 16 Apr 2020 04:27:28 +0000 (12:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 22 Apr 2020 22:11:49 +0000 (18:11 -0400)
commit9e94d22c008585815f32630ee7d0d28c4ec12bb7
tree5fd7290efd9404a867ac7c8adf2c68ec851d1c90
parent52fb44cf30fc6b11a2faf8d8d905e756ea24f919
drm/amdgpu: optimize the gpu reset for XGMI setup V2

This is basically just some code cosmetic. The current design
for XGMI setup gput reset is to operate on current device(adev)
first and then on other devices from the hive(by another 'for' loop).
But actually we can do some sort to the device list(to put current
device 1st position) and handle all the devices in a single 'for'
loop.

V2: added missing hive->hive_lock protection

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c