AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Wan <Gavin.Wan@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Gavin Wan <Gavin.Wan@amd.com>
Subject: [PATCH] drm/amdgpu: Disable GPU reset on SRIOV before remove pci.
Date: Mon, 24 Oct 2022 15:45:15 -0400	[thread overview]
Message-ID: <20221024194515.7545-1-Gavin.Wan@amd.com> (raw)

  The change "Adjust removal control flow for smu v13_0_2"
  brought a bug on SRIOV envrionment. It caused unloading
  amdgpu failed on Guest VM. The reason is that the VF FLR was
  requested while unloading amdgpu driver, but VF FLR of SRIOV
  sequence is wrong while removing PCI device.

Signed-off-by: Gavin Wan <Gavin.Wan@amd.com>
Change-Id: I1ff8dcbffd85d7f3d8267d660fd8292423d2f70f
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 16f6a313335e..ab0c856c13b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2187,7 +2187,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)
 		pm_runtime_forbid(dev->dev);
 	}
 
-	if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2)) {
+	if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2)) &&
+			!amdgpu_sriov_vf(adev)) {
 		bool need_to_reset_gpu = false;
 
 		if (adev->gmc.xgmi.num_physical_nodes > 1) {
-- 
2.34.1


             reply	other threads:[~2022-10-24 19:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 19:45 Gavin Wan [this message]
2022-10-24 19:52 ` [PATCH] drm/amdgpu: Disable GPU reset on SRIOV before remove pci Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 20:03 Gavin Wan
2022-10-24 20:06 ` Alex Deucher
2022-10-24 20:21 Gavin Wan
2022-10-25  9:30 ` Christian König
2022-10-25 14:16 Gavin Wan

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=20221024194515.7545-1-Gavin.Wan@amd.com \
    --to=gavin.wan@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