Martin Fuzzey
a6f7bf2652
rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path
commit 950ac33dbe6ff656a623d862022f0762ec061ba7 upstream.
The STM32MP1 RTC may have 2 clocks, the pclk and the rtc_ck.
If clk_prepare_enable() fails for the second clock (rtc_ck) we must only
call clk_disable_unprepare() for the first clock (pclk) but currently we
call it on both leading to a WARN:
[ 15.629568] WARNING: CPU: 0 PID: 146 at drivers/clk/clk.c:958 clk_core_disable+0xb0/0xc8
[ 15.637620] ck_rtc already disabled
[ 15.663322] CPU: 0 PID: 146 Comm: systemd-udevd Not tainted 5.4.77-pknbsp-svn5759-atag-v5.4.77-204-gea4235203137-dirty #2413
[ 15.674510] Hardware name: STM32 (Device Tree Support)
[ 15.679658] [<c0111148>] (unwind_backtrace) from [<c010c0b8>] (show_stack+0x10/0x14)
[ 15.687371] [<c010c0b8>] (show_stack) from [<c0ab3d28>] (dump_stack+0xc0/0xe0)
[ 15.694574] [<c0ab3d28>] (dump_stack) from [<c012360c>] (__warn+0xc8/0xf0)
[ 15.701428] [<c012360c>] (__warn) from [<c0123694>] (warn_slowpath_fmt+0x60/0x94)
[ 15.708894] [<c0123694>] (warn_slowpath_fmt) from [<c053b518>] (clk_core_disable+0xb0/0xc8)
[ 15.717230] [<c053b518>] (clk_core_disable) from [<c053c190>] (clk_core_disable_lock+0x18/0x24)
[ 15.725924] [<c053c190>] (clk_core_disable_lock) from [<bf0adc44>] (stm32_rtc_probe+0x124/0x5e4 [rtc_stm32])
[ 15.735739] [<bf0adc44>] (stm32_rtc_probe [rtc_stm32]) from [<c05f7d4c>] (platform_drv_probe+0x48/0x98)
[ 15.745095] [<c05f7d4c>] (platform_drv_probe) from [<c05f5cec>] (really_probe+0x1f0/0x458)
[ 15.753338] [<c05f5cec>] (really_probe) from [<c05f61c4>] (driver_probe_device+0x70/0x1c4)
[ 15.761584] [<c05f61c4>] (driver_probe_device) from [<c05f6580>] (device_driver_attach+0x58/0x60)
[ 15.770439] [<c05f6580>] (device_driver_attach) from [<c05f6654>] (__driver_attach+0xcc/0x170)
[ 15.779032] [<c05f6654>] (__driver_attach) from [<c05f40d8>] (bus_for_each_dev+0x58/0x7c)
[ 15.787191] [<c05f40d8>] (bus_for_each_dev) from [<c05f4ffc>] (bus_add_driver+0xdc/0x1f8)
[ 15.795352] [<c05f4ffc>] (bus_add_driver) from [<c05f6ed8>] (driver_register+0x7c/0x110)
[ 15.803425] [<c05f6ed8>] (driver_register) from [<c01027bc>] (do_one_initcall+0x70/0x1b8)
[ 15.811588] [<c01027bc>] (do_one_initcall) from [<c01a1094>] (do_init_module+0x58/0x1f8)
[ 15.819660] [<c01a1094>] (do_init_module) from [<c01a0074>] (load_module+0x1e58/0x23c8)
[ 15.827646] [<c01a0074>] (load_module) from [<c01a0860>] (sys_finit_module+0xa0/0xd4)
[ 15.835459] [<c01a0860>] (sys_finit_module) from [<c01011e0>] (__sys_trace_return+0x0/0x20)
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Fixes: 4e64350f42
("rtc: add STM32 RTC driver")
Cc: stable@vger.kernel.org
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1623087421-19722-1-git-send-email-martin.fuzzey@flowbird.group
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-14 16:55:44 +02:00
..
2020-04-02 18:47:30 +02:00
2019-10-23 17:23:43 +02:00
2019-11-27 09:31:08 +01:00
2021-03-04 11:38:03 +01:00
2019-04-06 15:05:31 +02:00
2020-10-19 22:47:56 +02:00
2019-04-04 10:07:08 +02:00
2019-04-04 10:07:08 +02:00
2019-08-21 09:57:23 +02:00
2020-04-18 22:42:06 +02:00
2019-04-11 16:42:55 +02:00
2020-03-16 11:12:11 +01:00
2020-07-16 11:17:52 +02:00
2019-08-21 09:57:23 +02:00
2020-06-06 00:16:24 +02:00
2019-08-21 09:57:23 +02:00
2019-10-07 15:49:20 +02:00
2019-05-30 11:26:37 -07:00
2019-12-23 11:16:23 +01:00
2019-10-07 01:07:35 +02:00
2020-01-15 15:11:10 +01:00
2019-10-07 01:07:35 +02:00
2020-03-16 11:12:09 +01:00
2020-03-23 09:27:17 +01:00
2020-07-16 11:17:52 +02:00
2019-05-21 10:50:45 +02:00
2019-11-08 16:14:09 +01:00
2019-10-07 01:07:35 +02:00
2020-08-21 00:10:33 +02:00
2019-10-07 01:07:35 +02:00
2018-09-28 14:20:59 +02:00
2020-07-02 22:32:00 +02:00
2020-01-07 17:36:46 +01:00
2020-04-01 12:33:43 +02:00
2019-05-30 11:26:32 -07:00
2019-10-07 15:49:18 +02:00
2020-03-16 11:12:09 +01:00
2019-10-07 01:07:35 +02:00
2019-04-04 10:07:09 +02:00
2019-10-07 01:07:35 +02:00
2019-10-07 01:07:35 +02:00
2019-11-15 11:58:14 +01:00
2020-03-16 11:12:10 +01:00
2021-05-19 10:13:05 +02:00
2019-12-23 11:22:32 +01:00
2019-10-07 15:49:38 +02:00
2020-07-21 09:56:46 +02:00
2019-06-19 17:09:55 +02:00
2019-10-07 01:07:35 +02:00
2019-10-07 01:07:35 +02:00
2019-08-21 09:57:23 +02:00
2020-09-15 11:24:29 +02:00
2019-06-19 17:09:55 +02:00
2019-05-23 17:42:25 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-11-08 16:14:09 +01:00
2020-12-30 11:54:29 +01:00
2019-07-17 10:03:50 -07:00
2021-05-19 10:13:03 +02:00
2019-05-30 11:26:37 -07:00
2019-05-21 10:50:45 +02:00
2020-07-16 11:15:43 +02:00
2019-06-05 17:37:06 +02:00
2019-12-23 11:18:06 +01:00
2020-03-29 22:08:35 +02:00
2020-07-02 22:32:01 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2019-07-22 22:30:19 +02:00
2020-05-11 16:35:05 +02:00
2019-06-19 17:09:55 +02:00
2020-04-15 09:56:17 +02:00
2019-11-08 16:14:09 +01:00
2019-05-30 11:26:32 -07:00
2020-08-23 17:36:59 -05:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-03-16 11:12:11 +01:00
2019-06-19 17:09:55 +02:00
2019-10-06 21:04:51 +02:00
2018-03-17 14:20:46 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2018-11-22 18:11:35 +01:00
2018-08-14 23:38:45 +02:00
2020-08-07 23:29:47 +02:00
2020-05-11 16:21:50 +02:00
2020-01-04 05:31:50 +01:00
2020-07-16 11:17:52 +02:00
2020-09-29 22:19:15 +02:00
2019-11-27 09:31:13 +01:00
2019-12-23 11:23:49 +01:00
2020-05-30 04:12:38 +02:00
2019-06-05 17:37:17 +02:00
2019-11-18 15:23:54 +01:00
2020-04-18 22:42:04 +02:00
2020-10-15 12:01:29 +02:00
2019-10-07 01:07:35 +02:00
2019-10-07 01:07:35 +02:00
2019-07-22 22:16:12 +02:00
2020-03-22 22:10:41 +01:00
2020-03-23 09:27:17 +01:00
2019-05-24 17:39:01 +02:00
2016-09-02 01:24:06 +02:00
2019-05-08 22:14:36 +02:00
2019-08-20 21:42:19 +02:00
2021-01-09 13:46:22 +01:00
2020-08-23 17:36:59 -05:00
2019-12-23 11:23:53 +01:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2021-05-26 12:06:57 +02:00
2019-09-01 08:48:28 +02:00
2019-10-07 01:07:35 +02:00
2020-03-16 11:12:09 +01:00
2021-01-06 14:56:53 +01:00
2020-03-23 09:27:17 +01:00
2019-04-04 10:07:10 +02:00
2019-08-13 10:53:10 +02:00
2019-10-06 21:04:51 +02:00
2020-10-19 22:48:55 +02:00
2019-05-30 11:29:52 -07:00
2020-04-15 09:58:24 +02:00
2019-08-13 10:53:10 +02:00
2019-05-21 10:50:45 +02:00
2020-08-21 00:13:44 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-07 01:07:35 +02:00
2020-10-15 12:09:35 +02:00
2019-12-23 11:16:23 +01:00
2020-10-19 22:47:56 +02:00
2020-09-29 22:20:10 +02:00
2019-06-19 17:09:55 +02:00
2019-11-15 11:58:12 +01:00
2020-09-29 22:18:10 +02:00
2019-12-23 11:22:21 +01:00
2019-06-19 17:09:55 +02:00
2020-09-15 10:42:36 +02:00
2019-06-19 17:09:55 +02:00
2019-07-23 20:34:31 +02:00
2019-10-19 22:33:05 +02:00
2020-03-16 11:12:09 +01:00
2017-11-02 11:10:55 +01:00
2019-11-08 16:14:09 +01:00
2019-08-21 09:57:23 +02:00
2020-02-12 12:21:40 +01:00
2020-03-16 11:12:09 +01:00
2020-05-30 03:17:48 +02:00
2019-10-07 01:07:35 +02:00
2020-09-15 11:21:50 +02:00
2020-03-16 11:12:09 +01:00
2019-10-07 01:07:35 +02:00
2021-07-14 16:55:44 +02:00
2020-08-23 17:36:59 -05:00
2019-04-04 10:07:10 +02:00
2021-01-06 14:56:53 +01:00
2019-10-07 01:07:35 +02:00
2019-11-27 09:31:13 +01:00
2019-05-23 17:44:52 +02:00
2020-01-25 21:50:18 +01:00
2019-11-17 22:24:33 +01:00
2016-03-14 17:08:24 +01:00
2019-05-30 11:26:32 -07:00
2019-10-07 01:07:35 +02:00
2019-11-27 09:31:13 +01:00
2019-10-23 17:23:43 +02:00
2019-10-19 22:33:15 +02:00
2019-10-14 17:49:17 +02:00
2019-07-13 21:39:51 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2019-11-27 09:31:14 +01:00
2020-02-12 12:21:42 +01:00
2020-03-16 11:12:08 +01:00
2019-05-08 22:14:36 +02:00