drm/amdgpu: Separate vf2pf work item init from virt data exchange
authorVictor Skvortsov <victor.skvortsov@amd.com>
Thu, 16 Dec 2021 17:01:45 +0000 (17:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:11:37 +0000 (11:11 +0200)
commit25a90a11036b6fd385ee75536b78659fc481d529
tree47d97a876e445efe6211e7bfbb0c1946e14231b5
parent3e98e33d345e981800e03dd29f6f6343286d30b6
drm/amdgpu: Separate vf2pf work item init from virt data exchange

[ Upstream commit 892deb48269c65376f3eeb5b4c032ff2c2979bd7 ]

We want to be able to call virt data exchange conditionally
after gmc sw init to reserve bad pages as early as possible.
Since this is a conditional call, we will need
to call it again unconditionally later in the init sequence.

Refactor the data exchange function so it can be
called multiple times without re-initializing the work item.

v2: Cleaned up the code. Kept the original call to init_exchange_data()
inside early init to initialize the work item, afterwards call
exchange_data() when needed.

Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com>
Reviewed By: Shaoyun.liu <Shaoyun.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h