Commit b0c80bd5 authored by Alex Deucher's avatar Alex Deucher

drm/radeon: fix up dp aux tear down (v2)

Port the amdgpu fixes from Grazvydas to radeon.

v2: drop unrelated whitespace change.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=98200Reviewed-and-Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 40492f60
...@@ -927,6 +927,16 @@ radeon_lvds_detect(struct drm_connector *connector, bool force) ...@@ -927,6 +927,16 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
return ret; return ret;
} }
static void radeon_connector_unregister(struct drm_connector *connector)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
if (radeon_connector->ddc_bus->has_aux) {
drm_dp_aux_unregister(&radeon_connector->ddc_bus->aux);
radeon_connector->ddc_bus->has_aux = false;
}
}
static void radeon_connector_destroy(struct drm_connector *connector) static void radeon_connector_destroy(struct drm_connector *connector)
{ {
struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector *radeon_connector = to_radeon_connector(connector);
...@@ -984,6 +994,7 @@ static const struct drm_connector_funcs radeon_lvds_connector_funcs = { ...@@ -984,6 +994,7 @@ static const struct drm_connector_funcs radeon_lvds_connector_funcs = {
.dpms = drm_helper_connector_dpms, .dpms = drm_helper_connector_dpms,
.detect = radeon_lvds_detect, .detect = radeon_lvds_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.set_property = radeon_lvds_set_property, .set_property = radeon_lvds_set_property,
}; };
...@@ -1111,6 +1122,7 @@ static const struct drm_connector_funcs radeon_vga_connector_funcs = { ...@@ -1111,6 +1122,7 @@ static const struct drm_connector_funcs radeon_vga_connector_funcs = {
.dpms = drm_helper_connector_dpms, .dpms = drm_helper_connector_dpms,
.detect = radeon_vga_detect, .detect = radeon_vga_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.set_property = radeon_connector_set_property, .set_property = radeon_connector_set_property,
}; };
...@@ -1188,6 +1200,7 @@ static const struct drm_connector_funcs radeon_tv_connector_funcs = { ...@@ -1188,6 +1200,7 @@ static const struct drm_connector_funcs radeon_tv_connector_funcs = {
.dpms = drm_helper_connector_dpms, .dpms = drm_helper_connector_dpms,
.detect = radeon_tv_detect, .detect = radeon_tv_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.set_property = radeon_connector_set_property, .set_property = radeon_connector_set_property,
}; };
...@@ -1519,6 +1532,7 @@ static const struct drm_connector_funcs radeon_dvi_connector_funcs = { ...@@ -1519,6 +1532,7 @@ static const struct drm_connector_funcs radeon_dvi_connector_funcs = {
.detect = radeon_dvi_detect, .detect = radeon_dvi_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.set_property = radeon_connector_set_property, .set_property = radeon_connector_set_property,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.force = radeon_dvi_force, .force = radeon_dvi_force,
}; };
...@@ -1832,6 +1846,7 @@ static const struct drm_connector_funcs radeon_dp_connector_funcs = { ...@@ -1832,6 +1846,7 @@ static const struct drm_connector_funcs radeon_dp_connector_funcs = {
.detect = radeon_dp_detect, .detect = radeon_dp_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.set_property = radeon_connector_set_property, .set_property = radeon_connector_set_property,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.force = radeon_dvi_force, .force = radeon_dvi_force,
}; };
...@@ -1841,6 +1856,7 @@ static const struct drm_connector_funcs radeon_edp_connector_funcs = { ...@@ -1841,6 +1856,7 @@ static const struct drm_connector_funcs radeon_edp_connector_funcs = {
.detect = radeon_dp_detect, .detect = radeon_dp_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.set_property = radeon_lvds_set_property, .set_property = radeon_lvds_set_property,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.force = radeon_dvi_force, .force = radeon_dvi_force,
}; };
...@@ -1850,6 +1866,7 @@ static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = { ...@@ -1850,6 +1866,7 @@ static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = {
.detect = radeon_dp_detect, .detect = radeon_dp_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.set_property = radeon_lvds_set_property, .set_property = radeon_lvds_set_property,
.early_unregister = radeon_connector_unregister,
.destroy = radeon_connector_destroy, .destroy = radeon_connector_destroy,
.force = radeon_dvi_force, .force = radeon_dvi_force,
}; };
......
...@@ -982,9 +982,8 @@ void radeon_i2c_destroy(struct radeon_i2c_chan *i2c) ...@@ -982,9 +982,8 @@ void radeon_i2c_destroy(struct radeon_i2c_chan *i2c)
{ {
if (!i2c) if (!i2c)
return; return;
WARN_ON(i2c->has_aux);
i2c_del_adapter(&i2c->adapter); i2c_del_adapter(&i2c->adapter);
if (i2c->has_aux)
drm_dp_aux_unregister(&i2c->aux);
kfree(i2c); kfree(i2c);
} }
......
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