[PATCH] drm: Register the debugfs interfaces after loading the driver

Daniel Vetter daniel at ffwll.ch
Fri May 27 06:47:48 UTC 2016


On Thu, May 26, 2016 at 02:06:13PM +0100, Chris Wilson wrote:
> On Thu, May 26, 2016 at 01:35:18PM +0100, Chris Wilson wrote:
> > In order to give the driver the chance to initialise the data structures
> > that will be exposed through debugfs, perform driver->load() before
> > registering the debugfs entries. (Otherwise it may be possible for
> > userspace to cause an oops through the debugfs interfaces.) As the
> > driver load is now before debugfs registration, make the registration
> > non-fatal (as it simply prevents us exposing an optional debug facility
> > and not hard ABI).
> 
> The alternative here would be for i915.ko to stop registering a
> driver->debugfs_init and do it as part of its registration phase (like
> sysfs).

I think the right fix would be to demidlayer i915 and stop using the
->load callback. Then we do have the right ordering, since debugfs setup
is done as part of the register phase.

It's just that for historical raisins load is called after the devnodes
are registered (because some dri1 drivers want to look at master/sarea
stuff iirc).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list