AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch,
	Hawking.Zhang@amd.com, Felix.Kuehling@amd.com, ray.huang@amd.com,
	lee.jones@linaro.org
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] gpu: drm: amd: amdgpu: possible ABBA deadlock in amdgpu_set_power_dpm_force_performance_level() and amdgpu_debugfs_process_reg_op()
Date: Thu, 9 Dec 2021 11:34:38 +0800	[thread overview]
Message-ID: <963eab5f-f333-456e-784c-0d2c81b849da@gmail.com> (raw)
In-Reply-To: <2dc31435-ba62-b6a4-76dc-cfe9747f4cfb@gmail.com>

Hello,

Could you please provide the feedback to my previous report?
Thanks a lot :)


Best wishes,
Jia-Ju Bai

On 2021/9/15 17:39, Jia-Ju Bai wrote:
> Hello,
>
> My static analysis tool reports a possible ABBA deadlock in the amdgpu 
> driver in Linux 5.10:
>
> amdgpu_debugfs_process_reg_op()
>   mutex_lock(&adev->grbm_idx_mutex); --> Line 250 (Lock A)
>   mutex_lock(&adev->pm.mutex); --> Line 259 (Lock B)
>
> amdgpu_set_power_dpm_force_performance_level()
>   mutex_lock(&adev->pm.mutex); --> Line 381 (Lock B)
>     pp_dpm_force_performance_level() --> function pointer via 
> "amdgpu_dpm_force_performance_level()"
>       pp_dpm_en_umd_pstate()
>         amdgpu_device_ip_set_clockgating_state()
>           gfx_v7_0_set_clockgating_state() --> function pointer via 
> "funcs->set_clockgating_state()"
>             gfx_v7_0_enable_mgcg()
>               mutex_lock(&adev->grbm_idx_mutex); --> Line 3646 (Lock A)
>               mutex_lock(&adev->grbm_idx_mutex); --> Line 3697 (Lock A)
>
> When amdgpu_debugfs_process_reg_op() and 
> amdgpu_set_power_dpm_force_performance_level() are concurrently 
> executed, the deadlock can occur.
>
> I am not quite sure whether this possible deadlock is real and how to 
> fix it if it is real.
> Any feedback would be appreciated, thanks :)
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
>
>
> Best wishes,
> Jia-Ju Bai


      reply	other threads:[~2021-12-09 17:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  9:39 [BUG] gpu: drm: amd: amdgpu: possible ABBA deadlock in amdgpu_set_power_dpm_force_performance_level() and amdgpu_debugfs_process_reg_op() Jia-Ju Bai
2021-12-09  3:34 ` Jia-Ju Bai [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=963eab5f-f333-456e-784c-0d2c81b849da@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray.huang@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox