[PATCH] drm/amdgpu: avoid sleep while executing atombios table

Deucher, Alexander Alexander.Deucher at amd.com
Wed May 30 15:21:32 UTC 2018


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Shirish S
> Sent: Wednesday, May 30, 2018 6:19 AM
> To: amd-gfx at lists.freedesktop.org; Wentland, Harry
> <Harry.Wentland at amd.com>; Zhu, Rex <Rex.Zhu at amd.com>
> Cc: S, Shirish <Shirish.S at amd.com>
> Subject: [PATCH] drm/amdgpu: avoid sleep while executing atombios table
> 
> This patch replaces kzalloc's flag from GFP_KERNEL to GFP_ATOMIC to avoid
> sleeping in atomic context.
> 
> Signed-off-by: Shirish S <shirish.s at amd.com>

Does this actually fix a bug or is it just to be safe.  Do actually call atom command tables in an atomic context?

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/atom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c
> b/drivers/gpu/drm/amd/amdgpu/atom.c
> index bfd98f0..da4558c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atom.c
> +++ b/drivers/gpu/drm/amd/amdgpu/atom.c
> @@ -1221,7 +1221,7 @@ static int
> amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index,
>  	ectx.abort = false;
>  	ectx.last_jump = 0;
>  	if (ws)
> -		ectx.ws = kzalloc(4 * ws, GFP_KERNEL);
> +		ectx.ws = kzalloc(4 * ws, GFP_ATOMIC);
>  	else
>  		ectx.ws = NULL;
> 
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list