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 tag 'pm-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
"These fix two issues in the Operating Performance Points (OPP)
framework, one cpufreq driver issue, one problem related to the tasks
freezer and a few build-related issues in the cpupower utility.

Specifics:

- Fix tasks freezer deadlock in de_thread() that occurs if one of its
sub-threads has been frozen already (Chanho Min).

- Avoid registering a platform device by the ti-cpufreq driver on
platforms that cannot use it (Dave Gerlach).

- Fix a mistake in the ti-opp-supply operating performance points
(OPP) driver that caused an incorrect reference voltage to be used
and make it adjust the minimum voltage dynamically to avoid hangs
or crashes in some cases (Keerthy).

- Fix issues related to compiler flags in the cpupower utility and
correct a linking problem in it by renaming a file with a duplicate
name (Jiri Olsa, Konstantin Khlebnikov)"

* tag 'pm-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
exec: make de_thread() freezable
cpufreq: ti-cpufreq: Only register platform_device when supported
opp: ti-opp-supply: Correct the supply in _get_optimal_vdd_voltage call
opp: ti-opp-supply: Dynamically update u_volt_min
tools cpupower: Override CFLAGS assignments
tools cpupower debug: Allow to use outside build flags
tools/power/cpupower: fix compilation with STATIC=true

+42 -22
+21 -5
drivers/cpufreq/ti-cpufreq.c
··· 201 201 {}, 202 202 }; 203 203 204 + static const struct of_device_id *ti_cpufreq_match_node(void) 205 + { 206 + struct device_node *np; 207 + const struct of_device_id *match; 208 + 209 + np = of_find_node_by_path("/"); 210 + match = of_match_node(ti_cpufreq_of_match, np); 211 + of_node_put(np); 212 + 213 + return match; 214 + } 215 + 204 216 static int ti_cpufreq_probe(struct platform_device *pdev) 205 217 { 206 218 u32 version[VERSION_COUNT]; 207 - struct device_node *np; 208 219 const struct of_device_id *match; 209 220 struct opp_table *ti_opp_table; 210 221 struct ti_cpufreq_data *opp_data; 211 222 const char * const reg_names[] = {"vdd", "vbb"}; 212 223 int ret; 213 224 214 - np = of_find_node_by_path("/"); 215 - match = of_match_node(ti_cpufreq_of_match, np); 216 - of_node_put(np); 225 + match = dev_get_platdata(&pdev->dev); 217 226 if (!match) 218 227 return -ENODEV; 219 228 ··· 299 290 300 291 static int ti_cpufreq_init(void) 301 292 { 302 - platform_device_register_simple("ti-cpufreq", -1, NULL, 0); 293 + const struct of_device_id *match; 294 + 295 + /* Check to ensure we are on a compatible platform */ 296 + match = ti_cpufreq_match_node(); 297 + if (match) 298 + platform_device_register_data(NULL, "ti-cpufreq", -1, match, 299 + sizeof(*match)); 300 + 303 301 return 0; 304 302 } 305 303 module_init(ti_cpufreq_init);
+4 -1
drivers/opp/ti-opp-supply.c
··· 288 288 int ret; 289 289 290 290 vdd_uv = _get_optimal_vdd_voltage(dev, &opp_data, 291 - new_supply_vbb->u_volt); 291 + new_supply_vdd->u_volt); 292 + 293 + if (new_supply_vdd->u_volt_min < vdd_uv) 294 + new_supply_vdd->u_volt_min = vdd_uv; 292 295 293 296 /* Scaling up? Scale voltage before frequency */ 294 297 if (freq > old_freq) {
+3 -2
fs/exec.c
··· 62 62 #include <linux/oom.h> 63 63 #include <linux/compat.h> 64 64 #include <linux/vmalloc.h> 65 + #include <linux/freezer.h> 65 66 66 67 #include <linux/uaccess.h> 67 68 #include <asm/mmu_context.h> ··· 1084 1083 while (sig->notify_count) { 1085 1084 __set_current_state(TASK_KILLABLE); 1086 1085 spin_unlock_irq(lock); 1087 - schedule(); 1086 + freezable_schedule(); 1088 1087 if (unlikely(__fatal_signal_pending(tsk))) 1089 1088 goto killed; 1090 1089 spin_lock_irq(lock); ··· 1112 1111 __set_current_state(TASK_KILLABLE); 1113 1112 write_unlock_irq(&tasklist_lock); 1114 1113 cgroup_threadgroup_change_end(tsk); 1115 - schedule(); 1114 + freezable_schedule(); 1116 1115 if (unlikely(__fatal_signal_pending(tsk))) 1117 1116 goto killed; 1118 1117 }
+6 -6
tools/power/cpupower/Makefile
··· 129 129 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) 130 130 WARNINGS += -Wshadow 131 131 132 - CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \ 132 + override CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \ 133 133 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE 134 134 135 135 UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \ ··· 156 156 LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o 157 157 LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS)) 158 158 159 - CFLAGS += -pipe 159 + override CFLAGS += -pipe 160 160 161 161 ifeq ($(strip $(NLS)),true) 162 162 INSTALL_NLS += install-gmo 163 163 COMPILE_NLS += create-gmo 164 - CFLAGS += -DNLS 164 + override CFLAGS += -DNLS 165 165 endif 166 166 167 167 ifeq ($(strip $(CPUFREQ_BENCH)),true) ··· 175 175 UTIL_SRC += $(LIB_SRC) 176 176 endif 177 177 178 - CFLAGS += $(WARNINGS) 178 + override CFLAGS += $(WARNINGS) 179 179 180 180 ifeq ($(strip $(V)),false) 181 181 QUIET=@ ··· 188 188 189 189 # if DEBUG is enabled, then we do not strip or optimize 190 190 ifeq ($(strip $(DEBUG)),true) 191 - CFLAGS += -O1 -g -DDEBUG 191 + override CFLAGS += -O1 -g -DDEBUG 192 192 STRIPCMD = /bin/true -Since_we_are_debugging 193 193 else 194 - CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 194 + override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 195 195 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 196 196 endif 197 197
+1 -1
tools/power/cpupower/bench/Makefile
··· 9 9 ifeq ($(strip $(STATIC)),true) 10 10 LIBS = -L../ -L$(OUTPUT) -lm 11 11 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \ 12 - $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o 12 + $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o 13 13 else 14 14 LIBS = -L../ -L$(OUTPUT) -lm -lcpupower 15 15 OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
+2 -2
tools/power/cpupower/debug/x86_64/Makefile
··· 13 13 default: all 14 14 15 15 $(OUTPUT)centrino-decode: ../i386/centrino-decode.c 16 - $(CC) $(CFLAGS) -o $@ $< 16 + $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< 17 17 18 18 $(OUTPUT)powernow-k8-decode: ../i386/powernow-k8-decode.c 19 - $(CC) $(CFLAGS) -o $@ $< 19 + $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< 20 20 21 21 all: $(OUTPUT)centrino-decode $(OUTPUT)powernow-k8-decode 22 22
+1 -1
tools/power/cpupower/lib/cpufreq.c
··· 28 28 29 29 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s", 30 30 cpu, fname); 31 - return sysfs_read_file(path, buf, buflen); 31 + return cpupower_read_sysfs(path, buf, buflen); 32 32 } 33 33 34 34 /* helper function to write a new value to a /sys file */
+1 -1
tools/power/cpupower/lib/cpuidle.c
··· 319 319 320 320 snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname); 321 321 322 - return sysfs_read_file(path, buf, buflen); 322 + return cpupower_read_sysfs(path, buf, buflen); 323 323 } 324 324 325 325
+2 -2
tools/power/cpupower/lib/cpupower.c
··· 15 15 #include "cpupower.h" 16 16 #include "cpupower_intern.h" 17 17 18 - unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) 18 + unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen) 19 19 { 20 20 int fd; 21 21 ssize_t numread; ··· 95 95 96 96 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s", 97 97 cpu, fname); 98 - if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0) 98 + if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0) 99 99 return -1; 100 100 *result = strtol(linebuf, &endp, 0); 101 101 if (endp == linebuf || errno == ERANGE)
+1 -1
tools/power/cpupower/lib/cpupower_intern.h
··· 3 3 #define MAX_LINE_LEN 4096 4 4 #define SYSFS_PATH_MAX 255 5 5 6 - unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen); 6 + unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);