This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am4372 spi irq problem

Other Parts Discussed in Thread: AM4372

Hello everyone.

I have such device tree config for SPI 1.

am4372.dtsi:

spi1: spi@481a0000 {
	compatible = "ti,am4372-mcspi","ti,omap4-mcspi";
	reg = <0x481a0000 0x400>;
	interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
	ti,hwmods = "spi1";
	#address-cells = <1>;
	#size-cells = <0>;
	#status = "disabled";
	status = "okay";
};

am437x-cm-t43.dts:

spi1_pins_default: spi1_pins_default {
	pinctrl-single,pins = <
		0x164 ( PIN_INPUT_PULLUP | MUX_MODE4 ) /* (G24) eCAP0_in_PWM0_out.spi1_sclk */
		0x168 ( PIN_OUTPUT_PULLUP | MUX_MODE4 ) /* (L25) uart0_ctsn.spi1_d0 */
		0x16c ( PIN_INPUT_PULLUP | MUX_MODE4 ) /* (J25) uart0_rtsn.spi1_d1 */
		0x178 ( PIN_OUTPUT_PULLUP | MUX_MODE4 ) /* (K22) uart1_ctsn.spi1_cs0 */
		0x270 ( PIN_OUTPUT_PULLUP | MUX_MODE4 ) /* (D24) xdma_event_intr0.spi1_cs1 */
	>;
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&spi1_pins_default>;
        spidev@0 {
                compatible = "rohm,dh2228fv";
                spi-max-frequency = <48000000>;
                reg = <0x0>;
                status = "okay";
        };
};

When i'm running spidev_test (MOSI and MISO are connected) I see  such error:

root@cm-t43:~# ./spidev_test -D /dev/spidev2.0 
[  112.450725] ------------[ cut here ]------------
[  112.455632] WARNING: CPU: 0 PID: 725 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x220/0x348()
[  112.465609] 44000000.ocp:L3 Custom Error: MASTER M2 (64-bit) TARGET L4_PER_0 (Idle): Data Access in Supervisor mode during Functional access
[  112.478879] Modules linked in:
[  112.482102] CPU: 0 PID: 725 Comm: spidev_test Not tainted 4.2.0-cm-t43-4 #2
[  112.489427] Hardware name: Generic AM43 (Flattened Device Tree)
[  112.495693] [<c0016044>] (unwind_backtrace) from [<c00129a0>] (show_stack+0x10/0x14)
[  112.503857] [<c00129a0>] (show_stack) from [<c05ab008>] (dump_stack+0x80/0xcc)
[  112.511465] [<c05ab008>] (dump_stack) from [<c00357f8>] (warn_slowpath_common+0x78/0xb4)
[  112.519984] [<c00357f8>] (warn_slowpath_common) from [<c00358c8>] (warn_slowpath_fmt+0x30/0x40)
[  112.529148] [<c00358c8>] (warn_slowpath_fmt) from [<c02f6f98>] (l3_interrupt_handler+0x220/0x348)
[  112.538502] [<c02f6f98>] (l3_interrupt_handler) from [<c0071c9c>] (handle_irq_event_percpu+0x5c/0x284)
[  112.548303] [<c0071c9c>] (handle_irq_event_percpu) from [<c0071f04>] (handle_irq_event+0x40/0x64)
[  112.557651] [<c0071f04>] (handle_irq_event) from [<c0074ccc>] (handle_fasteoi_irq+0xb4/0x18c)
[  112.566629] [<c0074ccc>] (handle_fasteoi_irq) from [<c00715c8>] (generic_handle_irq+0x20/0x30)
[  112.575699] [<c00715c8>] (generic_handle_irq) from [<c00716c4>] (__handle_domain_irq+0x54/0xb4)
[  112.584860] [<c00716c4>] (__handle_domain_irq) from [<c000948c>] (gic_handle_irq+0x20/0x5c)
[  112.593664] [<c000948c>] (gic_handle_irq) from [<c05b03c0>] (__irq_svc+0x40/0x74)
[  112.601541] Exception stack(0xee63de40 to 0xee63de88)
[  112.606860] de40: ee3b1400 00000001 200103c0 c03ebc58 ee3b1400 00000000 00000000 00000000
[  112.615468] de60: ee3b9c14 ee63c000 ee3b7c78 000112fe 00000003 ee63de88 c03e7358 c03ebc58
[  112.624078] de80: a0000013 ffffffff
[  112.627753] [<c05b03c0>] (__irq_svc) from [<c03ebc58>] (omap2_mcspi_setup+0x0/0x284)
[  112.635906] [<c03ebc58>] (omap2_mcspi_setup) from [<00000003>] (0x3)
[  112.642594] ---[ end trace a353ec7493605ee6 ]---
[  112.647843] Unhandled fault: imprecise external abort (0x1406) at 0x4624c384
[  112.655267] pgd = ed194000
[  112.658113] [4624c384] *pgd=ae6eb831, *pte=8097c18f, *ppte=8097ca3e
[  112.665069] spidev spi2.0: not using DMA for McSPI
[  112.670225] spidev spi2.0: not using DMA for McSPI
[  112.675373] spidev spi2.0: not using DMA for McSPI
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

00 00 00 00 00 00 
00 00 00 00 00 00 
00 00 00 00 00 00 
00 00 00 00 00 00 
00 00 00 00 00 00 
00 00 00 00 00 00 
00 00 

I can see MOSI and SCLK signals with oscilloscope. I think that this is a RX side IRQ problem.  Can anybody help with this?

My kernel:

root@cm-t43:~# uname -a
Linux cm-t43 4.2.0-cm-t43-4 #2 SMP PREEMPT Mon Aug 22 09:25:52 EDT 2016 armv7l GNU/Linux

Interrupts:

root@cm-t43:~# cat /proc/interrupts 
           CPU0       
 16:       2884     WUGEN  68 Level     gp_timer
 18:          1     WUGEN   9 Level     l3-dbg-irq
 19:          1     WUGEN  10 Level     l3-app-irq
 20:       1905     WUGEN  12 Level     edma
 22:         29     WUGEN  14 Level     edma_error
 23:        560     WUGEN  72 Level     OMAP UART0
180:        537  48320000.gpio  19 Edge      47810000.mmc
226:         68     WUGEN  70 Level     44e0b000.i2c
227:          0     WUGEN  71 Level     4802a000.i2c
229:       5896     WUGEN  28 Level     mmc0
230:        342     WUGEN  29 Level     mmc1
233:       6479     WUGEN  41 Level     4a100000.ethernet
234:          4     WUGEN  42 Level     4a100000.ethernet
236:          0     WUGEN  16 Level     TI-am335x-tsc
240:          0     WUGEN   4 Level     48080000.elm
241:          0     WUGEN 100 Level     gpmc
242:          5     WUGEN 172 Level     dwc3-omap
243:          5     WUGEN 178 Level     dwc3-omap
244:          0     WUGEN 168 Level     xhci-hcd:usb1
245:          0     WUGEN 174 Level     xhci-hcd:usb3
248:          0       GIC  39 Edge      tps65218
IPI0:          0  CPU wakeup interrupts
IPI1:          0  Timer broadcast interrupts
IPI2:          0  Rescheduling interrupts
IPI3:          0  Function call interrupts
IPI4:          0  Single function call interrupts
IPI5:          0  CPU stop interrupts
IPI6:          0  IRQ work interrupts
IPI7:          0  completion interrupts
Err:          0

Max.