intel_idle: clean up BYT/CHT auto demotion disable
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 10 Feb 2025 07:12:53 +0000 (09:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 19 Feb 2025 12:04:45 +0000 (13:04 +0100)
commitc93d13b661a6ce34b9cd8241f5e410658078d7b1
tree2f811af2414cd923bc0c849dc7162164f40003de
parent0ad2507d5d93f39619fc42372c347d6006b64319
intel_idle: clean up BYT/CHT auto demotion disable

Bay Trail (BYT) and Cherry Trail (CHT) platforms have a very specific way
of disabling auto-demotion via specific MSR bits. Clean up the code so that
BYT/CHT-specifics do not show up in the common 'struct idle_cpu' data
structure.

Remove the 'byt_auto_demotion_disable_flag' flag from 'struct idle_cpu',
because a better coding pattern is to avoid very case-specific fields like
'bool byt_auto_demotion_disable_flag' in a common data structure, which is
used for all platforms, not only BYT/CHT. The code is just more readable
when common data structures contain only commonly used fields.

Instead, match BYT/CHT in the 'intel_idle_init_cstates_icpu()' function,
and introduce a small helper to take care of BYT/CHT auto-demotion. This
is consistent with how platform-specific things are done for other
platforms.

No intended functional changes, compile-tested only.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://patch.msgid.link/20250210071253.2991030-1-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/idle/intel_idle.c