Skip to contentSkip to conversation

can: mcp25xfd: interrupt not setup

net Marc Kleine-Budde 1 participant 1 message Nov 27, 2020 1 message not in the archive CAN network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Marc Kleine-Budde

author maintainer
#1 lore raw
Quoted 30 lines · petter

Hi Folks,

The original problem I am coming from:

		root@cl-debian:~# dmesg | grep MCP
	[    7.512119] mcp251xfd spi1.0 can2: MCP2518FD rev0.0 (-RX_INT 
-MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:40.00MHz m:10.00MHz 
r:10.00MHz e:0.00MHz) successfully 					initialized.
		root@PHYBOX3-206471:~# ip link set can2 type can bitrate 500000 
dbitrate 2000000 fd on
		root@PHYBOX3-206471:~# ip link set can2 up
		root@PHYBOX3-206471:~#

candump / cansniffer did not show any traffic cansend will sent messages (only 4 after down/up
interface visible on scope) and after >20 messages there was an error "write: No buffer space available"

Monitoring the INT line I can see after down/up the interface a high on INT and e.g. after first packet is received the INT goes low but never came high again.
The mcp251xfd_irq was never called (checked with a printk) which in turn never clears the interrupt.

The only thing I found out that a cat on debug/gpio did not list the gpio.

A CD from the SD card interface, which have quite the same functionality is listed here:
gpio-128 ( |cd ) in hi IRQ ACTIVE LOW

Quoted 7 lines

since this is defined in the DT under &usdhc1

	cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;

My expectation is that (or interrupt-parent, interrupts)

	interrupts-extended = <&gpio3 0 GPIO_ACTIVE_LOW>;

will do the magic here and I should see the IRQ ACTIVE LOW for that pin in debug/gpio

Have a look at the bindings example:

https://elixir.bootlin.com/linux/v5.10-rc5/source/Documentation/devicetree/bindings/net/can/microchip,mcp251xfd.yaml#L74

It's "IRQ_TYPE_LEVEL_LOW" not "GPIO_ACTIVE_LOW"

Quoted 4 lines

Did I miss something ?

Nevertheless I would request a pre-check that checks if the interrupt is triggered.

Marc

Signature · 4 lines
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 |