drm/amdgpu: define macros for retire page reservation
Subsystems (2)
PATCH 1/1 drm/amdgpu: define macros for retire page reservation
Easy for maintainance.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +11 -6
@@ -68,6 +68,11 @@ const char *ras_block_string[] = {/* inject address is 52 bits */ #define RAS_UMC_INJECT_ADDR_LIMIT (0x1ULL << 52) +enum amdgpu_ras_retire_page_reservation { +AMDGPU_RAS_RETIRE_PAGE_RESERVED , +AMDGPU_RAS_RETIRE_PAGE_PENDING , +AMDGPU_RAS_RETIRE_PAGE_FAULT , +};atomic_t amdgpu_ras_in_intr =ATOMIC_INIT (0 );
@@ -809,11 +814,11 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,static char *amdgpu_ras_badpage_flags_str (unsigned int flags) {switch (flags) { -case 0 : +case AMDGPU_RAS_RETIRE_PAGE_RESERVED :return "R" ; -case 1 : +case AMDGPU_RAS_RETIRE_PAGE_PENDING :return "P" ; -case 2 : +case AMDGPU_RAS_RETIRE_PAGE_FAULT :default :return "F" ; };
@@ -1294,13 +1299,13 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, (*bps)[i] = (struct ras_badpage ){ .bp = data->bps[i].retired_page, .size =AMDGPU_GPU_PAGE_SIZE , - .flags =0 , + .flags =AMDGPU_RAS_RETIRE_PAGE_RESERVED , };if (data->last_reserved <= i) - (*bps)[i].flags =1 ; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_PENDING ;else if (data->bps_bo[i] ==NULL ) - (*bps)[i].flags =2 ; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_FAULT ; } *count = data->count;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Christian König
Acked-byAm 22.10.19 um 05:43 schrieb Chen, Guchun:
Quoted 3 lines
Easy for maintainance.
Signed-off-by Guchun Chen <[email protected]>
Quoted 42 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +9
-4@@ -68,6 +68,11 @@ const char *ras_block_string[] = {/* inject address is 52 bits */ #define RAS_UMC_INJECT_ADDR_LIMIT (0x1ULL << 52) +enum amdgpu_ras_retire_page_reservation { +AMDGPU_RAS_RETIRE_PAGE_RESERVED , +AMDGPU_RAS_RETIRE_PAGE_PENDING , +AMDGPU_RAS_RETIRE_PAGE_FAULT , +};atomic_t amdgpu_ras_in_intr =ATOMIC_INIT (0 );@@ -809,11 +814,11 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,static char *amdgpu_ras_badpage_flags_str (unsigned int flags) {switch (flags) { -case 0 : +case AMDGPU_RAS_RETIRE_PAGE_RESERVED :return "R" ; -case 1 : +case AMDGPU_RAS_RETIRE_PAGE_PENDING :return "P" ; -case 2 : +case AMDGPU_RAS_RETIRE_PAGE_FAULT :default :return "F" ; };@@ -1294,13 +1299,13 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, (*bps)[i] = (struct ras_badpage ){ .bp = data->bps[i].retired_page, .size =AMDGPU_GPU_PAGE_SIZE , - .flags =0 , + .flags =AMDGPU_RAS_RETIRE_PAGE_RESERVED , };
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, · line 1311
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2
-2if (data->last_reserved <= i) - (*bps)[i].flags =1 ; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_PENDING ;else if (data->bps_bo[i] ==NULL ) - (*bps)[i].flags =2 ; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_FAULT ; } *count = data->count;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 11 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Chen, Guchun
Sent: Monday, October 21, 2019 11:43 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Grodzovsky, Andrey <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: define macros for retire page reservation
Quoted 3 lines
Easy for maintainance.
Signed-off-by Guchun Chen <[email protected]>
Quoted 59 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +5
-0@@ -68,6 +68,11 @@ const char *ras_block_string[] = {/* inject address is 52 bits */ #define RAS_UMC_INJECT_ADDR_LIMIT (0x1ULL << 52) +enum amdgpu_ras_retire_page_reservation { +AMDGPU_RAS_RETIRE_PAGE_RESERVED , +AMDGPU_RAS_RETIRE_PAGE_PENDING , +AMDGPU_RAS_RETIRE_PAGE_FAULT , +};atomic_t amdgpu_ras_in_intr =ATOMIC_INIT (0 );@@ -809,11 +814,11 @@ static int amdgpu_ras_badpages_read(struct
amdgpu_device*adev, static char *amdgpu_ras_badpage_flags_str(unsigned int flags) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +6
-6switch (flags) { -case 0 : +case AMDGPU_RAS_RETIRE_PAGE_RESERVED :return "R" ; -case 1 : +case AMDGPU_RAS_RETIRE_PAGE_PENDING :return "P" ; -case 2 : +case AMDGPU_RAS_RETIRE_PAGE_FAULT :default :return "F" ; };@@ -1294,13 +1299,13 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, (*bps)[i] = (struct ras_badpage ){ .bp = data->bps[i].retired_page, .size =AMDGPU_GPU_PAGE_SIZE , - .flags =0 , + .flags =AMDGPU_RAS_RETIRE_PAGE_RESERVED , };if (data->last_reserved <= i) - (*bps)[i].flags =1 ; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_PENDING ;else if (data->bps_bo[i] ==NULL ) - (*bps)[i].flags = 2; + (*bps)[i].flags =AMDGPU_RAS_RETIRE_PAGE_FAULT ;drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1} *count = data->count; --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx