drm/amdgpu: restore ras flags when user resets eeprom(v2)
RAS flags needs to be cleaned as well when user requires one clean eeprom. v2: RAS flags shall be restored after eeprom reset succeeds. Signed-off-by: Guchun Chen <guchun.chen@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
e8fbaf0342
commit
bf0b91b78f
@@ -368,12 +368,19 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user *
|
|||||||
static ssize_t amdgpu_ras_debugfs_eeprom_write(struct file *f, const char __user *buf,
|
static ssize_t amdgpu_ras_debugfs_eeprom_write(struct file *f, const char __user *buf,
|
||||||
size_t size, loff_t *pos)
|
size_t size, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private;
|
struct amdgpu_device *adev =
|
||||||
|
(struct amdgpu_device *)file_inode(f)->i_private;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = amdgpu_ras_eeprom_reset_table(&adev->psp.ras.ras->eeprom_control);
|
ret = amdgpu_ras_eeprom_reset_table(
|
||||||
|
&(amdgpu_ras_get_context(adev)->eeprom_control));
|
||||||
|
|
||||||
return ret == 1 ? size : -EIO;
|
if (ret == 1) {
|
||||||
|
amdgpu_ras_get_context(adev)->flags = RAS_DEFAULT_FLAGS;
|
||||||
|
return size;
|
||||||
|
} else {
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations amdgpu_ras_debugfs_ctrl_ops = {
|
static const struct file_operations amdgpu_ras_debugfs_ctrl_ops = {
|
||||||
|
|||||||
Reference in New Issue
Block a user