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

Pull thermal management fixes from Zhang Rui:
"Specifics:

- fix an error that "weight_attr" sysfs attribute is not removed
while unbinding. From: Viresh Kumar.

- fix power allocator governor tracing to return the real request.
From Javi Merino.

- remove redundant owner assignment of hisi platform thermal driver.
From Krzysztof Kozlowski.

- a couple of small fixes of Exynos thermal driver. From Krzysztof
Kozlowski and Chanwoo Choi"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
thermal: Drop owner assignment from platform_driver
thermal: exynos: Remove unused code related to platform_data on probe()
thermal: exynos: Add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF
thermal: exynos: Disable the regulator on probe failure
thermal: power_allocator: trace the real requested power
thermal: remove dangling 'weight_attr' device file

Changed files
+20 -15
drivers
-1
drivers/thermal/hisi_thermal.c
··· 405 405 static struct platform_driver hisi_thermal_driver = { 406 406 .driver = { 407 407 .name = "hisi_thermal", 408 - .owner = THIS_MODULE, 409 408 .pm = &hisi_thermal_pm_ops, 410 409 .of_match_table = of_hisi_thermal_match, 411 410 },
+16 -10
drivers/thermal/power_allocator.c
··· 229 229 struct thermal_instance *instance; 230 230 struct power_allocator_params *params = tz->governor_data; 231 231 u32 *req_power, *max_power, *granted_power, *extra_actor_power; 232 - u32 total_req_power, max_allocatable_power; 232 + u32 *weighted_req_power; 233 + u32 total_req_power, max_allocatable_power, total_weighted_req_power; 233 234 u32 total_granted_power, power_range; 234 235 int i, num_actors, total_weight, ret = 0; 235 236 int trip_max_desired_temperature = params->trip_max_desired_temperature; ··· 248 247 } 249 248 250 249 /* 251 - * We need to allocate three arrays of the same size: 252 - * req_power, max_power and granted_power. They are going to 253 - * be needed until this function returns. Allocate them all 254 - * in one go to simplify the allocation and deallocation 255 - * logic. 250 + * We need to allocate five arrays of the same size: 251 + * req_power, max_power, granted_power, extra_actor_power and 252 + * weighted_req_power. They are going to be needed until this 253 + * function returns. Allocate them all in one go to simplify 254 + * the allocation and deallocation logic. 256 255 */ 257 256 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*max_power)); 258 257 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*granted_power)); 259 258 BUILD_BUG_ON(sizeof(*req_power) != sizeof(*extra_actor_power)); 260 - req_power = devm_kcalloc(&tz->device, num_actors * 4, 259 + BUILD_BUG_ON(sizeof(*req_power) != sizeof(*weighted_req_power)); 260 + req_power = devm_kcalloc(&tz->device, num_actors * 5, 261 261 sizeof(*req_power), GFP_KERNEL); 262 262 if (!req_power) { 263 263 ret = -ENOMEM; ··· 268 266 max_power = &req_power[num_actors]; 269 267 granted_power = &req_power[2 * num_actors]; 270 268 extra_actor_power = &req_power[3 * num_actors]; 269 + weighted_req_power = &req_power[4 * num_actors]; 271 270 272 271 i = 0; 272 + total_weighted_req_power = 0; 273 273 total_req_power = 0; 274 274 max_allocatable_power = 0; 275 275 ··· 293 289 else 294 290 weight = instance->weight; 295 291 296 - req_power[i] = frac_to_int(weight * req_power[i]); 292 + weighted_req_power[i] = frac_to_int(weight * req_power[i]); 297 293 298 294 if (power_actor_get_max_power(cdev, tz, &max_power[i])) 299 295 continue; 300 296 301 297 total_req_power += req_power[i]; 302 298 max_allocatable_power += max_power[i]; 299 + total_weighted_req_power += weighted_req_power[i]; 303 300 304 301 i++; 305 302 } ··· 308 303 power_range = pid_controller(tz, current_temp, control_temp, 309 304 max_allocatable_power); 310 305 311 - divvy_up_power(req_power, max_power, num_actors, total_req_power, 312 - power_range, granted_power, extra_actor_power); 306 + divvy_up_power(weighted_req_power, max_power, num_actors, 307 + total_weighted_req_power, power_range, granted_power, 308 + extra_actor_power); 313 309 314 310 total_granted_power = 0; 315 311 i = 0;
+1 -1
drivers/thermal/samsung/Kconfig
··· 1 1 config EXYNOS_THERMAL 2 2 tristate "Exynos thermal management unit driver" 3 - depends on OF 3 + depends on THERMAL_OF 4 4 help 5 5 If you say yes here you get support for the TMU (Thermal Management 6 6 Unit) driver for SAMSUNG EXYNOS series of SoCs. This driver initialises
+2 -3
drivers/thermal/samsung/exynos_tmu.c
··· 1296 1296 1297 1297 static int exynos_tmu_probe(struct platform_device *pdev) 1298 1298 { 1299 - struct exynos_tmu_platform_data *pdata; 1300 1299 struct exynos_tmu_data *data; 1301 1300 int ret; 1302 1301 ··· 1316 1317 ret = exynos_map_dt_data(pdev); 1317 1318 if (ret) 1318 1319 goto err_sensor; 1319 - 1320 - pdata = data->pdata; 1321 1320 1322 1321 INIT_WORK(&data->irq_work, exynos_tmu_work); 1323 1322 ··· 1389 1392 if (!IS_ERR(data->clk_sec)) 1390 1393 clk_unprepare(data->clk_sec); 1391 1394 err_sensor: 1395 + if (!IS_ERR_OR_NULL(data->regulator)) 1396 + regulator_disable(data->regulator); 1392 1397 thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd); 1393 1398 1394 1399 return ret;
+1
drivers/thermal/thermal_core.c
··· 1333 1333 return -ENODEV; 1334 1334 1335 1335 unbind: 1336 + device_remove_file(&tz->device, &pos->weight_attr); 1336 1337 device_remove_file(&tz->device, &pos->attr); 1337 1338 sysfs_remove_link(&tz->device.kobj, pos->name); 1338 1339 release_idr(&tz->idr, &tz->lock, pos->id);