RE: [PATCH 3/3] drm/amdgpu: don't free conflicting apertures for non-display devices

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

 



[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Kent Russell <kent.russell@xxxxxxx>


> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Alex
> Deucher
> Sent: Thursday, March 13, 2025 9:02 PM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>
> Subject: [PATCH 3/3] drm/amdgpu: don't free conflicting apertures for non-display
> devices
>
> PCI_CLASS_ACCELERATOR_PROCESSING devices won't ever be
> the sysfb, so there is no need to free conflicting
> apertures.
>
> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 1eff6252f66b4..689f1833d02b7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -4401,10 +4401,17 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>       if (r)
>               return r;
>
> -     /* Get rid of things like offb */
> -     r = aperture_remove_conflicting_pci_devices(adev->pdev,
> amdgpu_kms_driver.name);
> -     if (r)
> -             return r;
> +     /*
> +      * No need to remove conflicting FBs for non-display class devices.
> +      * This prevents the sysfb from being freed accidently.
> +      */
> +     if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA ||
> +         (pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) {
> +             /* Get rid of things like offb */
> +             r = aperture_remove_conflicting_pci_devices(adev->pdev,
> amdgpu_kms_driver.name);
> +             if (r)
> +                     return r;
> +     }
>
>       /* Enable TMZ based on IP_VERSION */
>       amdgpu_gmc_tmz_set(adev);
> --
> 2.48.1





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

  Powered by Linux