Re: [PATCH 5/8] drm/i915: Register debugfs interface last

Daniel Vetter
2016-06-21T13:20:43Z

On Tue, Jun 21, 2016 at 09:53:45AM +0100, Chris Wilson wrote:
> Currently debugfs files are created before the driver is even loads.
> This gives the opportunity for userspace to open that interface and poke
> around before the backing data structures are initialised - with the
> possibility of oopsing or worse.
>
> Move the creation of the debugfs files to our registration phase, where
> we announce our presence to the world when we are ready, i.e the
> sequence changes from
>
> drm_dev_register()
> -> drm_minor_register()
> -> drm_debugfs_init()
> -> i915_debugfs_init()
> -> i915_driver_load()
>
> to
>
> drm_dev_register()
> -> drm_minor_register()
> -> drm_debugfs_init()
> -> i915_driver_load()
> -> i915_debugfs_register()
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

->debugfs_init/cleanup() is another midlayer thing we probably should nuke
over the next decade or so, like with ->load/unload() ;-)
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation