All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Hawking" <Hawking.Zhang@amd.com>
To: "Liu, Monk" <Monk.Liu@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Liu, Monk" <Monk.Liu@amd.com>
Subject: RE: [PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV
Date: Tue, 18 Feb 2020 11:08:16 +0000	[thread overview]
Message-ID: <DM5PR12MB141851C113DF5DC74163D94FFC110@DM5PR12MB1418.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1581994453-5498-1-git-send-email-Monk.Liu@amd.com>

[AMD Official Use Only - Internal Distribution Only]

Please remove the ticket number from the commit description. With that fixed, the patch is

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Monk Liu
Sent: Tuesday, February 18, 2020 10:54
To: amd-gfx@lists.freedesktop.org
Cc: Liu, Monk <Monk.Liu@amd.com>
Subject: [PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV

SWDEV-220810 - some register access from VF is wrong

1)
we shouldn't load PSP kdb and sys/sos for VF, they are supposed to be handled by hypervisor

2)
ih reroute doesn't work on VF thus we should avoid calling it, besides VF should not use those PSP register sets for PF

3)
shouldn't load SMU ucode under SRIOV, otherwise PSP would report error

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 ++--  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index a16c810..3494966 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1081,7 +1081,7 @@ static int psp_hw_start(struct psp_context *psp)
 	struct amdgpu_device *adev = psp->adev;
 	int ret;
 
-	if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
+	if (!amdgpu_sriov_vf(adev) && !adev->in_gpu_reset) {
 		if (psp->kdb_bin_size &&
 		    (psp->funcs->bootloader_load_kdb != NULL)) {
 			ret = psp_bootloader_load_kdb(psp);
@@ -1318,7 +1318,7 @@ static int psp_np_fw_load(struct psp_context *psp)
 
 	if (psp->autoload_supported) {
 		ucode = &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
-		if (!ucode->fw)
+		if (!ucode->fw || amdgpu_sriov_vf(adev))
 			goto out;
 
 		ret = psp_execute_np_fw_load(psp, ucode); diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 0829188..8ab3bf3 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -420,7 +420,8 @@ static int psp_v11_0_ring_init(struct psp_context *psp,
 	struct psp_ring *ring;
 	struct amdgpu_device *adev = psp->adev;
 
-	psp_v11_0_reroute_ih(psp);
+	if (!amdgpu_sriov_vf(adev))
+		psp_v11_0_reroute_ih(psp);
 
 	ring = &psp->km_ring;
 
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7C24cf8275f9b64d1f63f608d7b41dddd7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637175912688390004&amp;sdata=pPtcC%2FrKXzrrhRguc8%2FVQL61VS9s6V5Pa95MA5FSXFA%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2020-02-18 11:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18  2:54 [PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV Monk Liu
2020-02-18  2:54 ` [PATCH 2/3] drm/amdgpu: fix memory leak during TDR test Monk Liu
2020-02-18 11:10   ` Zhang, Hawking
2020-02-18  2:54 ` [PATCH 3/3] drm/amdgpu: fix colliding of preemption Monk Liu
2020-02-18 11:32   ` Zhang, Hawking
2020-02-18 11:48     ` Zhang, Hawking
2020-02-18 12:29       ` 回复: " Liu, Monk
2020-02-18 12:39         ` Christian König
2020-02-18 12:53           ` 回复: " Liu, Monk
2020-02-18 14:48             ` Fernlund, Hans
2020-02-19  5:04               ` 回复: " Liu, Monk
2020-02-19  8:27                 ` Christian König
2020-02-18 14:54         ` Zhang, Hawking
2020-02-19  5:05           ` 回复: " Liu, Monk
2020-02-18 12:19     ` Liu, Monk
2020-02-18 11:08 ` Zhang, Hawking [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=DM5PR12MB141851C113DF5DC74163D94FFC110@DM5PR12MB1418.namprd12.prod.outlook.com \
    --to=hawking.zhang@amd.com \
    --cc=Monk.Liu@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.