summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
diff options
context:
space:
mode:
authorGrazvydas Ignotas2016-10-02 23:06:46 +0200
committerAlex Deucher2016-10-06 18:39:03 +0200
commit2f9ba199daf32dded4ef0237cd12efac451ebf47 (patch)
treea050ecd0a9ec5dbf8de6df415b91a3dbb7040f73 /drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
parentdrm/amdgpu/dce11: add missing drm_mode_config_cleanup call (diff)
downloadkernel-qcow2-linux-2f9ba199daf32dded4ef0237cd12efac451ebf47.tar.gz
kernel-qcow2-linux-2f9ba199daf32dded4ef0237cd12efac451ebf47.tar.xz
kernel-qcow2-linux-2f9ba199daf32dded4ef0237cd12efac451ebf47.zip
drm/amdgpu: warn if dp aux is still attached on free
If this happens (and it recently did), we free a structure while part of it is still in use, which results in non-obvious crashes. The way it's detached is not trivial (DRM core has to call the connector .destroy callback and things must be torn down in the right order), so better detect it and warn early. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index decbba5ad438..49880983b0a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -769,8 +769,10 @@ static void amdgpu_connector_destroy(struct drm_connector *connector)
{
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
- if (amdgpu_connector->ddc_bus->has_aux)
+ if (amdgpu_connector->ddc_bus->has_aux) {
drm_dp_aux_unregister(&amdgpu_connector->ddc_bus->aux);
+ amdgpu_connector->ddc_bus->has_aux = false;
+ }
amdgpu_connector_free_edid(connector);
kfree(amdgpu_connector->con_priv);
drm_connector_unregister(connector);