mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-10 15:54:39 +08:00
drm/amdgpu: move some ras data structure to amdgpu_ras.h
These are common structures that can be included by IP specific source files Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Dennis Li <dennis.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fa1884f9d8
commit
7af25d5b7e
@ -30,74 +30,6 @@
|
|||||||
#include "amdgpu_ras.h"
|
#include "amdgpu_ras.h"
|
||||||
#include "amdgpu_atomfirmware.h"
|
#include "amdgpu_atomfirmware.h"
|
||||||
|
|
||||||
struct ras_ih_data {
|
|
||||||
/* interrupt bottom half */
|
|
||||||
struct work_struct ih_work;
|
|
||||||
int inuse;
|
|
||||||
/* IP callback */
|
|
||||||
ras_ih_cb cb;
|
|
||||||
/* full of entries */
|
|
||||||
unsigned char *ring;
|
|
||||||
unsigned int ring_size;
|
|
||||||
unsigned int element_size;
|
|
||||||
unsigned int aligned_element_size;
|
|
||||||
unsigned int rptr;
|
|
||||||
unsigned int wptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ras_fs_data {
|
|
||||||
char sysfs_name[32];
|
|
||||||
char debugfs_name[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ras_err_data {
|
|
||||||
unsigned long ue_count;
|
|
||||||
unsigned long ce_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ras_err_handler_data {
|
|
||||||
/* point to bad pages array */
|
|
||||||
struct {
|
|
||||||
unsigned long bp;
|
|
||||||
struct amdgpu_bo *bo;
|
|
||||||
} *bps;
|
|
||||||
/* the count of entries */
|
|
||||||
int count;
|
|
||||||
/* the space can place new entries */
|
|
||||||
int space_left;
|
|
||||||
/* last reserved entry's index + 1 */
|
|
||||||
int last_reserved;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ras_manager {
|
|
||||||
struct ras_common_if head;
|
|
||||||
/* reference count */
|
|
||||||
int use;
|
|
||||||
/* ras block link */
|
|
||||||
struct list_head node;
|
|
||||||
/* the device */
|
|
||||||
struct amdgpu_device *adev;
|
|
||||||
/* debugfs */
|
|
||||||
struct dentry *ent;
|
|
||||||
/* sysfs */
|
|
||||||
struct device_attribute sysfs_attr;
|
|
||||||
int attr_inuse;
|
|
||||||
|
|
||||||
/* fs node name */
|
|
||||||
struct ras_fs_data fs_data;
|
|
||||||
|
|
||||||
/* IH data */
|
|
||||||
struct ras_ih_data ih_data;
|
|
||||||
|
|
||||||
struct ras_err_data err_data;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ras_badpage {
|
|
||||||
unsigned int bp;
|
|
||||||
unsigned int size;
|
|
||||||
unsigned int flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *ras_error_string[] = {
|
const char *ras_error_string[] = {
|
||||||
"none",
|
"none",
|
||||||
"parity",
|
"parity",
|
||||||
|
@ -108,8 +108,75 @@ struct amdgpu_ras {
|
|||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* interfaces for IP */
|
struct ras_ih_data {
|
||||||
|
/* interrupt bottom half */
|
||||||
|
struct work_struct ih_work;
|
||||||
|
int inuse;
|
||||||
|
/* IP callback */
|
||||||
|
ras_ih_cb cb;
|
||||||
|
/* full of entries */
|
||||||
|
unsigned char *ring;
|
||||||
|
unsigned int ring_size;
|
||||||
|
unsigned int element_size;
|
||||||
|
unsigned int aligned_element_size;
|
||||||
|
unsigned int rptr;
|
||||||
|
unsigned int wptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ras_fs_data {
|
||||||
|
char sysfs_name[32];
|
||||||
|
char debugfs_name[32];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ras_err_data {
|
||||||
|
unsigned long ue_count;
|
||||||
|
unsigned long ce_count;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ras_err_handler_data {
|
||||||
|
/* point to bad pages array */
|
||||||
|
struct {
|
||||||
|
unsigned long bp;
|
||||||
|
struct amdgpu_bo *bo;
|
||||||
|
} *bps;
|
||||||
|
/* the count of entries */
|
||||||
|
int count;
|
||||||
|
/* the space can place new entries */
|
||||||
|
int space_left;
|
||||||
|
/* last reserved entry's index + 1 */
|
||||||
|
int last_reserved;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ras_manager {
|
||||||
|
struct ras_common_if head;
|
||||||
|
/* reference count */
|
||||||
|
int use;
|
||||||
|
/* ras block link */
|
||||||
|
struct list_head node;
|
||||||
|
/* the device */
|
||||||
|
struct amdgpu_device *adev;
|
||||||
|
/* debugfs */
|
||||||
|
struct dentry *ent;
|
||||||
|
/* sysfs */
|
||||||
|
struct device_attribute sysfs_attr;
|
||||||
|
int attr_inuse;
|
||||||
|
|
||||||
|
/* fs node name */
|
||||||
|
struct ras_fs_data fs_data;
|
||||||
|
|
||||||
|
/* IH data */
|
||||||
|
struct ras_ih_data ih_data;
|
||||||
|
|
||||||
|
struct ras_err_data err_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ras_badpage {
|
||||||
|
unsigned int bp;
|
||||||
|
unsigned int size;
|
||||||
|
unsigned int flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* interfaces for IP */
|
||||||
struct ras_fs_if {
|
struct ras_fs_if {
|
||||||
struct ras_common_if head;
|
struct ras_common_if head;
|
||||||
char sysfs_name[32];
|
char sysfs_name[32];
|
||||||
|
Loading…
Reference in New Issue
Block a user