On 2018-05-23 11:39, Andrzej Hajda wrote:
*snip*
Panels are managed by dsi host only if dsi host implements it, and it is up to dsi host author, it is not mandatory. The only case I am aware of is exynos-dsi. I guess most developers are not aware of the problem, or they do not care, or ... whatever. This patch shows it very clearly.
*snip*
With such approach you do not protect dsi hosts without dynamic panel management support. As I said earlier: it is matter of panel consumers (for example dsi host), ie if it implements dynamic panel management, it should attach panel without creating device_links, as it take care of disappearing panels. If it does not perform dynamic management it should rely on default behavior - links should be created, to protect drm device from using dangling pointers.
So, you're saying that the only place that needs to be patched to call drm_panel_attach_without_link is exynos_dsi_host_attach()?
What about the dw-mipi-dsi driver in rockchip/dw-mipi-dsi.c? It also calls drm_panel_attach/drm_panel_detach in its dw_mipi_dsi_host_attach and dw_mipi_dsi_host_detach functions.
Similar thing in bridge/synopsis/dw-mipi-dsi.c, but it calls the wrappers drm_panel_bridge_add/remove to create an implicit bridge that in turn handles the panel. So, do we need a to add a drm_panel_bridge_add_without_link too?
What about tegra/dsi.c? It also calls drm_panel_attach in its tegra_dsi_host_attach function? But that one doesn't detach the panel in its tegra_dsi_host_detach. Is that a bug?
Cheers, Peter