Re: [PATCH] drm/amdgpu/sriov: omit fbcon error under sriov or passthrough

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Driver unload works fine (barring any bugs) as long as you are not using the device.  E.g., unbound the fbcon and no apps are using the GPU.

Alex

From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Koenig, Christian <Christian.Koenig@xxxxxxx>
Sent: Wednesday, September 18, 2019 3:53 AM
To: Zhang, Jack (Jian) <Jack.Zhang1@xxxxxxx>
Cc: Deng, Emily <Emily.Deng@xxxxxxx>; Cui, Flora <Flora.Cui@xxxxxxx>; Teng, Rui <Rui.Teng@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [PATCH] drm/amdgpu/sriov: omit fbcon error under sriov or passthrough
 
Hi Jack,

Well that believe is unfortunately completely wrong.

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.

So the patch is a clear NAK. Driver unload is not supposed to work even under SRIOV.

Regards,
Christian.



Am 18.09.2019 09:32 schrieb "Zhang, Jack (Jian)" <Jack.Zhang1@xxxxxxx>:
Hi, Christian and folks,

In virtual machines(such virt-manager), there's always a virtual graphics device existed like "qxl" as the default gfx device.
So under such condition, we believe it's reasonable to unload amdgpu driver as it is not treated as the default fbcon device.

Would you please help to review this patch?

Best wishes,
Jack

-----Original Message-----
From: Jack Zhang <Jack.Zhang1@xxxxxxx>
Sent: Wednesday, September 18, 2019 3:25 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Zhang, Jack (Jian) <Jack.Zhang1@xxxxxxx>
Subject: [PATCH] drm/amdgpu/sriov: omit fbcon error under sriov or passthrough

In virtual machine, there would be a qxl or cirrus graphics device as the default master fbcon device.

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.

Signed-off-by: Jack Zhang <Jack.Zhang1@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 420888e..ada2b25 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1103,8 +1103,9 @@ static void
 amdgpu_pci_remove(struct pci_dev *pdev)  {
         struct drm_device *dev = pci_get_drvdata(pdev);
-
-       DRM_ERROR("Device removal is currently not supported outside of fbcon\n");
+       struct amdgpu_device *adev = dev->dev_private;
+       if (!amdgpu_sriov_vf(adev) && !amdgpu_passthrough(adev))
+               DRM_ERROR("Device removal is currently not supported outside of
+fbcon\n");
         drm_dev_unplug(dev);
         drm_dev_put(dev);
         pci_disable_device(pdev);
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux