On 24.05.2022 11:18:08, David Jander wrote: > This change gives a dramatic performance improvement in the hot path, > since many costly spin_lock_irqsave() calls can be avoided. > > On an i.MX8MM system with a MCP2518FD CAN controller connected via SPI, > the time the driver takes to handle interrupts, or in other words the time > the IRQ line of the CAN controller stays low is mainly dominated by the > time it takes to do 3 relatively short sync SPI transfers. The effect of > this patch is a reduction of this time from 136us down to only 98us. > > Suggested-by: Andrew Lunn <andrew@xxxxxxx> > Signed-off-by: David Jander <david@xxxxxxxxxxx> This patch (cherry picked on top of v5.19-rc1) explodes on 32-bit SMP ARMv7 (imx6q) with: | [ 0.397493] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 | [ 0.397514] caller is debug_smp_processor_id+0x18/0x24 | [ 0.397544] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc1-00001-g6ae0aec8a366 #181 | [ 0.397559] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) | [ 0.397566] Backtrace: | [ 0.397576] dump_backtrace from show_stack+0x20/0x24 | [ 0.397616] r7:81024ffd r6:00000000 r5:81024ffd r4:60000013 | [ 0.397621] show_stack from dump_stack_lvl+0x60/0x78 | [ 0.397644] dump_stack_lvl from dump_stack+0x14/0x1c | [ 0.397664] r7:81024ffd r6:80f652de r5:80bec180 r4:819a2500 | [ 0.397669] dump_stack from check_preemption_disabled+0xc8/0xf0 | [ 0.397690] check_preemption_disabled from debug_smp_processor_id+0x18/0x24 | [ 0.397714] r8:8119b7e0 r7:81205534 r6:819f5c00 r5:819f4c00 r4:c083d724 | [ 0.397719] debug_smp_processor_id from __spi_sync+0x78/0x220 | [ 0.397746] __spi_sync from spi_sync+0x34/0x4c | [ 0.397772] r10:bb7bf4e0 r9:c083d724 r8:00000007 r7:81a068c0 r6:822a83c0 r5:c083d724 | [ 0.397779] r4:819f4c00 | [ 0.397784] spi_sync from spi_mem_exec_op+0x338/0x370 | [ 0.397810] r5:000000b4 r4:c083d910 | [ 0.397815] spi_mem_exec_op from spi_nor_read_id+0x98/0xdc | [ 0.397846] r10:bb7bf4e0 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:82358040 | [ 0.397852] r4:819f7c40 | [ 0.397856] spi_nor_read_id from spi_nor_detect+0x38/0x114 | [ 0.397878] r7:82358040 r6:00000000 r5:819f7c40 r4:819f7c40 | [ 0.397883] spi_nor_detect from spi_nor_scan+0x11c/0xbec | [ 0.397910] r10:bb7bf4e0 r9:00000000 r8:00000000 r7:c083da4c r6:00000000 r5:00010101 | [ 0.397916] r4:819f7c40 | [ 0.397921] spi_nor_scan from spi_nor_probe+0x10c/0x2d0 | [ 0.397946] r10:bb7bf4e0 r9:bb7bf4d0 r8:00000000 r7:819f4c00 r6:00000000 r5:00000000 | [ 0.397952] r4:819f7c40 Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature