wuxu.wu
169df07487
spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
commit 19b61392c5 upstream.
dw_spi_irq() and dw_spi_transfer_one concurrent calls.
I find a panic in dw_writer(): txw = *(u8 *)(dws->tx), when dw->tx==null,
dw->len==4, and dw->tx_end==1.
When tpm driver's message overtime dw_spi_irq() and dw_spi_transfer_one
may concurrent visit dw_spi, so I think dw_spi structure lack of protection.
Otherwise dw_spi_transfer_one set dw rx/tx buffer and then open irq,
store dw rx/tx instructions and other cores handle irq load dw rx/tx
instructions may out of order.
[ 1025.321302] Call trace:
...
[ 1025.321319] __crash_kexec+0x98/0x148
[ 1025.321323] panic+0x17c/0x314
[ 1025.321329] die+0x29c/0x2e8
[ 1025.321334] die_kernel_fault+0x68/0x78
[ 1025.321337] __do_kernel_fault+0x90/0xb0
[ 1025.321346] do_page_fault+0x88/0x500
[ 1025.321347] do_translation_fault+0xa8/0xb8
[ 1025.321349] do_mem_abort+0x68/0x118
[ 1025.321351] el1_da+0x20/0x8c
[ 1025.321362] dw_writer+0xc8/0xd0
[ 1025.321364] interrupt_transfer+0x60/0x110
[ 1025.321365] dw_spi_irq+0x48/0x70
...
Signed-off-by: wuxu.wu <wuxu.wu@huawei.com>
Link: https://lore.kernel.org/r/1577849981-31489-1-git-send-email-wuxu.wu@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 17:27:32 +09:00
..
2023-05-15 17:26:56 +09:00
2018-05-01 15:13:08 -07:00
2023-05-12 16:27:16 +09:00
2023-05-15 17:13:36 +09:00
2023-05-15 17:15:00 +09:00
2023-05-15 16:54:12 +09:00
2018-02-13 12:35:55 +01:00
2023-05-15 16:59:30 +09:00
2023-05-15 16:46:34 +09:00
2023-05-15 17:09:22 +09:00
2023-05-15 16:30:44 +09:00
2023-05-15 17:13:43 +09:00
2023-05-15 16:21:24 +09:00
2023-05-15 17:23:32 +09:00
2023-05-15 17:16:04 +09:00
2023-05-15 16:44:14 +09:00
2023-05-15 17:14:58 +09:00
2023-05-15 16:16:30 +09:00
2023-05-15 17:22:28 +09:00
2018-02-28 10:18:33 +01:00
2023-05-15 16:58:51 +09:00
2023-05-15 17:24:50 +09:00
2023-05-15 16:17:55 +09:00
2023-05-15 16:19:29 +09:00
2023-05-15 16:18:43 +09:00
2023-05-15 16:31:00 +09:00
2023-05-15 17:09:42 +09:00
2023-05-15 17:15:47 +09:00
2023-05-15 17:25:21 +09:00
2022-03-15 09:20:56 +09:00
2023-05-15 17:10:20 +09:00
2018-03-24 11:00:12 +01:00
2023-05-15 10:45:29 +09:00
2023-05-15 17:24:21 +09:00
2023-05-15 17:11:00 +09:00
2023-05-15 17:13:48 +09:00
2023-05-15 16:59:25 +09:00
2023-05-15 12:46:28 +09:00
2023-05-15 17:25:26 +09:00
2023-05-15 17:27:12 +09:00
2023-05-15 17:14:55 +09:00
2023-05-15 17:24:46 +09:00
2023-05-15 17:14:23 +09:00
2023-05-15 16:15:52 +09:00
2023-05-15 14:32:51 +09:00
2023-05-15 15:17:44 +09:00
2023-05-15 14:08:07 +09:00
2017-09-09 17:39:41 +02:00
2023-05-15 17:24:43 +09:00
2023-05-15 17:14:17 +09:00
2023-05-15 12:52:51 +09:00
2023-05-15 14:51:01 +09:00
2023-05-15 16:35:04 +09:00
2023-05-15 17:15:11 +09:00
2023-05-15 17:15:09 +09:00
2023-05-15 17:10:56 +09:00
2023-05-15 17:24:06 +09:00
2023-05-15 17:27:29 +09:00
2023-05-15 17:11:24 +09:00
2023-05-15 15:18:34 +09:00
2023-05-15 17:16:18 +09:00
2023-05-15 16:46:52 +09:00
2023-05-15 15:08:54 +09:00
2023-05-15 17:16:01 +09:00
2023-05-15 14:34:33 +09:00
2023-05-15 16:19:36 +09:00
2023-05-15 17:22:47 +09:00
2023-05-15 09:18:55 +09:00
2023-05-15 14:09:37 +09:00
2023-05-15 15:10:20 +09:00
2023-05-15 16:58:52 +09:00
2023-05-15 16:47:13 +09:00
2023-05-15 17:16:03 +09:00
2023-05-15 12:46:28 +09:00
2023-05-15 14:08:51 +09:00
2023-05-15 17:27:25 +09:00
2023-05-15 17:22:46 +09:00
2023-05-15 16:44:23 +09:00
2023-05-15 16:58:29 +09:00
2023-05-15 17:23:50 +09:00
2023-05-15 15:12:21 +09:00
2023-05-15 09:23:11 +09:00
2023-05-15 17:15:54 +09:00
2023-05-15 17:22:43 +09:00
2023-05-15 10:37:00 +09:00
2023-05-15 17:27:31 +09:00
2023-05-15 17:15:58 +09:00
2023-05-15 17:27:32 +09:00
2017-07-27 15:08:08 -07:00
2023-05-15 12:59:29 +09:00
2023-05-15 17:23:46 +09:00
2023-05-15 17:24:14 +09:00
2023-05-15 09:23:01 +09:00
2020-02-04 13:48:58 +09:00
2023-05-15 16:45:24 +09:00
2023-05-15 14:55:28 +09:00
2023-05-15 17:23:37 +09:00
2023-05-15 16:58:17 +09:00
2023-05-15 17:26:59 +09:00
2023-05-15 08:28:33 +09:00
2023-05-15 17:24:45 +09:00
2023-05-15 17:25:24 +09:00
2023-05-15 17:16:20 +09:00
2023-05-15 12:50:46 +09:00
2023-05-15 16:16:07 +09:00
2023-05-15 16:59:11 +09:00
2023-05-15 13:00:07 +09:00
2023-05-15 17:22:31 +09:00
2023-05-15 17:24:18 +09:00
2018-05-30 07:50:44 +02:00
2019-12-11 18:21:09 +09:00
2019-12-11 18:21:09 +09:00