drm/amdgpu: properly guard the generic discovery code
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2019 18:44:59 +0000 (13:44 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Jul 2019 22:43:31 +0000 (17:43 -0500)
It's only available on navi and newer.

Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index d721b4d3024c4b4123cec0aca1cf9dfe76ea5757..7401bc95c15be39b0e797394114d282371e9d68b 100644 (file)
@@ -2615,7 +2615,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        if (amdgpu_mes && adev->asic_type >= CHIP_NAVI10)
                adev->enable_mes = true;
 
-       if (amdgpu_discovery) {
+       if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) {
                r = amdgpu_discovery_init(adev);
                if (r) {
                        dev_err(adev->dev, "amdgpu_discovery_init failed\n");
@@ -2885,7 +2885,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
        if (IS_ENABLED(CONFIG_PERF_EVENTS))
                amdgpu_pmu_fini(adev);
        amdgpu_debugfs_preempt_cleanup(adev);
-       if (amdgpu_discovery)
+       if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
                amdgpu_discovery_fini(adev);
 }