[PATCH 2/2] drm/doc: Update docs about device instance setup

Daniel Vetter daniel at ffwll.ch
Mon Aug 10 05:07:49 PDT 2015


On Mon, Aug 10, 2015 at 01:59:07PM +0200, Thierry Reding wrote:
> On Mon, Aug 10, 2015 at 11:55:38AM +0200, Daniel Vetter wrote:
> > ->load is depracated, bus functionst are deprecated and everyone
> > should use drm_dev_alloc&register.
> 
> Why would you want to deprecated ->load()? Even if you use
> drm_dev_alloc() and drm_dev_register(), there's still use for ->load()
> because it gives you the subsystem-level initialization entry point.

->load is called after the drm /dev node is registered and hence you can't
really do any driver setup in there without risking races. We paper over
that using drm_global_mutex, but that doesn't work for any other
driver/userspace interface like sysfs/debugfs because of deadlocks.

And we can't just reorder ->load to happen before the /dev nodes are
registered because a lot of drivers would fall over if we do that.

This is typical midlayer fail where the core calls into the driver instead
of the other way round.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list