Message ID | 20210329195255.v2.5.I1a9275ffbde1d33ad7a3af819f5fbc0941b7ee02@changeid (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: Fix EDID reading on ti-sn65dsi86 | expand |
W dniu 30.03.2021 o 04:53, Douglas Anderson pisze: > The register() / attach() for MIPI happen in the bridge's > attach(). That means that the inverse belongs in the bridge's > detach(). As I commented in previous patch, it would be better to fix mipi/bridge registration order in host and this driver. Have you considered this? Regards Andrzej > > Signed-off-by: Douglas Anderson <dianders@chromium.org> > --- > > (no changes since v1) > > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > index c006678c9921..e8e523b3a16b 100644 > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > @@ -437,7 +437,15 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, > > static void ti_sn_bridge_detach(struct drm_bridge *bridge) > { > - drm_dp_aux_unregister(&bridge_to_ti_sn_bridge(bridge)->aux); > + struct ti_sn_bridge *pdata = bridge_to_ti_sn_bridge(bridge); > + > + > + if (pdata->dsi) { > + mipi_dsi_detach(pdata->dsi); > + mipi_dsi_device_unregister(pdata->dsi); > + } > + > + drm_dp_aux_unregister(&pdata->aux); > } > > static void ti_sn_bridge_disable(struct drm_bridge *bridge) > @@ -1315,11 +1323,6 @@ static int ti_sn_bridge_remove(struct i2c_client *client) > if (!pdata) > return -EINVAL; > > - if (pdata->dsi) { > - mipi_dsi_detach(pdata->dsi); > - mipi_dsi_device_unregister(pdata->dsi); > - } > - > kfree(pdata->edid); > > ti_sn_debugfs_remove(pdata);
Hi, On Wed, Mar 31, 2021 at 2:53 AM Andrzej Hajda <a.hajda@samsung.com> wrote: > > > W dniu 30.03.2021 o 04:53, Douglas Anderson pisze: > > The register() / attach() for MIPI happen in the bridge's > > attach(). That means that the inverse belongs in the bridge's > > detach(). > > > As I commented in previous patch, it would be better to fix mipi/bridge > registration order in host and this driver. > > Have you considered this? Fair enough. How about I drop this patch at the moment? My series already has enough stuff in it right now and I don't believe anything in the series depends on this patch. -Doug
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index c006678c9921..e8e523b3a16b 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -437,7 +437,15 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, static void ti_sn_bridge_detach(struct drm_bridge *bridge) { - drm_dp_aux_unregister(&bridge_to_ti_sn_bridge(bridge)->aux); + struct ti_sn_bridge *pdata = bridge_to_ti_sn_bridge(bridge); + + + if (pdata->dsi) { + mipi_dsi_detach(pdata->dsi); + mipi_dsi_device_unregister(pdata->dsi); + } + + drm_dp_aux_unregister(&pdata->aux); } static void ti_sn_bridge_disable(struct drm_bridge *bridge) @@ -1315,11 +1323,6 @@ static int ti_sn_bridge_remove(struct i2c_client *client) if (!pdata) return -EINVAL; - if (pdata->dsi) { - mipi_dsi_detach(pdata->dsi); - mipi_dsi_device_unregister(pdata->dsi); - } - kfree(pdata->edid); ti_sn_debugfs_remove(pdata);
The register() / attach() for MIPI happen in the bridge's attach(). That means that the inverse belongs in the bridge's detach(). Signed-off-by: Douglas Anderson <dianders@chromium.org> --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)