Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal fixes from Zhang Rui:
"Specifics:

- fix an issue in intel_powerclamp driver that idle injection target
is not accurately maintained on newer Intel CPUs. Package C8 to
C10 states are introduced on these CPUs but they were not included
in the package c-state residency calculation. From Jacob Pan.

- fix a problem that package c-state idle injection was missing on
Broadwell server, by adding its id to intel_powerclamp driver.
From Jacob Pan.

- a couple of small fixes and cleanups from Joe Perches, Mathias
Krause, Dan Carpenter and Anand Moon"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
tools/thermal: tmon: fixed the 'make install' command
thermal: rockchip: fix an error code
thermal/powerclamp: fix missing newer package c-states
thermal/intel_powerclamp: add id for broadwell server
thermal/intel_powerclamp: add __init / __exit annotations
thermal: Use bool function return values of true/false not 1/0

+49 -50
+47 -40
drivers/thermal/intel_powerclamp.c
··· 206 206 207 207 } 208 208 209 + struct pkg_cstate_info { 210 + bool skip; 211 + int msr_index; 212 + int cstate_id; 213 + }; 214 + 215 + #define PKG_CSTATE_INIT(id) { \ 216 + .msr_index = MSR_PKG_C##id##_RESIDENCY, \ 217 + .cstate_id = id \ 218 + } 219 + 220 + static struct pkg_cstate_info pkg_cstates[] = { 221 + PKG_CSTATE_INIT(2), 222 + PKG_CSTATE_INIT(3), 223 + PKG_CSTATE_INIT(6), 224 + PKG_CSTATE_INIT(7), 225 + PKG_CSTATE_INIT(8), 226 + PKG_CSTATE_INIT(9), 227 + PKG_CSTATE_INIT(10), 228 + {NULL}, 229 + }; 230 + 209 231 static bool has_pkg_state_counter(void) 210 232 { 211 - u64 tmp; 212 - return !rdmsrl_safe(MSR_PKG_C2_RESIDENCY, &tmp) || 213 - !rdmsrl_safe(MSR_PKG_C3_RESIDENCY, &tmp) || 214 - !rdmsrl_safe(MSR_PKG_C6_RESIDENCY, &tmp) || 215 - !rdmsrl_safe(MSR_PKG_C7_RESIDENCY, &tmp); 233 + u64 val; 234 + struct pkg_cstate_info *info = pkg_cstates; 235 + 236 + /* check if any one of the counter msrs exists */ 237 + while (info->msr_index) { 238 + if (!rdmsrl_safe(info->msr_index, &val)) 239 + return true; 240 + info++; 241 + } 242 + 243 + return false; 216 244 } 217 245 218 246 static u64 pkg_state_counter(void) 219 247 { 220 248 u64 val; 221 249 u64 count = 0; 250 + struct pkg_cstate_info *info = pkg_cstates; 222 251 223 - static bool skip_c2; 224 - static bool skip_c3; 225 - static bool skip_c6; 226 - static bool skip_c7; 227 - 228 - if (!skip_c2) { 229 - if (!rdmsrl_safe(MSR_PKG_C2_RESIDENCY, &val)) 230 - count += val; 231 - else 232 - skip_c2 = true; 233 - } 234 - 235 - if (!skip_c3) { 236 - if (!rdmsrl_safe(MSR_PKG_C3_RESIDENCY, &val)) 237 - count += val; 238 - else 239 - skip_c3 = true; 240 - } 241 - 242 - if (!skip_c6) { 243 - if (!rdmsrl_safe(MSR_PKG_C6_RESIDENCY, &val)) 244 - count += val; 245 - else 246 - skip_c6 = true; 247 - } 248 - 249 - if (!skip_c7) { 250 - if (!rdmsrl_safe(MSR_PKG_C7_RESIDENCY, &val)) 251 - count += val; 252 - else 253 - skip_c7 = true; 252 + while (info->msr_index) { 253 + if (!info->skip) { 254 + if (!rdmsrl_safe(info->msr_index, &val)) 255 + count += val; 256 + else 257 + info->skip = true; 258 + } 259 + info++; 254 260 } 255 261 256 262 return count; ··· 673 667 }; 674 668 675 669 /* runs on Nehalem and later */ 676 - static const struct x86_cpu_id intel_powerclamp_ids[] = { 670 + static const struct x86_cpu_id intel_powerclamp_ids[] __initconst = { 677 671 { X86_VENDOR_INTEL, 6, 0x1a}, 678 672 { X86_VENDOR_INTEL, 6, 0x1c}, 679 673 { X86_VENDOR_INTEL, 6, 0x1e}, ··· 695 689 { X86_VENDOR_INTEL, 6, 0x46}, 696 690 { X86_VENDOR_INTEL, 6, 0x4c}, 697 691 { X86_VENDOR_INTEL, 6, 0x4d}, 692 + { X86_VENDOR_INTEL, 6, 0x4f}, 698 693 { X86_VENDOR_INTEL, 6, 0x56}, 699 694 {} 700 695 }; 701 696 MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); 702 697 703 - static int powerclamp_probe(void) 698 + static int __init powerclamp_probe(void) 704 699 { 705 700 if (!x86_match_cpu(intel_powerclamp_ids)) { 706 701 pr_err("Intel powerclamp does not run on family %d model %d\n", ··· 767 760 debugfs_remove_recursive(debug_dir); 768 761 } 769 762 770 - static int powerclamp_init(void) 763 + static int __init powerclamp_init(void) 771 764 { 772 765 int retval; 773 766 int bitmap_size; ··· 816 809 } 817 810 module_init(powerclamp_init); 818 811 819 - static void powerclamp_exit(void) 812 + static void __exit powerclamp_exit(void) 820 813 { 821 814 unregister_hotcpu_notifier(&powerclamp_cpu_notifier); 822 815 end_power_clamp();
+1 -1
drivers/thermal/rockchip_thermal.c
··· 529 529 530 530 thermal->pclk = devm_clk_get(&pdev->dev, "apb_pclk"); 531 531 if (IS_ERR(thermal->pclk)) { 532 - error = PTR_ERR(thermal->clk); 532 + error = PTR_ERR(thermal->pclk); 533 533 dev_err(&pdev->dev, "failed to get apb_pclk clock: %d\n", 534 534 error); 535 535 return error;
+1 -1
drivers/thermal/thermal_core.h
··· 103 103 static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, 104 104 int trip) 105 105 { 106 - return 0; 106 + return false; 107 107 } 108 108 static inline const struct thermal_trip * 109 109 of_thermal_get_trip_points(struct thermal_zone_device *tz)
-8
tools/thermal/tmon/Makefile
··· 12 12 INSTALL_PROGRAM=install -m 755 -p 13 13 DEL_FILE=rm -f 14 14 15 - INSTALL_CONFIGFILE=install -m 644 -p 16 - CONFIG_FILE= 17 - CONFIG_PATH= 18 - 19 15 # Static builds might require -ltinfo, for instance 20 16 ifneq ($(findstring -static, $(LDFLAGS)),) 21 17 STATIC := --static ··· 34 38 install: 35 39 - mkdir -p $(INSTALL_ROOT)/$(BINDIR) 36 40 - $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" 37 - - mkdir -p $(INSTALL_ROOT)/$(CONFIG_PATH) 38 - - $(INSTALL_CONFIGFILE) "$(CONFIG_FILE)" "$(INSTALL_ROOT)/$(CONFIG_PATH)" 39 41 40 42 uninstall: 41 43 $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" 42 - $(CONFIG_FILE) "$(CONFIG_PATH)" 43 - 44 44 45 45 clean: 46 46 find . -name "*.o" | xargs $(DEL_FILE)