From e88c37afe3f1084712d4073f39e8c64857ccd036 Mon Sep 17 00:00:00 2001 From: sumitg Date: Thu, 28 Feb 2019 18:57:10 +0530 Subject: driver: therm_fan_est: fix lockdep annotation Fix lockdep warning by moving rwlock_init(&est_data->state_lock) before using. Warning fixed: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. .... Call trace: [] dump_backtrace+0x0/0x1a0 [] show_stack+0x24/0x30 [] dump_stack+0xa8/0xd8 [] register_lock_class+0x4fc/0x538 [] __lock_acquire+0x7c/0x748 [] lock_acquire+0xc4/0x290 [] _raw_read_lock+0x4c/0x60 [] therm_fan_est_get_trip_temp+0x38/0x138 [] thermal_zone_device_register+0x230/0x778 [] therm_fan_est_probe+0xa40/0xc48 Bug 200464909 Change-Id: I60d038a729e018edf260b4d83ecee278a9816b31 Signed-off-by: sumitg Reviewed-on: https://git-master.nvidia.com/r/2030043 Reviewed-by: svc-mobile-coverity Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Nat Pettipaw Reviewed-by: Vinayak Pane Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/misc/therm_fan_est.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/therm_fan_est.c b/drivers/misc/therm_fan_est.c index 2f6b73e13..318d711e7 100644 --- a/drivers/misc/therm_fan_est.c +++ b/drivers/misc/therm_fan_est.c @@ -825,6 +825,8 @@ static int therm_fan_est_probe(struct platform_device *pdev) else est_data->is_pid_gov = false; + rwlock_init(&est_data->state_lock); + est_data->tzp = tzp; est_data->thz = thermal_zone_device_register( (char *)dev_name(&pdev->dev), @@ -837,8 +839,6 @@ static int therm_fan_est_probe(struct platform_device *pdev) } pr_info("THERMAL EST: thz register success.\n"); - rwlock_init(&est_data->state_lock); - /* workqueue related */ est_data->workqueue = alloc_workqueue(dev_name(&pdev->dev), WQ_HIGHPRI | WQ_UNBOUND, 1); -- cgit v1.2.2