]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd: Add a new helper for loading/validating microcode
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 3 Jan 2023 19:18:19 +0000 (13:18 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:59:07 +0000 (13:59 +0200)
commit9b36abb95639833c26712bbb729b42b7af8a09c0
tree3e6188a0ff285ca130e976ae3fcd1fa71b002375
parent709217fdcf0c5007cf538b5a6dc318107fd7f140
drm/amd: Add a new helper for loading/validating microcode

commit 2210af50ae7f4104269dfde7bafbbfbacdbe1a2b upstream.

All microcode runs a basic validation after it's been loaded. Each
IP block as part of init will run both.

Introduce a wrapper for request_firmware and amdgpu_ucode_validate.
This wrapper will also remap any error codes from request_firmware
to -ENODEV.  This is so that early_init will fail if firmware couldn't
be loaded instead of the IP block being disabled.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h