Skip to content

Commit

Permalink
drm/amdgpu/psp: move psp version specific function pointers to early_…
Browse files Browse the repository at this point in the history
…init

In case we need to use them for GPU reset prior initializing the
asic.  Fixes a crash if the driver attempts to reset the GPU at driver
load time.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Alex Deucher committed May 9, 2019
1 parent 2e26ccb commit 9d6fea5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ static void psp_set_funcs(struct amdgpu_device *adev);
static int psp_early_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct psp_context *psp = &adev->psp;

psp_set_funcs(adev);

return 0;
}

static int psp_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct psp_context *psp = &adev->psp;
int ret;

switch (adev->asic_type) {
case CHIP_VEGA10:
case CHIP_VEGA12:
Expand All @@ -67,6 +59,15 @@ static int psp_sw_init(void *handle)

psp->adev = adev;

return 0;
}

static int psp_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct psp_context *psp = &adev->psp;
int ret;

ret = psp_init_microcode(psp);
if (ret) {
DRM_ERROR("Failed to load psp firmware!\n");
Expand Down

0 comments on commit 9d6fea5

Please sign in to comment.