mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] platform/x86/intel: power-domains: Handle failed tpmi_init()
@ 2026-09-24 19:36 Kristen Carlson Accardi
  2026-09-24 19:36 ` [PATCH 1/2] platform/x86/intel: power-domains: Handle failed init in tpmi_get_linux_die_id() Kristen Carlson Accardi
  2026-09-24 19:36 ` [PATCH 2/2] platform/x86/intel: power-domains: Handle failed init in tpmi_get_power_domain_mask() Kristen Carlson Accardi
  0 siblings, 2 replies; 5+ messages in thread
From: Kristen Carlson Accardi @ 2026-09-24 19:36 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: Srinivas Pandruvada, platform-driver-x86, linux-kernel

tpmi_init() can fail before domain_die_map and tpmi_power_domain_mask
are usable. It returns -ENODEV on CPU models that are not in
tpmi_cpu_ids, before allocating them, and if cpuhp_setup_state() fails
it frees them but leaves the pointers set. When the driver is built in,
its exported helpers stay callable after either failure.

Patch 1 fixes tpmi_get_linux_die_id(), which dereferences the NULL map.
uncore-frequency-tpmi calls it when the world-readable die_id sysfs
attribute is read, so on a multi-die CPU missing from tpmi_cpu_ids that
read oopses.

Patch 2 adds the same guard to tpmi_get_power_domain_mask(). It has no
callers in the tree, so this is hardening and carries no Fixes tag.

Both build cleanly with W=1, built in and as a module. Neither has been
runtime-tested on an affected system.

Kristen Carlson Accardi (2):
  platform/x86/intel: power-domains: Handle failed init in
    tpmi_get_linux_die_id()
  platform/x86/intel: power-domains: Handle failed init in
    tpmi_get_power_domain_mask()

 .../platform/x86/intel/tpmi_power_domains.c    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-24 21:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 19:36 [PATCH 0/2] platform/x86/intel: power-domains: Handle failed tpmi_init() Kristen Carlson Accardi
2026-09-24 19:36 ` [PATCH 1/2] platform/x86/intel: power-domains: Handle failed init in tpmi_get_linux_die_id() Kristen Carlson Accardi
2026-09-24 21:39   ` srinivas pandruvada
2026-09-24 19:36 ` [PATCH 2/2] platform/x86/intel: power-domains: Handle failed init in tpmi_get_power_domain_mask() Kristen Carlson Accardi
2026-09-24 21:40   ` srinivas pandruvada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®