AnsweredAssumed Answered

RE: AD9122 and possibly others broken

Question asked by EdwardK on Aug 13, 2015
Latest reply on Aug 27, 2015 by ribalda

1) A feature sha1 22417352f6b7f623495cc426680de75d725197df "Use polling mode on small transfers" was introduced into the tree. I have a lot of spidev gadgets in user space and that patch completely broke it to where the spidev driver crashed. Refer to Has anyone found a solution to SPI driver crashes? Specifically spidev on top of spi-xilinx. Note the ad9122 module loaded without issue.


2) I worked with the developer and he came up with a couple of patches sha1 557f95ff2e2f06434e600fa7bc756aca2b640461 and 540b9b1804812d0ec55062c11cd6819a0a7a6db0. Naturally I only tested accessing spidev's from userland and the patches were both required to fix the crash at spi-xilinx.c:147 if (!xspi->rx_ptr) ...


3) My project uses both and ADF4350 and an ADF5355. I loaded those modules and they work.


4) Today I tried loading the ad9122 module and it is now crashing at spi-xilinx.c:147 if (!xspi->rx_ptr) ... If I reverse the commits in 2) ad9122 module is able to load without crashing but then I am back at 1) with transfers via spidev causing the kernel to hang.


5) Crash

Internal error: : 1406 [#1] PREEMPT SMP ARM                                                                                                      

Modules linked in: ad9122(+) adf5355 spi_xilinx                                                                                                  

CPU: 1 PID: 1945 Comm: insmod Not tainted 4.0.0-xilinx-adi-ga1b3ecd-dirty #3                                                                     

Hardware name: Xilinx Zynq Platform                                                                                                              

task: ee9a3440 ti: ee356000 task.ti: ee356000                                                                                                    

PC is at xspi_read32+0x8/0x10 [spi_xilinx]                                                                                                       

LR is at xilinx_spi_txrx_bufs+0x170/0x270 [spi_xilinx]                                                                                           

pc : [<bf000038>]    lr : [<bf000364>]    psr: 200e0013                                                                                          

sp : ee357ba0  ip : 00000000  fp : 00000000                                                                                                      

r10: ee357ca8  r9 : 00000000  r8 : 00000000                                                                                                      

r7 : 00000001  r6 : 00000001  r5 : 00000001  r4 : eeac2a68                                                                                       

r3 : 000000ff  r2 : 00000730  r1 : 00000001  r0 : f024006c                                                                                       

Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user                                                                                

Control: 18c5387d  Table: 2e38804a  DAC: 00000015                                                                                                

Process insmod (pid: 1945, stack limit = 0xee356210)


[<bf000038>] (xspi_read32 [spi_xilinx]) from [<bf000364>] (xilinx_spi_txrx_bufs+0x170/0x270 [spi_xilinx])

[<bf000364>] (xilinx_spi_txrx_bufs [spi_xilinx]) from [<c034c82c>] (spi_bitbang_transfer_one+0x9c/0x240)

[<c034c82c>] (spi_bitbang_transfer_one) from [<c034a7f4>] (__spi_pump_messages+0x37c/0x4cc)

[<c034a7f4>] (__spi_pump_messages) from [<c034aab4>] (__spi_sync+0x164/0x178)

[<c034aab4>] (__spi_sync) from [<c034ab9c>] (spi_write_then_read+0xc4/0x178)

[<c034ab9c>] (spi_write_then_read) from [<bf00a384>] (ad9122_read+0x28/0x38 [ad9122])

[<bf00a384>] (ad9122_read [ad9122]) from [<bf00aa5c>] (ad9122_probe+0xb8/0x3dc [ad9122])

[<bf00aa5c>] (ad9122_probe [ad9122]) from [<c03492f0>] (spi_drv_probe+0x50/0x74)



Any ideas are welcome maybe its obvious and I just can't see it.