amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Chen, Guchun" <Guchun.Chen@amd.com>
To: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Liu01, Tong (Esther)" <Tong.Liu01@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Xiao, Jack" <Jack.Xiao@amd.com>,
	"Chen, Horace" <Horace.Chen@amd.com>,
	"Tuikov, Luben" <Luben.Tuikov@amd.com>,
	"Quan, Evan" <Evan.Quan@amd.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	"Zhang, Hawking" <Hawking.Zhang@amd.com>
Subject: RE: [PATCH] drm/amdgpu: skip unload tmr when tmr is not loaded
Date: Wed, 22 Mar 2023 01:40:24 +0000	[thread overview]
Message-ID: <DM5PR12MB24695E3802F747A6D97B19A8F1869@DM5PR12MB2469.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BL1PR12MB5144C514C69B42718855FB22F7819@BL1PR12MB5144.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2986 bytes --]

[Public]

         struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);

+       /* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR.
+        * Already set up by host driver.
+        */
+       if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp))
+               return 0;

This will lead to a psp lock leak by acquire_psp_cmd_buf. It needs to put 'cmd = acquire_psp_cmd_buf(psp);' after SRIOV check.

Regards,
Guchun

From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Deucher, Alexander
Sent: Tuesday, March 21, 2023 10:30 PM
To: Liu01, Tong (Esther) <Tong.Liu01@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Xiao, Jack <Jack.Xiao@amd.com>; Chen, Horace <Horace.Chen@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu: skip unload tmr when tmr is not loaded


[Public]


[Public]

Reviewed-by: Alex Deucher <alexander.deucher@amd.com<mailto:alexander.deucher@amd.com>>
________________________________
From: Tong Liu01 <Tong.Liu01@amd.com<mailto:Tong.Liu01@amd.com>>
Sent: Tuesday, March 21, 2023 5:19 AM
To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>
Cc: Quan, Evan <Evan.Quan@amd.com<mailto:Evan.Quan@amd.com>>; Chen, Horace <Horace.Chen@amd.com<mailto:Horace.Chen@amd.com>>; Tuikov, Luben <Luben.Tuikov@amd.com<mailto:Luben.Tuikov@amd.com>>; Koenig, Christian <Christian.Koenig@amd.com<mailto:Christian.Koenig@amd.com>>; Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>; Xiao, Jack <Jack.Xiao@amd.com<mailto:Jack.Xiao@amd.com>>; Zhang, Hawking <Hawking.Zhang@amd.com<mailto:Hawking.Zhang@amd.com>>; Liu01, Tong (Esther) <Tong.Liu01@amd.com<mailto:Tong.Liu01@amd.com>>
Subject: [PATCH] drm/amdgpu: skip unload tmr when tmr is not loaded

[why]
For Navi12 and CHIP_SIENNA_CICHLID SRIOV, TMR is not loaded. Should
also skip tmr unload

Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com<mailto:Tong.Liu01@amd.com>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 0b9e99c35a05..69addf2751aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -841,6 +841,12 @@ static int psp_tmr_unload(struct psp_context *psp)
         int ret;
         struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);

+       /* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR.
+        * Already set up by host driver.
+        */
+       if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp))
+               return 0;
+
         psp_prep_tmr_unload_cmd_buf(psp, cmd);
         dev_dbg(psp->adev->dev, "free PSP TMR buffer\n");

--
2.34.1

[-- Attachment #2: Type: text/html, Size: 7550 bytes --]

  reply	other threads:[~2023-03-22  1:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  9:19 [PATCH] drm/amdgpu: skip unload tmr when tmr is not loaded Tong Liu01
2023-03-21 14:30 ` Deucher, Alexander
2023-03-22  1:40   ` Chen, Guchun [this message]
2023-03-22  2:36 Tong Liu01
2023-03-22  3:26 ` Chen, Guchun

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=DM5PR12MB24695E3802F747A6D97B19A8F1869@DM5PR12MB2469.namprd12.prod.outlook.com \
    --to=guchun.chen@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Evan.Quan@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Horace.Chen@amd.com \
    --cc=Jack.Xiao@amd.com \
    --cc=Luben.Tuikov@amd.com \
    --cc=Tong.Liu01@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).