Kernel 3.14, CAN state issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kernel 3.14, CAN state issue

984 Views
angelo_d
Senior Contributor I

Dear all,

i have a brief question:

Using kernel 3.14 on a similar sabreauto board, with "ip addr show" after first boot i see

2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10

    link/can

This is correct when there is not CAN communication.

bash-3.2# ip link set can0 type can bitrate 1000000 triple-sampling on

bash-3.2# ip addr show   

2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10

    link/can

bash-3.2# ip link set can0 up

2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10

    link/can

As you can see, after set to "up", final state is UNKNOWN.

It stays UNKNOWN also while communicating. Communication with remote host BTW works.

Is this UNKNOWN state a signal i set up something wrong in the kernel ? Do i have to worry about ?

Thanks

angelo

Labels (2)
0 Kudos
4 Replies

705 Views
angelo_d
Senior Contributor I

Hi Alejandro,

thanks,

this is what i get:

bash-3.2# ip -s -d link show can0

2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10

    link/can

    can <TRIPLE-SAMPLING> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0

    bitrate 1000000 sample-point 0.733

    tq 66 prop-seg 5 phase-seg1 5 phase-seg2 4 sjw 1

    flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1

    clock 30000000

    re-started bus-errors arbit-lost error-warn error-pass bus-off

    0          0          0          0          0          0        

    RX: bytes  packets  errors  dropped overrun mcast  

    0          0        0       0       0       0     

    TX: bytes  packets  errors  dropped carrier collsns

    0          0        0       0       0       0

0 Kudos

705 Views
alejandrolozan1
NXP Employee
NXP Employee

As far as I see the state that you should take care of is the ERROR-ACTIVE. The UNKNOWN should not affect the FlexCAN driver behavoior.

/Alejandro

0 Kudos

705 Views
angelo_d
Senior Contributor I

as far as i understand from kernel code,

it should be ok,

IF_OPER_UNKNOWN is the default state, and it stays the same for all net drivers that don't implement the oper state change. I don't see in flexcan.c any attempt to set the dev->operstate.

Hope some Freescale expert can confirm this.

Best regards

Angelo

0 Kudos

705 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I have worked with FlexCAN but I am not an expert with network drivers, but after looking at the references you have done; it seesm you are correct.

If you do the next:

ip -s -d link show can0

You should get more info about the CAN module state, like if either is in error active or passive mode.

/Alejandro

0 Kudos