summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_pmu.c
diff options
context:
space:
mode:
authorTvrtko Ursulin2017-11-28 11:55:15 +0100
committerTvrtko Ursulin2017-11-28 18:04:40 +0100
commit00a797225e53a4f488ab725e0b438c2970aa41d7 (patch)
tree749dfd58e38eb4a25f98632ee13cb43ec110e068 /drivers/gpu/drm/i915/i915_pmu.c
parentdrm/i915: Enable hotplug polling after registering the outputs (diff)
downloadkernel-qcow2-linux-00a797225e53a4f488ab725e0b438c2970aa41d7.tar.gz
kernel-qcow2-linux-00a797225e53a4f488ab725e0b438c2970aa41d7.tar.xz
kernel-qcow2-linux-00a797225e53a4f488ab725e0b438c2970aa41d7.zip
drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
In commit 0426c0465461 ("drm/i915/pmu: Only allow running on a single CPU") I attempted to clarify the CPU hotplug logic in our PMU implementation, but missed that a more logical error to return, when attempting to initialize an event on a currently inactive CPU, is -EINVAL rather than -ENODEV. This is because i915 PMU explicitly disallows running counters on more than one CPU at a time, and is not reporting that the requested CPU does not exist, or is off-line. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20171128105515.21998-1-tvrtko.ursulin@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_pmu.c')
-rw-r--r--drivers/gpu/drm/i915/i915_pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 3357b690ce90..1c0ee9d68b04 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -338,7 +338,7 @@ static int i915_pmu_event_init(struct perf_event *event)
/* only allow running on one cpu at a time */
if (!cpumask_test_cpu(event->cpu, &i915_pmu_cpumask))
- return -ENODEV;
+ return -EINVAL;
if (is_engine_event(event)) {
ret = engine_event_init(event);