On Tue, 26 Feb 2019, Len Brown wrote: > static int __init pkg_temp_thermal_init(void) > { > int ret; > + struct cpuinfo_x86 *c = &cpu_data(0); > > if (!x86_match_cpu(pkg_temp_thermal_ids)) > return -ENODEV; > > - max_packages = topology_max_packages(); > + max_packages = topology_max_packages() * c->x86_max_dies;
This is really a sloppy hack. Just because cpuinfo is accessible it's not a good idea to fiddle with it in a driver. We went great length to abstract that stuff. So please add a new helper function topology_max_dies() and retrieve it from that. Thanks, tglx