summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-01-11 14:04:02 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-01-11 14:57:25 +0000
commit2bbba4e94eb987701abcacae241929fd13a196b2 (patch)
tree460fb47858b08da211c3d85c6ee4dca674b19909
parent109ec558370f78143509d9ebb6c26e19de1f1fb9 (diff)
downloadop-kernel-dev-2bbba4e94eb987701abcacae241929fd13a196b2.zip
op-kernel-dev-2bbba4e94eb987701abcacae241929fd13a196b2.tar.gz
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: 109ec558370f ("drm/i915/pmu: Only enumerate available counters in sysfs") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180111140402.3984-1-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/i915/i915_pmu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 9139bc8..95ab5e2 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -719,6 +719,7 @@ static const struct attribute_group *i915_pmu_attr_groups[] = {
static struct i915_ext_attribute *
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.mode = 0444;
attr->attr.show = i915_pmu_event_show;
@@ -731,6 +732,7 @@ static struct perf_pmu_events_attr *
add_pmu_attr(struct perf_pmu_events_attr *attr, const char *name,
const char *str)
{
+ sysfs_attr_init(&attr->attr.attr);
attr->attr.attr.name = name;
attr->attr.attr.mode = 0444;
attr->attr.show = perf_event_sysfs_show;
OpenPOWER on IntegriCloud