Niklas Cassel
e5e21f70bf
regulator: core: Take lock before applying system load
Take the regulator lock before applying system load.
Fixes the following lockdep splat:
[ 5.583581] WARNING: CPU: 1 PID: 16 at drivers/regulator/core.c:925 drms_uA_update+0x114/0x360
[ 5.588467] Modules linked in:
[ 5.596833] CPU: 1 PID: 16 Comm: kworker/1:0 Not tainted 5.0.0-rc6-next-20190213-00002-g0fce66ab480f #18
[ 5.599933] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[ 5.609544] Workqueue: events qcom_channel_state_worker
[ 5.616209] pstate: 60000005 (nZCv daif -PAN -UAO)
[ 5.621152] pc : drms_uA_update+0x114/0x360
[ 5.626006] lr : drms_uA_update+0x110/0x360
[ 5.630084] sp : ffff0000124b3490
[ 5.634242] x29: ffff0000124b3490 x28: ffff800005326e00
[ 5.637735] x27: ffff0000124b35f8 x26: 000000000032bc48
[ 5.643117] x25: ffff800004c7e800 x24: ffff800004c6d500
[ 5.648411] x23: ffff800004c38a80 x22: 00000000000000d1
[ 5.653706] x21: 00000000001ab3f0 x20: ffff800004c7e800
[ 5.659001] x19: ffff0000114c3000 x18: ffffffffffffffff
[ 5.664297] x17: 0000000000000000 x16: 0000000000000000
[ 5.669592] x15: ffff0000114c3808 x14: 0720072007200720
[ 5.674888] x13: 00000000199c9b28 x12: ffff80002bcccc40
[ 5.680183] x11: ffff000012286000 x10: ffff0000114c3808
[ 5.685477] x9 : 0720072007200720 x8 : ffff000010e9e808
[ 5.690772] x7 : ffff0000106da568 x6 : 0000000000000000
[ 5.696067] x5 : 0000000000000000 x4 : 0000000000000000
[ 5.701362] x3 : 0000000000000004 x2 : 0000000000000000
[ 5.706658] x1 : 0000000000000000 x0 : 0000000000000000
[ 5.711952] Call trace:
[ 5.717223] drms_uA_update+0x114/0x360
[ 5.719405] regulator_register+0xb30/0x1140
[ 5.723230] devm_regulator_register+0x4c/0xa8
[ 5.727745] rpm_reg_probe+0xfc/0x1b0
[ 5.731992] platform_drv_probe+0x50/0xa0
[ 5.735727] really_probe+0x20c/0x2b8
[ 5.739718] driver_probe_device+0x58/0x100
[ 5.743368] __device_attach_driver+0x90/0xd0
[ 5.747363] bus_for_each_drv+0x64/0xc8
[ 5.751870] __device_attach+0xd8/0x138
[ 5.755516] device_initial_probe+0x10/0x18
[ 5.759341] bus_probe_device+0x98/0xa0
[ 5.763502] device_add+0x3d0/0x640
[ 5.767319] of_device_add+0x48/0x58
[ 5.770793] of_platform_device_create_pdata+0xb0/0x128
[ 5.774629] of_platform_bus_create+0x174/0x370
[ 5.779569] of_platform_populate+0x78/0xe0
[ 5.784082] qcom_smd_rpm_probe+0x80/0xa0
[ 5.788245] rpmsg_dev_probe+0x114/0x1a0
[ 5.792411] really_probe+0x20c/0x2b8
[ 5.796401] driver_probe_device+0x58/0x100
[ 5.799964] __device_attach_driver+0x90/0xd0
[ 5.803960] bus_for_each_drv+0x64/0xc8
[ 5.808468] __device_attach+0xd8/0x138
[ 5.812115] device_initial_probe+0x10/0x18
[ 5.815936] bus_probe_device+0x98/0xa0
[ 5.820099] device_add+0x3d0/0x640
[ 5.823916] device_register+0x1c/0x28
[ 5.827391] rpmsg_register_device+0x4c/0x90
[ 5.831216] qcom_channel_state_worker+0x170/0x298
[ 5.835651] process_one_work+0x294/0x6e8
[ 5.840241] worker_thread+0x40/0x450
[ 5.844318] kthread+0x11c/0x120
[ 5.847961] ret_from_fork+0x10/0x18
[ 5.851260] irq event stamp: 9090
[ 5.854820] hardirqs last enabled at (9089): [<ffff000010160798>] console_unlock+0x3e0/0x5b0
[ 5.858086] hardirqs last disabled at (9090): [<ffff0000100817cc>] do_debug_exception+0x104/0x140
[ 5.866596] softirqs last enabled at (9086): [<ffff000010082024>] __do_softirq+0x474/0x574
[ 5.875446] softirqs last disabled at (9079): [<ffff0000100f2254>] irq_exit+0x13c/0x148
[ 5.883598] ---[ end trace 6984ef7f081afa21 ]---
Fixes: fa94e48e13 ("regulator: core: Apply system load even if no consumer loads")
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-15 17:45:11 +00:00
..
2018-03-09 13:01:17 +00:00
2017-01-31 20:32:26 +00:00
2018-12-06 19:56:51 +00:00
2017-01-31 20:35:49 +00:00
2016-07-12 11:23:50 +02:00
2018-04-16 13:08:59 +01:00
2018-06-12 16:19:22 -07:00
2018-12-19 18:09:37 +00:00
2017-01-31 20:38:27 +00:00
2018-05-24 15:17:07 +01:00
2018-12-12 16:49:36 +00:00
2017-04-25 16:36:31 +01:00
2018-11-13 16:21:50 -08:00
2016-04-11 15:15:36 +01:00
2019-02-04 09:54:20 +01:00
2019-01-07 16:12:33 +00:00
2018-12-11 20:44:49 +00:00
2018-11-13 16:21:49 -08:00
2019-02-15 17:45:11 +00:00
2018-07-24 15:37:08 +01:00
2015-12-22 23:59:57 +00:00
2019-01-25 17:52:59 +00:00
2018-09-20 18:28:09 -07:00
2017-06-07 19:47:24 +01:00
2018-07-04 07:17:08 +01:00
2018-11-19 12:33:17 +00:00
2018-12-11 01:04:37 +00:00
2017-10-31 11:01:14 +00:00
2018-12-20 14:38:42 +00:00
2017-02-04 11:37:25 +01:00
2017-08-21 16:57:53 +01:00
2018-09-17 14:32:22 -07:00
2018-12-11 01:03:40 +00:00
2018-06-12 16:19:22 -07:00
2018-09-28 15:07:30 +01:00
2017-04-30 22:17:31 +09:00
2017-06-07 20:25:49 +01:00
2017-06-14 18:27:20 +01:00
2018-11-22 14:38:00 +00:00
2018-08-28 19:41:36 +01:00
2018-12-21 11:02:24 +00:00
2018-12-11 01:03:49 +00:00
2019-02-07 14:13:07 +00:00
2016-02-05 18:57:09 +00:00
2016-11-11 15:36:38 +00:00
2016-04-14 14:46:05 +01:00
2016-04-14 14:46:19 +01:00
2017-05-19 17:56:37 +01:00
2015-12-23 00:01:23 +00:00
2018-12-11 01:03:54 +00:00
2018-04-17 10:57:21 +01:00
2018-09-07 13:03:55 +01:00
2018-09-07 13:03:55 +01:00
2018-12-13 12:19:04 +00:00
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2017-01-31 20:54:26 +00:00
2017-01-31 20:54:41 +00:00
2018-12-11 01:03:59 +00:00
2018-12-11 01:04:31 +00:00
2018-12-06 19:56:51 +00:00
2018-08-08 10:52:50 +01:00
2018-08-08 10:52:50 +01:00
2019-01-10 12:07:29 +00:00
2018-12-11 01:04:08 +00:00
2018-08-08 10:52:50 +01:00
2018-08-08 10:52:50 +01:00
2018-12-06 19:56:51 +00:00
2019-01-25 17:51:05 +00:00
2019-01-25 17:51:05 +00:00
2019-01-25 17:51:05 +00:00
2018-12-20 14:38:27 +00:00
2015-12-18 12:14:27 +00:00
2016-07-19 18:31:59 +01:00
2017-08-15 12:50:48 +01:00
2016-05-30 16:29:43 +01:00
2018-12-04 16:41:38 +00:00
2018-12-19 12:37:52 +00:00
2018-06-12 16:19:22 -07:00
2017-01-31 20:57:31 +00:00
2017-01-31 20:58:15 +00:00
2018-11-06 17:27:46 +00:00
2017-01-31 20:58:46 +00:00
2015-11-20 18:06:15 +00:00
2017-01-31 20:59:01 +00:00
2016-09-26 08:59:08 -07:00
2017-08-30 16:12:17 +01:00
2017-08-30 16:12:17 +01:00
2017-07-24 16:26:35 +01:00
2017-07-07 13:42:03 +01:00
2018-09-20 10:06:37 -07:00
2018-07-20 17:40:57 +01:00
2018-12-06 19:56:51 +00:00
2018-06-12 16:19:22 -07:00
2017-08-21 08:54:12 +01:00
2017-10-18 11:23:21 +01:00
2019-02-13 12:31:19 +00:00
2019-02-11 16:59:29 +00:00
2018-12-11 01:04:43 +00:00
2018-01-03 12:10:14 +00:00
2018-02-08 15:28:35 +00:00
2018-12-03 11:39:24 +00:00
2016-11-13 09:22:37 +00:00
2018-05-09 18:25:06 +09:00
2018-06-12 16:19:22 -07:00
2015-11-18 13:19:47 +00:00
2016-10-24 17:49:14 +01:00
2016-04-20 17:37:59 +01:00
2018-04-20 11:44:34 +01:00
2016-05-31 16:38:01 +01:00
2017-04-18 18:55:05 +01:00
2017-02-13 18:04:28 +00:00
2018-12-11 01:04:56 +00:00
2017-04-14 17:59:32 +01:00
2018-07-30 09:41:04 +01:00
2018-06-12 16:19:22 -07:00
2018-12-21 11:04:59 +00:00
2018-07-07 17:52:26 +02:00
2018-06-12 16:19:22 -07:00
2017-09-04 14:41:02 +01:00
2018-04-20 12:45:36 +01:00
2019-02-02 17:05:42 +01:00
2017-04-14 18:01:03 +01:00
2016-02-15 21:01:52 +00:00
2016-01-12 18:26:12 +00:00
2015-12-23 00:00:00 +00:00
2016-01-12 18:26:12 +00:00
2018-11-19 12:33:17 +00:00
2015-12-23 00:00:00 +00:00
2018-12-12 16:47:10 +00:00