* [PATCH] drm/amdgpu: define macros for retire page reservation
@ 2019-10-22 3:43 Chen, Guchun
[not found] ` <20191022034256.30266-1-guchun.chen-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Chen, Guchun @ 2019-10-22 3:43 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Zhang, Hawking, Li,
Dennis, Grodzovsky, Andrey, Zhou1, Tao
Cc: Chen, Guchun
Easy for maintainance.
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 2d9e13d2a71a..796326b36e00 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -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;
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: define macros for retire page reservation
[not found] ` <20191022034256.30266-1-guchun.chen-5C7GfCeVMHo@public.gmane.org>
@ 2019-10-22 8:54 ` Christian König
2019-10-22 13:36 ` Deucher, Alexander
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2019-10-22 8:54 UTC (permalink / raw)
To: Chen, Guchun, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Zhang,
Hawking, Li, Dennis, Grodzovsky, Andrey, Zhou1, Tao
Am 22.10.19 um 05:43 schrieb Chen, Guchun:
> Easy for maintainance.
>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 2d9e13d2a71a..796326b36e00 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -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;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] drm/amdgpu: define macros for retire page reservation
[not found] ` <20191022034256.30266-1-guchun.chen-5C7GfCeVMHo@public.gmane.org>
2019-10-22 8:54 ` Christian König
@ 2019-10-22 13:36 ` Deucher, Alexander
1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2019-10-22 13:36 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Zhang, Hawking, Li,
Dennis, Grodzovsky, Andrey, Zhou1, Tao
Cc: Chen, Guchun
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Chen, Guchun
> Sent: Monday, October 21, 2019 11:43 PM
> To: amd-gfx@lists.freedesktop.org; Zhang, Hawking
> <Hawking.Zhang@amd.com>; Li, Dennis <Dennis.Li@amd.com>;
> Grodzovsky, Andrey <Andrey.Grodzovsky@amd.com>; Zhou1, Tao
> <Tao.Zhou1@amd.com>
> Cc: Chen, Guchun <Guchun.Chen@amd.com>
> Subject: [PATCH] drm/amdgpu: define macros for retire page reservation
>
> Easy for maintainance.
>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 2d9e13d2a71a..796326b36e00 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -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;
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-22 13:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 3:43 [PATCH] drm/amdgpu: define macros for retire page reservation Chen, Guchun
[not found] ` <20191022034256.30266-1-guchun.chen-5C7GfCeVMHo@public.gmane.org>
2019-10-22 8:54 ` Christian König
2019-10-22 13:36 ` Deucher, Alexander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.