Re: Armada DRM: bridge with componentized devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08.01.2019 12:38, Russell King - ARM Linux wrote:
> 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?


That should be OK for Exynos. But regardless of Exynos device_links at
the current state will not work correctly with bridges/panels as I
described earlier.


>
> 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.
>
If you want to create device_link you should access bridge->dev, if you
do it outside bridge_lock it can explode as well. So link should be
created under bridge_lock then (inside of_drm_find_bridge? via another
getter? ).


Regards

Andrzej

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux