On Fri, 10 Jan 2025 10:50:10 +0300, Alexander Shiyan wrote: > When a driver does not support transfer() call, such as most QSPI drivers, > calling spi_sync() (e.g. with the "spi" command) will cause the system > to hang. Fix this by adding a function check. > > barebox@Mega-Milas Informer SAMA5D2:/ spi -b 1 -c 0 0xaa > prefetch abort > pc : [<00000004>] lr : [<27e266a4>] > sp : 27ff7c78 ip : 27ff7ce8 fp : 27e87410 > r10: 27ff7d20 r9 : 00000000 r8 : 23f58128 > r7 : 23f33c30 r6 : 27ff7c90 r5 : 27ff7d20 r4 : 27ff7c7c > r3 : 00000000 r2 : 27ff7cc4 r1 : 27ff7c90 r0 : 27ff7d20 > Flags: nzCv IRQs off FIQs off Mode SVC_32 > [<27e266a4>] (spi_sync+0xc8/0xdc) from [<27e2675c>] (spi_write_then_read+0xa4/0xac) > [<27e2675c>] (spi_write_then_read+0xa4/0xac) from [<27e438e4>] (do_spi+0x288/0x3e8) > [<27e438e4>] (do_spi+0x288/0x3e8) from [<27e05c38>] (execute_command+0x3c/0x80) > [<27e05c38>] (execute_command+0x3c/0x80) from [<27e0ee48>] (run_list_real+0x9a8/0xad8) > [<27e0ee48>] (run_list_real+0x9a8/0xad8) from [<27e0e2b4>] (parse_stream_outer+0x138/0x200) > [<27e0e2b4>] (parse_stream_outer+0x138/0x200) from [<27e0f180>] (run_shell+0x5c/0x90) > [<27e0f180>] (run_shell+0x5c/0x90) from [<27e018b4>] (run_init+0x108/0x288) > [<27e018b4>] (run_init+0x108/0x288) from [<27e01a8c>] (start_barebox+0x58/0xb4) > [<27e01a8c>] (start_barebox+0x58/0xb4) from [<27e5ee18>] (barebox_non_pbl_start+0xc8/0xe0) > [<27e5ee18>] (barebox_non_pbl_start+0xc8/0xe0) from [<27e00004>] (__bare_init_start+0x0/0x10) > > [...] Applied, thanks! [1/1] spi: Fix hang on spi_sync() when driver does not support transfer() call https://git.pengutronix.de/cgit/barebox/commit/?id=0b1be52382e9 (link may not be stable) Best regards, -- Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>