AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Liang, Prike" <Prike.Liang@amd.com>,
	"Timur Kristóf" <timur.kristof@gmail.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Limonciello, Mario" <Mario.Limonciello@amd.com>,
	"Dan Carpenter" <dan.carpenter@linaro.org>
Subject: Re: [PATCH] drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
Date: Mon, 19 Jan 2026 11:33:08 +0100	[thread overview]
Message-ID: <c0b8da75-7f89-4fd1-8d98-79f47e2a2f6a@amd.com> (raw)
In-Reply-To: <DS7PR12MB6005D5AA955F34114114F779FB88A@DS7PR12MB6005.namprd12.prod.outlook.com>

On 1/19/26 06:27, Liang, Prike wrote:
> [Public]
> 
> In order to avoid being blocked by the lock issue on some older GFX, I will push the patch to amd-staging-drm-next.
> If you have any concerns, please let me know.

I only had a coding style comment on the patch and also gave my rb with that as well.

So if you haven't pushed it yet please fix what I've pointed out. Otherwise it is not much of an issue.

Regards,
Christian.

> 
> Regards,
>       Prike
> 
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Liang, Prike
>> Sent: Monday, January 19, 2026 9:58 AM
>> To: Timur Kristóf <timur.kristof@gmail.com>; amd-gfx@lists.freedesktop.org;
>> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
>> <Christian.Koenig@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com>;
>> Dan Carpenter <dan.carpenter@linaro.org>
>> Subject: RE: [PATCH] drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
>>
>> [Public]
>>
>> Thank you for the fix. Could you please add the following the tags?
>>
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
>> | Closes: https://lore.kernel.org/r/202601190121.z9C0uml5-lkp@intel.com/
>>
>> Reviewed-by: Prike Liang <Prike.Liang@amd.com>
>>
>> Regards,
>>       Prike
>>
>>> -----Original Message-----
>>> From: Timur Kristóf <timur.kristof@gmail.com>
>>> Sent: Sunday, January 18, 2026 8:58 PM
>>> To: amd-gfx@lists.freedesktop.org; Deucher, Alexander
>>> <Alexander.Deucher@amd.com>; Koenig, Christian
>>> <Christian.Koenig@amd.com>; Liang, Prike <Prike.Liang@amd.com>;
>>> Limonciello, Mario <Mario.Limonciello@amd.com>
>>> Cc: Timur Kristóf <timur.kristof@gmail.com>
>>> Subject: [PATCH] drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
>>>
>>> When a function holds a lock and we return without unlocking it, it
>>> deadlocks the kernel. We should always unlock before returning.
>>>
>>> This commit fixes suspend/resume on SI.
>>> Tested on two Tahiti GPUs: FirePro W9000 and R9 280X.
>>>
>>> Fixes: bc2dea30038a ("drm/amdgpu: validate the flush_gpu_tlb_pasid()")
>>> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
>>> ---
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
>>> index 0e67fa4338ff..4fa24be1bf45 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
>>> @@ -769,7 +769,7 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct
>>> amdgpu_device *adev, uint16_t pasid,
>>>       struct amdgpu_ring *ring = &adev->gfx.kiq[inst].ring;
>>>       struct amdgpu_kiq *kiq = &adev->gfx.kiq[inst];
>>>       unsigned int ndw;
>>> -     int r, cnt = 0;
>>> +     int r = 0, cnt = 0;
>>>       uint32_t seq;
>>>
>>>       /*
>>> @@ -782,7 +782,7 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct
>>> amdgpu_device *adev, uint16_t pasid,
>>>       if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
>>>
>>>               if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid)
>>> -                     return 0;
>>> +                     goto error_unlock_reset;
>>>
>>>               if (adev->gmc.flush_tlb_needs_extra_type_2)
>>>                       adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev,
>>> pasid, @@ -797,7 +797,6 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct
>>> amdgpu_device *adev, uint16_t pasid,
>>>               adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
>>>                                                        flush_type, all_hub,
>>>                                                        inst);
>>> -             r = 0;
>>>       } else {
>>>               /* 2 dwords flush + 8 dwords fence */
>>>               ndw = kiq->pmf->invalidate_tlbs_size + 8;
>>> --
>>> 2.52.0
> 


  parent reply	other threads:[~2026-01-19 10:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-18 12:57 [PATCH] drm/amdgpu: Fix validating flush_gpu_tlb_pasid() Timur Kristóf
2026-01-19  1:57 ` Liang, Prike
2026-01-19  5:27   ` Liang, Prike
2026-01-19  9:00     ` Timur Kristóf
2026-01-19 10:33     ` Christian König [this message]
2026-01-19 11:44       ` Liang, Prike
2026-01-19 10:12 ` Christian König
2026-01-19 11:20   ` Timur Kristóf
2026-01-19 11:47     ` Liang, Prike
  -- strict thread matches above, loose matches on Subject: below --
2026-01-19 12:07 Prike Liang

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=c0b8da75-7f89-4fd1-8d98-79f47e2a2f6a@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dan.carpenter@linaro.org \
    --cc=timur.kristof@gmail.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