[PATCH] drm/amdgpu: Log if device is unsupported

Paul Menzel posted 1 patch 2 years, 8 months ago
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] drm/amdgpu: Log if device is unsupported
Posted by Paul Menzel 2 years, 8 months ago
Since there is overlap in supported devices, both modules load, but only
one will bind to a particular device depending on the model and user's
configuration.

amdgpu binds to all display class devices with VID 0x1002 and then
determines whether or not to bind to a device based on whether the
individual device is supported by the driver or not. Log that case, so
users looking at the logs know what is going on.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2608
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 86fbb4138285..410ff918c350 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2062,8 +2062,10 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 
 	/* skip devices which are owned by radeon */
 	for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) {
-		if (amdgpu_unsupported_pciidlist[i] == pdev->device)
+		if (amdgpu_unsupported_pciidlist[i] == pdev->device) {
+			DRM_INFO("This hardware is only supported by radeon.");
 			return -ENODEV;
+		}
 	}
 
 	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
-- 
2.40.1
RE: [PATCH] drm/amdgpu: Log if device is unsupported
Posted by Deucher, Alexander 2 years, 8 months ago
[AMD Official Use Only - General]

> -----Original Message-----
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Sent: Monday, June 5, 2023 11:23 AM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>; David
> Airlie <airlied@gmail.com>; Daniel Vetter <daniel@ffwll.ch>
> Cc: Paul Menzel <pmenzel@molgen.mpg.de>; amd-gfx@lists.freedesktop.org;
> dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] drm/amdgpu: Log if device is unsupported
>
> Since there is overlap in supported devices, both modules load, but only one
> will bind to a particular device depending on the model and user's
> configuration.
>
> amdgpu binds to all display class devices with VID 0x1002 and then
> determines whether or not to bind to a device based on whether the
> individual device is supported by the driver or not. Log that case, so users
> looking at the logs know what is going on.
>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2608
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 86fbb4138285..410ff918c350 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2062,8 +2062,10 @@ static int amdgpu_pci_probe(struct pci_dev
> *pdev,
>
>       /* skip devices which are owned by radeon */
>       for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) {
> -             if (amdgpu_unsupported_pciidlist[i] == pdev->device)
> +             if (amdgpu_unsupported_pciidlist[i] == pdev->device) {
> +                     DRM_INFO("This hardware is only supported by
> radeon.");
>                       return -ENODEV;

I think this will confuse users even more.  As there will be a new "error" message reported.  I'd suggest either dropping the message in init per my proposed patch or just leaving things as is.

Alex

> +             }
>       }
>
>       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
> --
> 2.40.1