drm/i915/pmu: Avoid using globals for CPU hotplug state
authorMichał Winiarski <michal.winiarski@intel.com>
Wed, 19 Feb 2020 16:18:21 +0000 (17:18 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 21 Feb 2020 17:31:15 +0000 (17:31 +0000)
commitf5a179d4687d4e7bfadd7cbda7ee5d0bad76761f
tree0d046e71a15cb422b09dfc3316de95b66f4caf16
parent0bf857358f3f58055fdc5a83b6bec815a3fa9788
drm/i915/pmu: Avoid using globals for CPU hotplug state

Attempting to bind / unbind module from devices where we have both
integrated and discreete GPU handled by i915 can lead to leaks and
warnings from cpuhp:
Error: Removing state XXX which has instances left.

Let's move the state to i915_pmu.

Fixes: 05488673a4d4 ("drm/i915/pmu: Support multiple GPUs")
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200219161822.24592-1-michal.winiarski@intel.com
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h