-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAN-USB device stop working after 10 xmit fails #187
Comments
That doesn't sound good. My gut feeling says the UCAN has a serious problem. Can you add the following patch to the kernel and reproduce the problem? Then we should have some more debug output. diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index bc86e9b329fd..46d6fa5c630e 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -752,7 +752,8 @@ static void gs_usb_xmit_callback(struct urb *urb)
struct net_device *netdev = dev->netdev;
if (urb->status)
- netdev_info(netdev, "usb xmit fail %u\n", txc->echo_id);
+ netdev_info(netdev, "error %pe: usb xmit fail %u\n",
+ ERR_PTR(urb->status), txc->echo_id);
}
static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, You can try to recover with bringing the interface down and up again: ip link set dev can0 down
ip link set dev can0 up This sends USB control messages, maybe these are still properly handled. Otherwise you can try to disable/enable the USB port with something like this (edit: fixed access of disable=$(realpath /sys/class/net/can0/device/../port/disable)
echo 1 > ${disable}
echo 0 > ${disable} |
Also post version information of your firmware build (somwhere in lsusb -v ouput) |
Thank you for reply!
brings can0 down, but it can't go up after that:
ifconfig before and after "down":
Hope it will help. Will fix gs_usb.c print, but it will take some time to reproduce the problem. lsusb -v output:
Can't find
where should I look next? |
yeah, UCAN firmware based on this commit:
|
Thanks.
So, there is no way for me of knowing if:
You will need to try a current firmware build, from this repo, otherwise there's no point in trying to analyze the situation. |
hmm, that strange. It could be that I flashed one UCAN adapter and plugged the other one. Will check it. |
yeah, in my version.h file I see this:
will check, why it's not in iConfiguration |
I think this isn't needed anymore, if interface down, interface up doesn't help, the patch will not bring any new information. |
Sorry, I was dazed and confused and used wrong disable=$(realpath /sys/class/net/can0/device/../port/disable)
echo 1 > ${disable}
echo 0 > ${disable} Or do it step by step: $ realpath /sys/class/net/can0/device/../port/disable
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0/usb2-port2/disable
$ echo 1 > /sys/devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0/usb2-port2/disable
$ echo 0 > /sys/devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0/usb2-port2/disable Does this work? |
Hi! disable don't work:
I'm under root
|
The left side of the echo 1 | sudo tee ${disable} |
I accidently broke usb. First sent
and can0 interface disappear from ifconfig list, but device still was in lsusb
and ucan disappear from lsusb too |
What's the Please use |
|
You can try to use https://github.com/mvp/uhubctl. I think it does the same in the background. I however didn't manage to completely power down the USB port on any of my hubs. |
Hi!
Currently can't access to CAN-USB adapter that stuck. It looks like it has old firmware, maybe it's not UCAN at all (probably CANable). But I have seen same problem with UCAN and new firmware, so I will replace it and continue search. Testing anothe adapter. Checked lsusb -v with another my UCAN adapter, and it shows:
fanfact, if run lsusb without sudo, it shows only
Spent some hours debugging adapter to find what's going on. Next time I catch problem, I will try
Is there anyway to send some magic command via USB to CAN-adapter so it's firmware could catch it and reboot? Or Linux machine will not gonna try to reconnect to it until manually re plug adapter? |
Ah yes, I could have mentioned that, sorry. Depending on your udev rules etc sometimes those extra queries need root perms.
|
Hi
I have UCAN adapter with candleLight firmware. After some time it stop working - don't read or write CAN messages, and LED is constantly on. I use device for C++ app on linux with socket API. Unplug USB device solve the problem, but I want to know the proper way to handle this without reinserting device. What commands should I send to device to make it work again?
The text was updated successfully, but these errors were encountered: