diff options
| author | Alex Deucher <alexander.deucher@amd.com> | 2017-09-28 09:47:32 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-28 16:03:20 -0400 |
| commit | e23b74aab5dc48d3e508a2bc171ccd152fb03803 (patch) | |
| tree | b715c0cff8755ec4f0b51bc696080e982e881bb7 /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | |
| parent | 6f87a895709eecc1542fe947e349364ad061ac00 (diff) | |
drm/amdgpu: fix vf error handling
The error handling for virtual functions assumed a single
vf per VM and didn't properly account for bare metal. Make
the error arrays per device and add locking.
Reviewed-by: Gavin Wan <gavin.wan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index afcfb8bcfb65..e5fd0ff6b29d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | |||
| @@ -36,6 +36,18 @@ struct amdgpu_mm_table { | |||
| 36 | uint64_t gpu_addr; | 36 | uint64_t gpu_addr; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | #define AMDGPU_VF_ERROR_ENTRY_SIZE 16 | ||
| 40 | |||
| 41 | /* struct error_entry - amdgpu VF error information. */ | ||
| 42 | struct amdgpu_vf_error_buffer { | ||
| 43 | struct mutex lock; | ||
| 44 | int read_count; | ||
| 45 | int write_count; | ||
| 46 | uint16_t code[AMDGPU_VF_ERROR_ENTRY_SIZE]; | ||
| 47 | uint16_t flags[AMDGPU_VF_ERROR_ENTRY_SIZE]; | ||
| 48 | uint64_t data[AMDGPU_VF_ERROR_ENTRY_SIZE]; | ||
| 49 | }; | ||
| 50 | |||
| 39 | /** | 51 | /** |
| 40 | * struct amdgpu_virt_ops - amdgpu device virt operations | 52 | * struct amdgpu_virt_ops - amdgpu device virt operations |
| 41 | */ | 53 | */ |
| @@ -59,6 +71,7 @@ struct amdgpu_virt { | |||
| 59 | struct work_struct flr_work; | 71 | struct work_struct flr_work; |
| 60 | struct amdgpu_mm_table mm_table; | 72 | struct amdgpu_mm_table mm_table; |
| 61 | const struct amdgpu_virt_ops *ops; | 73 | const struct amdgpu_virt_ops *ops; |
| 74 | struct amdgpu_vf_error_buffer vf_errors; | ||
| 62 | }; | 75 | }; |
| 63 | 76 | ||
| 64 | #define AMDGPU_CSA_SIZE (8 * 1024) | 77 | #define AMDGPU_CSA_SIZE (8 * 1024) |
