<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div dir="auto">Hi Jack,
<div dir="auto"><br>
</div>
<div dir="auto">Well that believe is unfortunately completely wrong.</div>
<div dir="auto"><br>
</div>
<div dir="auto">The point is that ANY use of amdgpu by userspace will prevent correct driver unload, that qxl is used for the fbcon doesn't change anything here.</div>
<div dir="auto"><br>
</div>
<div dir="auto">So the patch is a clear NAK. Driver unload is not supposed to work even under SRIOV.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards,</div>
<div dir="auto">Christian.</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">Am 18.09.2019 09:32 schrieb "Zhang, Jack (Jian)" <Jack.Zhang1@amd.com>:<br type="attribution">
</div>
</div>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi, Christian and folks,<br>
<br>
In virtual machines(such virt-manager), there's always a virtual graphics device existed like "qxl" as the default gfx device.<br>
So under such condition, we believe it's reasonable to unload amdgpu driver as it is not treated as the default fbcon device.<br>
<br>
Would you please help to review this patch?<br>
<br>
Best wishes,<br>
Jack<br>
<br>
-----Original Message-----<br>
From: Jack Zhang <Jack.Zhang1@amd.com> <br>
Sent: Wednesday, September 18, 2019 3:25 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com><br>
Subject: [PATCH] drm/amdgpu/sriov: omit fbcon error under sriov or passthrough<br>
<br>
In virtual machine, there would be a qxl or cirrus graphics device as the default master fbcon device.<br>
<br>
So for PF(passthrough mode) or SRIOV VF, it is reasonable to unload amdgpu driver. Amdgpu doesn't have to be the only fbcon device under this condition.<br>
<br>
Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 420888e..ada2b25 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -1103,8 +1103,9 @@ static void<br>
 amdgpu_pci_remove(struct pci_dev *pdev)  {<br>
         struct drm_device *dev = pci_get_drvdata(pdev);<br>
-<br>
-       DRM_ERROR("Device removal is currently not supported outside of fbcon\n");<br>
+       struct amdgpu_device *adev = dev->dev_private;<br>
+       if (!amdgpu_sriov_vf(adev) && !amdgpu_passthrough(adev))<br>
+               DRM_ERROR("Device removal is currently not supported outside of <br>
+fbcon\n");<br>
         drm_dev_unplug(dev);<br>
         drm_dev_put(dev);<br>
         pci_disable_device(pdev);<br>
--<br>
2.7.4<br>
<br>
</div>
</span></font>
</body>
</html>