Pablo Sun
262029c0c5
mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw
...
commit c7bb120c1c66672b657e95d0942c989b8275aeb3 upstream.
Use atomic readl_poll_timeout_atomic, because msdc_reset_hw
may be invoked in IRQ handler in the following context:
msdc_irq() -> msdc_cmd_done() -> msdc_reset_hw()
The following kernel BUG stack trace can be observed on
Genio 1200 EVK after initializing MSDC1 hardware during kernel boot:
[ 1.187441] BUG: scheduling while atomic: swapper/0/0/0x00010002
[ 1.189157] Modules linked in:
[ 1.204633] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.15.42-mtk+modified #1
[ 1.205713] Hardware name: MediaTek Genio 1200 EVK-P1V2-EMMC (DT)
[ 1.206484] Call trace:
[ 1.206796] dump_backtrace+0x0/0x1ac
[ 1.207266] show_stack+0x24/0x30
[ 1.207692] dump_stack_lvl+0x68/0x84
[ 1.208162] dump_stack+0x1c/0x38
[ 1.208587] __schedule_bug+0x68/0x80
[ 1.209056] __schedule+0x6ec/0x7c0
[ 1.209502] schedule+0x7c/0x110
[ 1.209915] schedule_hrtimeout_range_clock+0xc4/0x1f0
[ 1.210569] schedule_hrtimeout_range+0x20/0x30
[ 1.211148] usleep_range_state+0x84/0xc0
[ 1.211661] msdc_reset_hw+0xc8/0x1b0
[ 1.212134] msdc_cmd_done.isra.0+0x4ac/0x5f0
[ 1.212693] msdc_irq+0x104/0x2d4
[ 1.213121] __handle_irq_event_percpu+0x68/0x280
[ 1.213725] handle_irq_event+0x70/0x15c
[ 1.214230] handle_fasteoi_irq+0xb0/0x1a4
[ 1.214755] handle_domain_irq+0x6c/0x9c
[ 1.215260] gic_handle_irq+0xc4/0x180
[ 1.215741] call_on_irq_stack+0x2c/0x54
[ 1.216245] do_interrupt_handler+0x5c/0x70
[ 1.216782] el1_interrupt+0x30/0x80
[ 1.217242] el1h_64_irq_handler+0x1c/0x2c
[ 1.217769] el1h_64_irq+0x78/0x7c
[ 1.218206] cpuidle_enter_state+0xc8/0x600
[ 1.218744] cpuidle_enter+0x44/0x5c
[ 1.219205] do_idle+0x224/0x2d0
[ 1.219624] cpu_startup_entry+0x30/0x80
[ 1.220129] rest_init+0x108/0x134
[ 1.220568] arch_call_rest_init+0x1c/0x28
[ 1.221094] start_kernel+0x6c0/0x700
[ 1.221564] __primary_switched+0xc0/0xc8
Fixes: ffaea6ebfe9c ("mmc: mtk-sd: Use readl_poll_timeout instead of open-coded polling")
Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioachino.delregno@collabora.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230922095348.22182-1-pablo.sun@mediatek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 11:59:02 +02:00
..
2022-12-31 13:14:16 +01:00
2023-03-22 13:31:30 +01:00
2022-10-26 12:34:55 +02:00
2023-08-26 14:23:29 +02:00
2022-08-17 14:23:56 +02:00
2022-08-17 14:23:57 +02:00
2021-03-30 11:42:06 +02:00
2021-02-15 10:43:23 +01:00
2021-10-26 17:34:57 +02:00
2021-02-01 12:02:33 +01:00
2021-08-24 10:15:32 +02:00
2021-02-01 12:02:33 +01:00
2022-04-08 14:23:22 +02:00
2020-09-07 14:24:21 +02:00
2021-10-26 17:28:41 +02:00
2020-09-07 14:24:21 +02:00
2021-03-31 14:47:53 +02:00
2021-06-14 13:57:42 +02:00
2021-04-16 15:10:08 +02:00
2021-11-18 19:15:52 +01:00
2021-08-24 10:15:31 +02:00
2023-02-22 12:57:06 +01:00
2023-09-06 21:28:37 +01:00
2021-04-23 09:29:49 +02:00
2023-06-28 10:29:45 +02:00
2022-01-27 11:03:43 +01:00
2022-01-27 11:03:43 +01:00
2022-10-05 10:39:38 +02:00
2023-02-22 12:57:06 +01:00
2022-04-13 20:59:21 +02:00
2023-07-23 13:47:32 +02:00
2023-08-16 18:21:57 +02:00
2023-10-25 11:59:02 +02:00
2023-06-28 10:29:47 +02:00
2022-12-31 13:14:16 +01:00
2021-11-18 19:16:34 +01:00
2021-06-14 13:57:42 +02:00
2023-06-28 10:29:47 +02:00
2023-06-28 10:29:47 +02:00
2023-06-28 10:29:47 +02:00
2022-12-31 13:14:16 +01:00
2023-09-19 12:22:52 +02:00
2021-08-24 10:15:35 +02:00
2021-08-24 10:15:35 +02:00
2021-08-24 10:15:35 +02:00
2022-12-31 13:14:16 +01:00
2022-12-31 13:14:16 +01:00
2021-06-14 13:57:34 +02:00
2023-04-26 13:51:52 +02:00
2023-08-26 14:23:38 +02:00
2023-06-28 10:29:47 +02:00
2020-09-07 14:20:17 +02:00
2022-12-02 17:41:08 +01:00
2020-09-07 14:24:21 +02:00
2020-09-07 14:20:17 +02:00
2022-11-16 09:58:24 +01:00
2020-09-07 14:20:17 +02:00
2023-09-23 11:09:56 +02:00
2021-03-30 11:42:07 +02:00
2020-10-28 11:07:01 +01:00
2021-08-27 16:30:36 +02:00
2020-09-07 14:24:21 +02:00
2023-06-28 10:29:43 +02:00
2022-11-16 09:58:24 +01:00
2021-06-23 16:39:08 -06:00
2021-06-14 13:57:44 +02:00
2022-08-17 14:23:50 +02:00
2022-09-05 10:30:09 +02:00
2023-05-11 23:00:23 +09:00
2020-09-07 14:20:17 +02:00
2020-09-07 14:24:21 +02:00
2021-11-18 19:16:31 +01:00
2022-11-26 09:24:48 +01:00
2022-01-27 11:04:47 +01:00
2022-11-26 09:24:48 +01:00
2022-01-16 09:12:43 +01:00
2020-11-16 11:59:30 +01:00
2021-02-01 11:13:09 +01:00
2020-09-07 14:20:17 +02:00
2020-09-07 14:20:17 +02:00
2021-04-15 14:00:15 +02:00
2020-09-07 14:20:17 +02:00
2023-01-12 11:58:50 +01:00
2021-04-12 13:52:48 +02:00
2022-11-16 09:58:24 +01:00
2020-12-11 10:08:37 +01:00
2022-04-13 20:59:21 +02:00
2020-12-11 10:08:37 +01:00
2023-07-23 13:47:32 +02:00
2022-12-08 11:28:43 +01:00
2023-06-28 10:29:47 +02:00
2023-08-26 14:23:29 +02:00
2021-08-24 16:59:39 +02:00
2022-08-25 11:40:36 +02:00
2022-08-25 11:40:36 +02:00
2022-08-25 11:40:36 +02:00
2022-12-31 13:14:17 +01:00
2021-03-30 11:41:59 +02:00
2023-06-28 10:29:47 +02:00
2022-12-31 13:14:17 +01:00
2023-06-09 10:32:31 +02:00
2023-08-26 14:23:37 +02:00
2022-12-31 13:14:17 +01:00