All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen, Guchun" <Guchun.Chen@amd.com>
To: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
	"Lakha, Bhawanpreet" <Bhawanpreet.Lakha@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/amd/display: Fix deadlock during gpu reset v3
Date: Wed, 13 Jan 2021 02:04:37 +0000	[thread overview]
Message-ID: <CY4PR12MB1287EC7EF636A32149A108D4F1A90@CY4PR12MB1287.namprd12.prod.outlook.com> (raw)
In-Reply-To: <f1c18246-cb0e-bb6b-d69d-76f88852fa3c@amd.com>

[AMD Public Use]

Reviewed-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com> 
Sent: Wednesday, January 13, 2021 12:21 AM
To: Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Fix deadlock during gpu reset v3

On 2021-01-12 11:13 a.m., Bhawanpreet Lakha wrote:
> [Why]
> during idle optimizations we acquire the dc_lock, this lock is also 
> acquired during gpu_reset so we end up hanging the system due to a 
> deadlock
> 
> [How]
> If we are in gpu reset:
>   - disable idle optimizations and skip calls to the dc function
> 
> v2: skip idle optimizations calls
> v3: add guard for DCN
> 
> Fixes: 06d5652541c3 ("drm/amd/display: enable idle optimizations for 
> linux (MALL stutter)")
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Regards,
Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index de71b6c21590..82ceb0a8ba29 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1816,6 +1816,11 @@ static int dm_suspend(void *handle)
>   
>   	if (amdgpu_in_reset(adev)) {
>   		mutex_lock(&dm->dc_lock);
> +
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> +		dc_allow_idle_optimizations(adev->dm.dc, false); #endif
> +
>   		dm->cached_dc_state = dc_copy_state(dm->dc->current_state);
>   
>   		dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); 
> @@ -5556,6 +5561,10 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
>   	if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
>   		return -EBUSY;
>   
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> +	if (amdgpu_in_reset(adev))
> +		return 0;
> +
>   	mutex_lock(&dm->dc_lock);
>   
>   	if (enable)
> @@ -5572,6 +5581,7 @@ static inline int dm_set_vblank(struct drm_crtc 
> *crtc, bool enable)
>   
>   	mutex_unlock(&dm->dc_lock);
>   
> +#endif
>   	return 0;
>   }
>   
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      reply	other threads:[~2021-01-13  2:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 21:02 [PATCH] drm/amd/display: Fix deadlock during gpu reset v2 Bhawanpreet Lakha
2021-01-12  3:01 ` Chen, Guchun
2021-01-12 16:03   ` Lakha, Bhawanpreet
2021-01-12 16:06     ` Lakha, Bhawanpreet
2021-01-12 16:13       ` [PATCH] drm/amd/display: Fix deadlock during gpu reset v3 Bhawanpreet Lakha
2021-01-12 16:20         ` Kazlauskas, Nicholas
2021-01-13  2:04           ` Chen, Guchun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR12MB1287EC7EF636A32149A108D4F1A90@CY4PR12MB1287.namprd12.prod.outlook.com \
    --to=guchun.chen@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.