]> 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 09:53:51 +0000 (11:53 +0200)
commita3e3a640d4fd9d7d40c1737e2b4373b7f4470eab
tree183df9612ef3eca80d10bef9562b2cebd96bae15
parent3e1fa150e79897cc00db8348de267abf4c6c35be
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