[Intel-gfx] [PATCH] drm/i915/perf: Initialise the dynamic sysfs attr

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 4 09:11:02 UTC 2017


Quoting Lionel Landwerlin (2017-08-04 09:56:36)
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> 
> I'm curious though, why hasn't it been a problem before??
> All of the configs we store in kernel don't seem to properly initialize 
> attr either, yet it hasn't yield any warning.
> Did we get it wrong all along there too?

The attr contains an embedded lock_class, but due to the design of
lockdep all lock_classes must be static. sysfs_attr_init() contains a
magic static lock_class - so instead of each attr now being an
independent lock class, all of the dynamic attr belong to the same
class. Don't try to use sysfs of one attr from inside the callback of
another!
-Chris


More information about the Intel-gfx mailing list