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+acpi-3.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes and new device IDs from Rafael Wysocki:

- Fix for a cpufreq regression causing stale sysfs files to be left
behind during system resume if cpufreq_add_dev() fails for one or
more CPUs from Viresh Kumar.

- Fix for a bug in cpufreq causing CONFIG_CPU_FREQ_DEFAULT_* to be
ignored when the intel_pstate driver is used from Jason Baron.

- System suspend fix for a memory leak in pm_vt_switch_unregister()
that forgot to release objects after removing them from
pm_vt_switch_list. From Masami Ichikawa.

- Intel Valley View device ID and energy unit encoding update for the
(recently added) Intel RAPL (Running Average Power Limit) driver from
Jacob Pan.

- Intel Bay Trail SoC GPIO and ACPI device IDs for the Low Power
Subsystem (LPSS) ACPI driver from Paul Drews.

* tag 'pm+acpi-3.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
powercap / RAPL: add support for ValleyView Soc
PM / sleep: Fix memory leak in pm_vt_switch_unregister().
cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers
cpufreq: remove sysfs files for CPUs which failed to come back after resume
ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs

+51 -34
+1
drivers/acpi/acpi_lpss.c
··· 162 162 { "80860F14", (unsigned long)&byt_sdio_dev_desc }, 163 163 { "80860F41", (unsigned long)&byt_i2c_dev_desc }, 164 164 { "INT33B2", }, 165 + { "INT33FC", }, 165 166 166 167 { "INT3430", (unsigned long)&lpt_dev_desc }, 167 168 { "INT3431", (unsigned long)&lpt_dev_desc },
+37 -32
drivers/cpufreq/cpufreq.c
··· 828 828 int ret = 0; 829 829 830 830 memcpy(&new_policy, policy, sizeof(*policy)); 831 + 832 + /* Use the default policy if its valid. */ 833 + if (cpufreq_driver->setpolicy) 834 + cpufreq_parse_governor(policy->governor->name, 835 + &new_policy.policy, NULL); 836 + 831 837 /* assure that the starting sequence is run in cpufreq_set_policy */ 832 838 policy->governor = NULL; 833 839 ··· 851 845 852 846 #ifdef CONFIG_HOTPLUG_CPU 853 847 static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, 854 - unsigned int cpu, struct device *dev, 855 - bool frozen) 848 + unsigned int cpu, struct device *dev) 856 849 { 857 850 int ret = 0; 858 851 unsigned long flags; ··· 882 877 } 883 878 } 884 879 885 - /* Don't touch sysfs links during light-weight init */ 886 - if (!frozen) 887 - ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq"); 888 - 889 - return ret; 880 + return sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq"); 890 881 } 891 882 #endif 892 883 ··· 925 924 kfree(policy); 926 925 927 926 return NULL; 927 + } 928 + 929 + static void cpufreq_policy_put_kobj(struct cpufreq_policy *policy) 930 + { 931 + struct kobject *kobj; 932 + struct completion *cmp; 933 + 934 + down_read(&policy->rwsem); 935 + kobj = &policy->kobj; 936 + cmp = &policy->kobj_unregister; 937 + up_read(&policy->rwsem); 938 + kobject_put(kobj); 939 + 940 + /* 941 + * We need to make sure that the underlying kobj is 942 + * actually not referenced anymore by anybody before we 943 + * proceed with unloading. 944 + */ 945 + pr_debug("waiting for dropping of refcount\n"); 946 + wait_for_completion(cmp); 947 + pr_debug("wait complete\n"); 928 948 } 929 949 930 950 static void cpufreq_policy_free(struct cpufreq_policy *policy) ··· 1008 986 list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) { 1009 987 if (cpumask_test_cpu(cpu, tpolicy->related_cpus)) { 1010 988 read_unlock_irqrestore(&cpufreq_driver_lock, flags); 1011 - ret = cpufreq_add_policy_cpu(tpolicy, cpu, dev, frozen); 989 + ret = cpufreq_add_policy_cpu(tpolicy, cpu, dev); 1012 990 up_read(&cpufreq_rwsem); 1013 991 return ret; 1014 992 } ··· 1118 1096 if (cpufreq_driver->exit) 1119 1097 cpufreq_driver->exit(policy); 1120 1098 err_set_policy_cpu: 1099 + if (frozen) 1100 + cpufreq_policy_put_kobj(policy); 1121 1101 cpufreq_policy_free(policy); 1102 + 1122 1103 nomem_out: 1123 1104 up_read(&cpufreq_rwsem); 1124 1105 ··· 1143 1118 } 1144 1119 1145 1120 static int cpufreq_nominate_new_policy_cpu(struct cpufreq_policy *policy, 1146 - unsigned int old_cpu, bool frozen) 1121 + unsigned int old_cpu) 1147 1122 { 1148 1123 struct device *cpu_dev; 1149 1124 int ret; 1150 1125 1151 1126 /* first sibling now owns the new sysfs dir */ 1152 1127 cpu_dev = get_cpu_device(cpumask_any_but(policy->cpus, old_cpu)); 1153 - 1154 - /* Don't touch sysfs files during light-weight tear-down */ 1155 - if (frozen) 1156 - return cpu_dev->id; 1157 1128 1158 1129 sysfs_remove_link(&cpu_dev->kobj, "cpufreq"); 1159 1130 ret = kobject_move(&policy->kobj, &cpu_dev->kobj); ··· 1217 1196 if (!frozen) 1218 1197 sysfs_remove_link(&dev->kobj, "cpufreq"); 1219 1198 } else if (cpus > 1) { 1220 - new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu, frozen); 1199 + new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu); 1221 1200 if (new_cpu >= 0) { 1222 1201 update_policy_cpu(policy, new_cpu); 1223 1202 ··· 1239 1218 int ret; 1240 1219 unsigned long flags; 1241 1220 struct cpufreq_policy *policy; 1242 - struct kobject *kobj; 1243 - struct completion *cmp; 1244 1221 1245 1222 read_lock_irqsave(&cpufreq_driver_lock, flags); 1246 1223 policy = per_cpu(cpufreq_cpu_data, cpu); ··· 1268 1249 } 1269 1250 } 1270 1251 1271 - if (!frozen) { 1272 - down_read(&policy->rwsem); 1273 - kobj = &policy->kobj; 1274 - cmp = &policy->kobj_unregister; 1275 - up_read(&policy->rwsem); 1276 - kobject_put(kobj); 1277 - 1278 - /* 1279 - * We need to make sure that the underlying kobj is 1280 - * actually not referenced anymore by anybody before we 1281 - * proceed with unloading. 1282 - */ 1283 - pr_debug("waiting for dropping of refcount\n"); 1284 - wait_for_completion(cmp); 1285 - pr_debug("wait complete\n"); 1286 - } 1252 + if (!frozen) 1253 + cpufreq_policy_put_kobj(policy); 1287 1254 1288 1255 /* 1289 1256 * Perform the ->exit() even during light-weight tear-down,
+1
drivers/pinctrl/pinctrl-baytrail.c
··· 512 512 513 513 static const struct acpi_device_id byt_gpio_acpi_match[] = { 514 514 { "INT33B2", 0 }, 515 + { "INT33FC", 0 }, 515 516 { } 516 517 }; 517 518 MODULE_DEVICE_TABLE(acpi, byt_gpio_acpi_match);
+11 -2
drivers/powercap/intel_rapl.c
··· 833 833 return 0; 834 834 } 835 835 836 + static const struct x86_cpu_id energy_unit_quirk_ids[] = { 837 + { X86_VENDOR_INTEL, 6, 0x37},/* VLV */ 838 + {} 839 + }; 840 + 836 841 static int rapl_check_unit(struct rapl_package *rp, int cpu) 837 842 { 838 843 u64 msr_val; ··· 858 853 * time unit: 1/time_unit_divisor Seconds 859 854 */ 860 855 value = (msr_val & ENERGY_UNIT_MASK) >> ENERGY_UNIT_OFFSET; 861 - rp->energy_unit_divisor = 1 << value; 862 - 856 + /* some CPUs have different way to calculate energy unit */ 857 + if (x86_match_cpu(energy_unit_quirk_ids)) 858 + rp->energy_unit_divisor = 1000000 / (1 << value); 859 + else 860 + rp->energy_unit_divisor = 1 << value; 863 861 864 862 value = (msr_val & POWER_UNIT_MASK) >> POWER_UNIT_OFFSET; 865 863 rp->power_unit_divisor = 1 << value; ··· 949 941 static const struct x86_cpu_id rapl_ids[] = { 950 942 { X86_VENDOR_INTEL, 6, 0x2a},/* SNB */ 951 943 { X86_VENDOR_INTEL, 6, 0x2d},/* SNB EP */ 944 + { X86_VENDOR_INTEL, 6, 0x37},/* VLV */ 952 945 { X86_VENDOR_INTEL, 6, 0x3a},/* IVB */ 953 946 { X86_VENDOR_INTEL, 6, 0x45},/* HSW */ 954 947 /* TODO: Add more CPU IDs after testing */
+1
kernel/power/console.c
··· 81 81 list_for_each_entry(tmp, &pm_vt_switch_list, head) { 82 82 if (tmp->dev == dev) { 83 83 list_del(&tmp->head); 84 + kfree(tmp); 84 85 break; 85 86 } 86 87 }