[PATCH 3/3] drm/amdgpu: use pci_dev_is_disconnected
Christian König
christian.koenig at amd.com
Thu Jan 26 09:20:16 UTC 2023
Am 25.01.23 um 18:16 schrieb vitaly.prosyak at amd.com:
> From: Vitaly Prosyak <vitaly.prosyak at amd.com>
>
> Added condition for pci_dev_is_disconnected and keeps
> drm_dev_is_unplugged to check whether we should unmap MMIO.
> Suggested by Alex regarding pci_dev_is_disconnected.
> Suggested by Christian keeping drm_dev_is_unplugged.
>
> Signed-off-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
> Reviewed-by Alex Deucher <alexander.deucher at amd.com>
> Reviewed-by Christian Koenig <christian.coenig at amd.com>
Did I gave my rb with this include path below???
> Change-Id: I618c471cd398437d4ed6dec6d22be78e12683ae6
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index a10b627c8357..d3568e1ded23 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -78,6 +78,8 @@
>
> #include <drm/drm_drv.h>
>
> +#include "../../../../pci/pci.h"
That include path looks more than suspicious.
If we want to use pci_dev_is_disconnected() outside of the pci subsystem
we should probably move it to include/linux/pci.h
Regards,
Christian.
> +
> MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
> MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
> MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
> @@ -4031,7 +4033,8 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>
> amdgpu_gart_dummy_page_fini(adev);
>
> - if (drm_dev_is_unplugged(adev_to_drm(adev)))
> + if (pci_dev_is_disconnected(adev->pdev) &&
> + drm_dev_is_unplugged(adev_to_drm(adev)))
> amdgpu_device_unmap_mmio(adev);
>
> }
More information about the amd-gfx
mailing list