[Intel-gfx] [PATCH 5/8] drm/i915: Register debugfs interface last

Daniel Vetter daniel at ffwll.ch
Tue Jun 21 13:20:38 UTC 2016


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 at chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala at 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
http://blog.ffwll.ch


More information about the Intel-gfx mailing list