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)
committerJani Nikula <jani.nikula@intel.com>
Wed, 26 Feb 2020 12:07:50 +0000 (14:07 +0200)
commit19ee5e8da6129d8d828201a12264ab3d09153ec4
tree7d2c2016ea83e5c1f2d643cf514bd36a7a326006
parenteee18939e5767dbe3a98b3ea172e7fd7ba7d403c
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
(cherry picked from commit f5a179d4687d4e7bfadd7cbda7ee5d0bad76761f)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h