Commit 2bbba4e9 authored by Chris Wilson's avatar Chris Wilson

drm/i915/pmu: Initialise our dynamic sysfs attributes for use with lockdep

As we kmalloc our dynamic sysfs attributes, we have to give them an
external static lock_class_key for them to use with lockdep.

Fixes: 109ec558 ("drm/i915/pmu: Only enumerate available counters in sysfs")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180111140402.3984-1-chris@chris-wilson.co.uk
parent 109ec558
...@@ -719,6 +719,7 @@ static const struct attribute_group *i915_pmu_attr_groups[] = { ...@@ -719,6 +719,7 @@ static const struct attribute_group *i915_pmu_attr_groups[] = {
static struct i915_ext_attribute * static struct i915_ext_attribute *
add_i915_attr(struct i915_ext_attribute *attr, const char *name, u64 config) add_i915_attr(struct i915_ext_attribute *attr, const char *name, u64 config)
{ {
sysfs_attr_init(&attr->attr.attr);
attr->attr.attr.name = name; attr->attr.attr.name = name;
attr->attr.attr.mode = 0444; attr->attr.attr.mode = 0444;
attr->attr.show = i915_pmu_event_show; attr->attr.show = i915_pmu_event_show;
...@@ -731,6 +732,7 @@ static struct perf_pmu_events_attr * ...@@ -731,6 +732,7 @@ static struct perf_pmu_events_attr *
add_pmu_attr(struct perf_pmu_events_attr *attr, const char *name, add_pmu_attr(struct perf_pmu_events_attr *attr, const char *name,
const char *str) const char *str)
{ {
sysfs_attr_init(&attr->attr.attr);
attr->attr.attr.name = name; attr->attr.attr.name = name;
attr->attr.attr.mode = 0444; attr->attr.attr.mode = 0444;
attr->attr.show = perf_event_sysfs_show; attr->attr.show = perf_event_sysfs_show;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment