On Tue, Jan 08, 2019 at 12:25:34PM +0100, Andrzej Hajda wrote:
Issues with device links have nothing to do with hotplugging, they are generic - lifetime of the objects (drm_bridge, drm_panel) is just slightly different of lifetime of device links, and this is racy even if you do not want hotplugging. Moreover since drm_dev is not device (has no associated struct device) assuming we can reuse its parent to create device link results in circular dependencies.
How about having the device links created depending on whether the main drm driver wants them or not - that would mean that Exynos could continue avoiding them, but others that want them can have the links?
I don't think the links should be created when the bridge is attached, they should be created when the main drm driver gains its first reference to the drm_bridge (via of_drm_find_bridge()) - since that's the point where things may explode if the drm_bridge goes away. Calling drm_bridge_attach() for a bridge that has been unbound will be a use-after-free bug, so using device links at that point is way too late.