Pablo Sun
aaa476a7ad
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 12:03:13 +02:00
..
2022-12-31 13:32:23 +01:00
2023-03-22 13:33:53 +01:00
2022-09-14 11:53:47 +02:00
2023-06-28 11:12:26 +02:00
2022-07-21 18:02:55 +02:00
2022-07-21 18:03:08 +02:00
2022-07-12 12:25:35 +02:00
2021-10-21 10:49:32 -06:00
2021-08-24 10:15:32 +02:00
2022-03-15 10:29:53 +01:00
2022-07-12 12:25:37 +02:00
2022-07-12 12:25:37 +02:00
2022-07-12 12:25:38 +02:00
2022-10-11 17:42:55 -06:00
2022-03-07 12:56:38 +01:00
2023-02-22 12:59:47 +01:00
2023-09-06 21:26:59 +01:00
2023-06-28 11:12:25 +02:00
2022-02-28 13:06:21 +01:00
2023-06-28 11:12:27 +02:00
2021-12-20 11:19:01 +01:00
2022-09-14 11:53:47 +02:00
2021-12-21 13:22:34 +01:00
2022-09-27 12:38:29 +02:00
2023-02-22 12:59:48 +01:00
2022-04-26 14:05:18 +02:00
2023-07-19 16:22:09 +02:00
2023-08-16 18:27:21 +02:00
2023-10-25 12:03:13 +02:00
2023-06-28 11:12:30 +02:00
2022-12-31 13:32:23 +01:00
2021-10-19 13:02:58 +02:00
2022-04-26 14:05:19 +02:00
2023-06-28 11:12:30 +02:00
2023-06-28 11:12:30 +02:00
2023-06-28 11:12:30 +02:00
2022-12-31 13:32:24 +01:00
2023-09-13 09:43:03 +02:00
2022-12-31 13:33:04 +01:00
2021-08-24 10:15:35 +02:00
2022-12-31 13:33:04 +01:00
2022-12-31 13:32:24 +01:00
2022-12-31 13:32:24 +01:00
2023-04-26 14:28:40 +02:00
2023-08-23 17:52:42 +02:00
2023-06-28 11:12:30 +02:00
2022-06-10 14:51:35 +02:00
2022-11-07 13:33:09 +01:00
2022-11-07 13:28:47 +01:00
2023-09-23 11:11:02 +02:00
2022-06-10 14:51:35 +02:00
2023-06-28 11:12:25 +02:00
2022-11-07 13:28:47 +01:00
2022-07-11 17:13:32 -06:00
2022-07-11 17:13:32 -06:00
2022-07-12 12:42:37 +02:00
2022-08-15 19:31:04 +02:00
2023-05-11 23:03:11 +09:00
2022-07-13 12:29:17 +02:00
2022-11-16 17:00:39 +01:00
2023-10-25 12:03:13 +02:00
2022-11-16 13:58:55 +01:00
2021-12-14 21:35:25 +01:00
2021-10-12 10:21:18 +02:00
2023-06-28 11:12:25 +02:00
2023-01-07 11:11:37 +01:00
2022-07-12 12:25:38 +02:00
2022-12-31 13:33:04 +01:00
2022-04-04 12:17:46 +02:00
2023-07-19 16:22:09 +02:00
2022-12-31 13:33:04 +01:00
2023-06-28 11:12:31 +02:00
2023-06-28 11:12:26 +02:00
2021-08-24 16:59:39 +02:00
2022-07-12 12:31:32 +02:00
2022-07-12 12:31:32 +02:00
2022-07-12 12:31:32 +02:00
2022-12-31 13:32:24 +01:00
2022-04-26 14:05:20 +02:00
2023-06-28 11:12:31 +02:00
2022-12-31 13:32:24 +01:00
2023-06-09 10:34:22 +02:00
2023-08-23 17:52:39 +02:00
2022-12-31 13:32:24 +01:00