Maybe the info below isn't need if we think it's the one-shot-mode, but here
it is anyway.

thanks,
Paul

On Sun, Jan 31, 2010 at 11:59 PM, christian pellegrin <[email protected]>wrote:

> Hi,
>
> On Sun, Jan 31, 2010 at 11:03 PM, Paul Thomas <[email protected]>
> wrote:
> > I've been using the mcp251x driver, and I'm getting a "write: No buffer
> > space available" error. That is what cansend prints after I get into this
> > state. I have a user space program that is reading and writing about 20
> time
> > a second.
> >
>
> this may mean that somehow the tx queue is stopped and not restarted.
> I never seen this even under heavy traffic and bus disconneting /
> short-circuiting. If this happened only with new versions it could
> mean that the the elimination of the MERR interrupt could cause
> problems but you said you see it even with the old version (just check
> that in the old version you are using there is MERR handled in the
> interrupt workqueue and activated in mcp251x_set_normal_mode).
>
> Do you continue to see this problem if you stop all the programs that
> write to CAN and just do a "cansend can0 123#abcd"? The other end
> isn't receiving packets (I mean there is no activity on the CAN bus)?
> Is there a flow of packetes the other way or it's stopped to?
>
> >
> > Is there some way to purge/flush the buffer? Is there some other work
> around
> > sort of reloading the module?
> >
>
> well let's fix it and not work around it! ;-) Can you give me some
> more information about the state of when this happens? For example,
> can statistics:
>
> cat /sys/bus/spi/drivers/mcp251x/spi0.?/net\:can0/statistics/*
>
0
0
2552
0
0
0
0
0
0
0
0
0
319
0
2552
0
0
0
0
0
0
319
0



>
> and what ip thinks of interface status:
>
> ip -details -statistics link show can0
>

17: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN
qlen 10
    link/can
    can <8> state ERROR-ACTIVE restart-ms 0
    bitrate 500000 sample-point 0.850
    tq 100 prop-seg 8 phase-seg1 8 phase-seg2 3 sjw 1
    mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
    clock 10000000
    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
    2552       319      0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    2552       319      0       0       0       0



>
> Another thing that can give such kind of problems is interrupt wiring:
> aren't you sharing interrupts, are you?
>
> Initially I was planning to, but each device has a dedicated interrupt now.


> Can you try if triggering a bus-off condition takes you out of this
> situation? I mean just short-circuit the CAN bus, the ip command above
> will say you "can state BUS-OFF" and the you can do "ip link set can0
> type can restart". What is strange is that you say that disconnecting
> and reconnecting the bus works: the bus should go in ERROR PASSIVE
> state and there is no netif_wake_queue when coming back from it.
>
> The "can restart" does not fix this

> Thanks for your help.
>
> --
> Christian Pellegrin, see http://www.evolware.org/chri/
> "Real Programmers don't play tennis, or any other sport which requires
> you to change clothes. Mountain climbing is OK, and Real Programmers
> wear their climbing boots to work in case a mountain should suddenly
> spring up in the middle of the computer room."
>
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to