drm/amdgpu: Fix koops when accessing RAS EEPROM
authorLuben Tuikov <luben.tuikov@amd.com>
Fri, 30 Apr 2021 00:15:42 +0000 (20:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 1 Jul 2021 04:25:33 +0000 (00:25 -0400)
commit1d9d2ca85b32605ac9c74c8fa42d0c1cfbe019d4
treea8c19dff506f3d0434b3ac9b18c4653e40d483b5
parentd456f3875af2eb5bf5a9cbd526622801ffc51037
drm/amdgpu: Fix koops when accessing RAS EEPROM

Debugfs RAS EEPROM files are available when
the ASIC supports RAS, and when the debugfs is
enabled, an also when "ras_enable" module
parameter is set to 0. However in this case,
we get a kernel oops when accessing some of
the "ras_..." controls in debugfs. The reason
for this is that struct amdgpu_ras::adev is
unset. This commit sets it, thus enabling access
to those facilities. Note that this facilitates
EEPROM access and not necessarily RAS features or
functionality.

Cc: Alexander Deucher <Alexander.Deucher@amd.com>
Cc: John Clements <john.clements@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Acked-by: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c