RE: [PATCH 2/2] drm/amdgpu: Allow to reset to EERPOM table.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
> Sent: 2019年9月10日 4:04
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Chen, Guchun <Guchun.Chen@xxxxxxx>; Zhou1, Tao
> <Tao.Zhou1@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>; Grodzovsky, Andrey
> <Andrey.Grodzovsky@xxxxxxx>
> Subject: [PATCH 2/2] drm/amdgpu: Allow to reset to EERPOM table.
> 
> The table grows quickly during debug/development effort when multiple RAS
> errors are injected. Allow to avoid this by setting table header back to empty
> if needed.
> 
> v2: Switch to debugfs entry instead of load time parameter.
> 
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 119bedc..52c5c61 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -303,6 +303,17 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct
> file *f, const char __user *
>  	return size;
>  }
> 
> +static ssize_t amdgpu_ras_debugfs_eeprom_write(struct file *f, const char
> __user *buf,
> +		size_t size, loff_t *pos)
> +{
> +	struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)-
> >i_private;
> +	int ret;
> +
> +	ret =
> +amdgpu_ras_eeprom_reset_table(&adev->psp.ras.ras->eeprom_control);

[Tao] It's better to add table key in front of the function, with this fixed, the series is:

Reviewed-by: Tao Zhou <tao.zhou1@xxxxxxx>

> +
> +	return ret == 1 ? size : -EIO;
> +}
> +
>  static const struct file_operations amdgpu_ras_debugfs_ctrl_ops = {
>  	.owner = THIS_MODULE,
>  	.read = NULL,
> @@ -310,6 +321,13 @@ static const struct file_operations
> amdgpu_ras_debugfs_ctrl_ops = {
>  	.llseek = default_llseek
>  };
> 
> +static const struct file_operations amdgpu_ras_debugfs_eeprom_ops = {
> +	.owner = THIS_MODULE,
> +	.read = NULL,
> +	.write = amdgpu_ras_debugfs_eeprom_write,
> +	.llseek = default_llseek
> +};
> +
>  static ssize_t amdgpu_ras_sysfs_read(struct device *dev,
>  		struct device_attribute *attr, char *buf)  { @@ -951,6 +969,8
> @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct
> amdgpu_device *adev)
>  	con->dir = debugfs_create_dir("ras", minor->debugfs_root);
>  	con->ent = debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, con-
> >dir,
>  				       adev, &amdgpu_ras_debugfs_ctrl_ops);
> +	con->ent = debugfs_create_file("ras_eeprom_reset", S_IWUGO |
> S_IRUGO, con->dir,
> +					       adev,
> &amdgpu_ras_debugfs_eeprom_ops);
>  }
> 
>  void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
> --
> 2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux