diff options
author | sumitg <sumitg@nvidia.com> | 2019-02-28 08:27:10 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-03-01 04:42:18 -0500 |
commit | e88c37afe3f1084712d4073f39e8c64857ccd036 (patch) | |
tree | 2a0a5eb1e0e448103d3a4e8ac6b7298113e881b8 | |
parent | e98f4a918d32b8dfe04c6ba498b971bea1ad3e8a (diff) |
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:
[<ffffff800808ccb0>] dump_backtrace+0x0/0x1a0
[<ffffff800808d354>] show_stack+0x24/0x30
[<ffffff80084ce2f0>] dump_stack+0xa8/0xd8
[<ffffff800812f8cc>] register_lock_class+0x4fc/0x538
[<ffffff8008133efc>] __lock_acquire+0x7c/0x748
[<ffffff80081349cc>] lock_acquire+0xc4/0x290
[<ffffff80090ad35c>] _raw_read_lock+0x4c/0x60
[<ffffff80088ab550>] therm_fan_est_get_trip_temp+0x38/0x138
[<ffffff8008c60148>] thermal_zone_device_register+0x230/0x778
[<ffffff80088ace68>] therm_fan_est_probe+0xa40/0xc48
Bug 200464909
Change-Id: I60d038a729e018edf260b4d83ecee278a9816b31
Signed-off-by: sumitg <sumitg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030043
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nat Pettipaw <npettipaw@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/misc/therm_fan_est.c | 4 |
1 files 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) | |||
825 | else | 825 | else |
826 | est_data->is_pid_gov = false; | 826 | est_data->is_pid_gov = false; |
827 | 827 | ||
828 | rwlock_init(&est_data->state_lock); | ||
829 | |||
828 | est_data->tzp = tzp; | 830 | est_data->tzp = tzp; |
829 | est_data->thz = thermal_zone_device_register( | 831 | est_data->thz = thermal_zone_device_register( |
830 | (char *)dev_name(&pdev->dev), | 832 | (char *)dev_name(&pdev->dev), |
@@ -837,8 +839,6 @@ static int therm_fan_est_probe(struct platform_device *pdev) | |||
837 | } | 839 | } |
838 | pr_info("THERMAL EST: thz register success.\n"); | 840 | pr_info("THERMAL EST: thz register success.\n"); |
839 | 841 | ||
840 | rwlock_init(&est_data->state_lock); | ||
841 | |||
842 | /* workqueue related */ | 842 | /* workqueue related */ |
843 | est_data->workqueue = alloc_workqueue(dev_name(&pdev->dev), | 843 | est_data->workqueue = alloc_workqueue(dev_name(&pdev->dev), |
844 | WQ_HIGHPRI | WQ_UNBOUND, 1); | 844 | WQ_HIGHPRI | WQ_UNBOUND, 1); |