Commit 03c6284d authored by Ma Jun's avatar Ma Jun Committed by Alex Deucher

Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"

This patch causes the following iounmap erorr and calltrace
iounmap: bad address 00000000d0b3631f

The original patch was unjustified because amdgpu_device_fini_sw() will
always cleanup the rmmio mapping.

This reverts commit eb4f1398.
Signed-off-by: default avatarMa Jun <Jun.Ma2@amd.com>
Suggested-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 334b56ce
...@@ -4040,10 +4040,8 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -4040,10 +4040,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
* early on during init and before calling to RREG32. * early on during init and before calling to RREG32.
*/ */
adev->reset_domain = amdgpu_reset_create_reset_domain(SINGLE_DEVICE, "amdgpu-reset-dev"); adev->reset_domain = amdgpu_reset_create_reset_domain(SINGLE_DEVICE, "amdgpu-reset-dev");
if (!adev->reset_domain) { if (!adev->reset_domain)
r = -ENOMEM; return -ENOMEM;
goto unmap_memory;
}
/* detect hw virtualization here */ /* detect hw virtualization here */
amdgpu_detect_virtualization(adev); amdgpu_detect_virtualization(adev);
...@@ -4053,7 +4051,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -4053,7 +4051,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
r = amdgpu_device_get_job_timeout_settings(adev); r = amdgpu_device_get_job_timeout_settings(adev);
if (r) { if (r) {
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n"); dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
goto unmap_memory; return r;
} }
amdgpu_device_set_mcbp(adev); amdgpu_device_set_mcbp(adev);
...@@ -4061,12 +4059,12 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -4061,12 +4059,12 @@ int amdgpu_device_init(struct amdgpu_device *adev,
/* early init functions */ /* early init functions */
r = amdgpu_device_ip_early_init(adev); r = amdgpu_device_ip_early_init(adev);
if (r) if (r)
goto unmap_memory; return r;
/* Get rid of things like offb */ /* Get rid of things like offb */
r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver); r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver);
if (r) if (r)
goto unmap_memory; return r;
/* Enable TMZ based on IP_VERSION */ /* Enable TMZ based on IP_VERSION */
amdgpu_gmc_tmz_set(adev); amdgpu_gmc_tmz_set(adev);
...@@ -4076,7 +4074,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -4076,7 +4074,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
if (adev->gmc.xgmi.supported) { if (adev->gmc.xgmi.supported) {
r = adev->gfxhub.funcs->get_xgmi_info(adev); r = adev->gfxhub.funcs->get_xgmi_info(adev);
if (r) if (r)
goto unmap_memory; return r;
} }
/* enable PCIE atomic ops */ /* enable PCIE atomic ops */
...@@ -4345,8 +4343,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -4345,8 +4343,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
failed: failed:
amdgpu_vf_error_trans_all(adev); amdgpu_vf_error_trans_all(adev);
unmap_memory:
iounmap(adev->rmmio);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment