* [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time @ 2019-04-24 13:22 ` Matt Redfearn 2019-06-25 9:39 ` Matt Redfearn 2019-06-25 10:54 ` Andrzej Hajda 0 siblings, 2 replies; 4+ messages in thread From: Matt Redfearn @ 2019-04-24 13:22 UTC (permalink / raw) To: Archit Taneja, Andrzej Hajda, Laurent Pinchart Cc: dri-devel, Matthew Redfearn, Luc Van Oostenryck, linux-kernel, Jia-Ju Bai, Kieran Bingham, David Airlie, Sean Paul, Daniel Vetter In contrast to all of the DSI panel drivers in drivers/gpu/drm/panel which attach to the DSI host via mipi_dsi_attach() at probe time, the ADV7533 bridge device does not. Instead it defers this to the point that the upstream device connects to its bridge via drm_bridge_attach(). The generic Synopsys MIPI DSI host driver does not register it's own drm_bridge until the MIPI DSI has attached. But it does not call drm_bridge_attach() on the downstream device until the upstream device has attached. This leads to a chicken and the egg failure and the DRM pipeline does not complete. Since all other mipi_dsi_device drivers call mipi_dsi_attach() in probe(), make the adv7533 mipi_dsi_device do the same. This ensures that the Synopsys MIPI DSI host registers it's bridge such that it is available for the upstream device to connect to. Signed-off-by: Matt Redfearn <matt.redfearn@thinci.com> --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index e7ddd3e3db9..ea36ac3a3de 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -874,9 +874,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) &adv7511_connector_helper_funcs); drm_connector_attach_encoder(&adv->connector, bridge->encoder); - if (adv->type == ADV7533) - ret = adv7533_attach_dsi(adv); - if (adv->i2c_main->irq) regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), ADV7511_INT0_HPD); @@ -1222,7 +1219,11 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) drm_bridge_add(&adv7511->bridge); adv7511_audio_init(dev, adv7511); - return 0; + + if (adv7511->type == ADV7533) + return adv7533_attach_dsi(adv7511); + else + return 0; err_unregister_cec: i2c_unregister_device(adv7511->i2c_cec); -- 2.17.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time 2019-04-24 13:22 ` [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time Matt Redfearn @ 2019-06-25 9:39 ` Matt Redfearn 2019-06-25 10:54 ` Andrzej Hajda 1 sibling, 0 replies; 4+ messages in thread From: Matt Redfearn @ 2019-06-25 9:39 UTC (permalink / raw) To: Matthew Redfearn, Andrzej Hajda, Laurent Pinchart Cc: dri-devel, Luc Van Oostenryck, linux-kernel, Jia-Ju Bai, Kieran Bingham, David Airlie, Sean Paul, Daniel Vetter, Jonas Karlman, Jernej Skrabec Hi, Any feedback on this patch? Thanks, Matt On 24/04/2019 14:22, Matthew Redfearn wrote: > In contrast to all of the DSI panel drivers in drivers/gpu/drm/panel > which attach to the DSI host via mipi_dsi_attach() at probe time, the > ADV7533 bridge device does not. Instead it defers this to the point that > the upstream device connects to its bridge via drm_bridge_attach(). > The generic Synopsys MIPI DSI host driver does not register it's own > drm_bridge until the MIPI DSI has attached. But it does not call > drm_bridge_attach() on the downstream device until the upstream device > has attached. This leads to a chicken and the egg failure and the DRM > pipeline does not complete. > Since all other mipi_dsi_device drivers call mipi_dsi_attach() in > probe(), make the adv7533 mipi_dsi_device do the same. This ensures that > the Synopsys MIPI DSI host registers it's bridge such that it is > available for the upstream device to connect to. > > Signed-off-by: Matt Redfearn <matt.redfearn@thinci.com> > > --- > > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index e7ddd3e3db9..ea36ac3a3de 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -874,9 +874,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) > &adv7511_connector_helper_funcs); > drm_connector_attach_encoder(&adv->connector, bridge->encoder); > > - if (adv->type == ADV7533) > - ret = adv7533_attach_dsi(adv); > - > if (adv->i2c_main->irq) > regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), > ADV7511_INT0_HPD); > @@ -1222,7 +1219,11 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) > drm_bridge_add(&adv7511->bridge); > > adv7511_audio_init(dev, adv7511); > - return 0; > + > + if (adv7511->type == ADV7533) > + return adv7533_attach_dsi(adv7511); > + else > + return 0; > > err_unregister_cec: > i2c_unregister_device(adv7511->i2c_cec); > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time 2019-04-24 13:22 ` [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time Matt Redfearn 2019-06-25 9:39 ` Matt Redfearn @ 2019-06-25 10:54 ` Andrzej Hajda 2019-06-27 15:14 ` Matt Redfearn 1 sibling, 1 reply; 4+ messages in thread From: Andrzej Hajda @ 2019-06-25 10:54 UTC (permalink / raw) To: Matt Redfearn, Archit Taneja, Laurent Pinchart Cc: dri-devel, Matthew Redfearn, Luc Van Oostenryck, linux-kernel, Jia-Ju Bai, Kieran Bingham, David Airlie, Sean Paul, Daniel Vetter On 24.04.2019 15:22, Matt Redfearn wrote: > In contrast to all of the DSI panel drivers in drivers/gpu/drm/panel > which attach to the DSI host via mipi_dsi_attach() at probe time, the > ADV7533 bridge device does not. Instead it defers this to the point that > the upstream device connects to its bridge via drm_bridge_attach(). > The generic Synopsys MIPI DSI host driver does not register it's own > drm_bridge until the MIPI DSI has attached. But it does not call > drm_bridge_attach() on the downstream device until the upstream device > has attached. This leads to a chicken and the egg failure and the DRM > pipeline does not complete. > Since all other mipi_dsi_device drivers call mipi_dsi_attach() in > probe(), make the adv7533 mipi_dsi_device do the same. This ensures that > the Synopsys MIPI DSI host registers it's bridge such that it is > available for the upstream device to connect to. > > Signed-off-by: Matt Redfearn <matt.redfearn@thinci.com> > > --- > > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index e7ddd3e3db9..ea36ac3a3de 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -874,9 +874,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) > &adv7511_connector_helper_funcs); > drm_connector_attach_encoder(&adv->connector, bridge->encoder); > > - if (adv->type == ADV7533) > - ret = adv7533_attach_dsi(adv); > - > if (adv->i2c_main->irq) > regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), > ADV7511_INT0_HPD); > @@ -1222,7 +1219,11 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) > drm_bridge_add(&adv7511->bridge); > > adv7511_audio_init(dev, adv7511); > - return 0; > + > + if (adv7511->type == ADV7533) > + return adv7533_attach_dsi(adv7511); > + else > + return 0; It seems that on failure of adv7533_attach_dsi cleanup is not performed. Beside this change looks OK, but it would be good to test it on platforms with adv7533. Regards Andrzej > > err_unregister_cec: > i2c_unregister_device(adv7511->i2c_cec); ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time 2019-06-25 10:54 ` Andrzej Hajda @ 2019-06-27 15:14 ` Matt Redfearn 0 siblings, 0 replies; 4+ messages in thread From: Matt Redfearn @ 2019-06-27 15:14 UTC (permalink / raw) To: Andrzej Hajda, Archit Taneja, Laurent Pinchart Cc: dri-devel, Matthew Redfearn, Luc Van Oostenryck, linux-kernel, Jia-Ju Bai, Kieran Bingham, David Airlie, Sean Paul, Daniel Vetter On 25/06/2019 11:54, Andrzej Hajda wrote: > On 24.04.2019 15:22, Matt Redfearn wrote: >> In contrast to all of the DSI panel drivers in drivers/gpu/drm/panel >> which attach to the DSI host via mipi_dsi_attach() at probe time, the >> ADV7533 bridge device does not. Instead it defers this to the point that >> the upstream device connects to its bridge via drm_bridge_attach(). >> The generic Synopsys MIPI DSI host driver does not register it's own >> drm_bridge until the MIPI DSI has attached. But it does not call >> drm_bridge_attach() on the downstream device until the upstream device >> has attached. This leads to a chicken and the egg failure and the DRM >> pipeline does not complete. >> Since all other mipi_dsi_device drivers call mipi_dsi_attach() in >> probe(), make the adv7533 mipi_dsi_device do the same. This ensures that >> the Synopsys MIPI DSI host registers it's bridge such that it is >> available for the upstream device to connect to. >> >> Signed-off-by: Matt Redfearn <matt.redfearn@thinci.com> >> >> --- >> >> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++---- >> 1 file changed, 5 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> index e7ddd3e3db9..ea36ac3a3de 100644 >> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> @@ -874,9 +874,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) >> &adv7511_connector_helper_funcs); >> drm_connector_attach_encoder(&adv->connector, bridge->encoder); >> >> - if (adv->type == ADV7533) >> - ret = adv7533_attach_dsi(adv); >> - >> if (adv->i2c_main->irq) >> regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), >> ADV7511_INT0_HPD); >> @@ -1222,7 +1219,11 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) >> drm_bridge_add(&adv7511->bridge); >> >> adv7511_audio_init(dev, adv7511); >> - return 0; >> + >> + if (adv7511->type == ADV7533) >> + return adv7533_attach_dsi(adv7511); >> + else >> + return 0; > > > It seems that on failure of adv7533_attach_dsi cleanup is not performed. Hi Andrzej, Quite right - I will fix and resend. > > Beside this change looks OK, but it would be good to test it on > platforms with adv7533. As in the commit message, I needed this change to get the driver to work at all on a platform with a Synopsys MIPI DSI interface. However I would be very grateful for feedback from people using the ADV7533 with other MIPI DSI hosts. Thanks, Matt > > > Regards > > Andrzej > > >> >> err_unregister_cec: >> i2c_unregister_device(adv7511->i2c_cec); > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-27 15:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20190424132254epcas1p4157791b8ce30297340d7053f59bc7f10@epcas1p4.samsung.com>
2019-04-24 13:22 ` [PATCH] drm/bridge: adv7511: Attach to DSI host at probe time Matt Redfearn
2019-06-25 9:39 ` Matt Redfearn
2019-06-25 10:54 ` Andrzej Hajda
2019-06-27 15:14 ` Matt Redfearn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®