Hello Pavel Chubakov,
Thanks for your reply. We have checked, CAN controller is not in BUS_OFF State or any error condition, still observed this behavior.
In our design we have connected two CAN controller [ T1042 <=====via SPI=========> MCP2515 ] and IRQ2 and IRQ3 pin of the T1042 used to receive the interrupts.
our dts file:
soc: soc@ffe000000 {
spi@110000 {
can1: can1@1 {
compatible = "microchip,mcp2515";
spi-max-frequency = <10000000>; /* input clock */
reg = <1>;
clocks = <&clk24m>;
interrupts = <3 0x2 0 0>;
};
can0: can0@0 {
compatible = "microchip,mcp2515";
spi-max-frequency = <10000000>; /* input clock */
reg = <0>;
clocks = <&clk24m>;
interrupts = <2 0x2 0 0>;
};
Driver probing working fine. Functional mechanism working fine. But after some time oberving the issue.i.e really strange.
In current debugging of the driver, saw the interrupt received continuasly and isr routine executing. But in the error case, stops receiving the interrupts. in /proc/interrupt interrupt counter stops.
# cat /proc/interrrupts
19: 2 1 2 21722 OpenPIC 2 Edge mcp251x
when saw the interrupt pin(INT) on the oscilloscope,not seen any activity on the INT pin.
:~ # ls -al /sys/class/net/can*
lrwxrwxrwx 1 root root 0 Jul 27 16:00 /sys/class/net/can0 -> ../../devices/platform/ffe000000.soc/ffe110000.spi/spi_master/spi32766/spi32766.1/net/can0
lrwxrwxrwx 1 root root 0 Jul 27 16:00 /sys/class/net/can1 -> ../../devices/platform/ffe000000.soc/ffe110000.spi/spi_master/spi32766/spi32766.0/net/ca
In the driver/net/can/spi/mcp251x.c, only for the debug purpose, added following lines, really interrupt coming or not.
static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
{
struct mcp251x_priv *priv = dev_id;
struct spi_device *spi = priv->spi;
struct net_device *net = priv->net;
u8 intf, eflag;
#ifdef CAN_DEBUG
printk("*");
mutex_lock(&priv->mcp_lock);
mcp251x_read_2regs(spi, CANINTF, &intf, &eflag);
printk("[%x] [%x] \n", intf, eflag);
mcp251x_write_bits(spi, CANINTF, CANINTF_RX0IF, 0x00);
mcp251x_write_bits(spi, CANINTF, CANINTF_RX1IF, 0x00);
mcp251x_write_bits(spi, CANINTF, CANINTF_ERR, 0x00);
mutex_unlock(&priv->mcp_lock);
return IRQ_HANDLED;
#endif
Here, as ouput after sometime , ISR not execute, i.e interrupt not receive.
Now why this interrupt is not generated by the MCP2515? Any clue or Can you guide in which area , we need to check?
Thanks for your support.
Regards,
Surendra