All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Gediminas Simanskis <gediminas@rusoku.com>,
	linux-can@vger.kernel.org, info@8devices.com
Cc: Michal Sojka <michal.sojka@cvut.cz>,
	Bernd Krumboeck <b.krumboeck@gmail.com>
Subject: Re: usb_8dev - WARN_ON(in_irq())
Date: Wed, 5 Feb 2020 11:58:59 +0100	[thread overview]
Message-ID: <72ef9952-df01-aa84-a186-93d578b06818@hartkopp.net> (raw)
In-Reply-To: <03fe333a-7a7b-e9b6-fd9e-3d433c2f3cb3@rusoku.com>

Hi Gediminas,

thanks for the information!

I've put info [at] 8devices.com into the recipients list as the Linux 
driver has to do the "right thing" when it gets the "Tx URB aborted 
(-2)" information.

And so far I did not see anything like this with the old 'white' USB2CAN 
adapter with FW 1.7.

As long as we don't know how to react on this new feedback from the USB 
device, it is hard to think about a fix ...

Best regards,
Oliver


On 04/02/2020 20.54, Gediminas Simanskis wrote:
> Hi Oliver,
> 
> I remember that in some conditions usb2can began to flood with messages 
> like this (CANAL_STATUSMSG_xx).
> In normal state these messages should be disabled via init string.
> 
> I don't have acces to Korlan firmware.
> 
> Regards,
> Gediminas
> 
> On 2020-02-04 19:52, Oliver Hartkopp wrote:
>> Hello Gediminas,
>>
>> I took a look into the old firmware of the former USB_8DEV adapter 
>> with the white housing which had a CANAL_STATUSMSG_BUSLIGHT (== 0x02) 
>> return value:
>>
>> https://github.com/krumboeck/usb2can_firmware/blob/master/main.c#L227
>>
>> Is this the right place to search for the value that is checked in the 
>> kernel here:
>> https://elixir.bootlin.com/linux/v5.5.1/source/drivers/net/can/usb/usb_8dev.c#L581 
>>
>>
>> ??
>>
>> can0: Tx URB aborted (-2)
>>
>> At least the status is *only* printed in 
>> usb_8dev_write_bulk_callback() and the echo skb handling is still 
>> performed as there was a zero status (== ok?!?).
>>
>> Do you have an idea how to proceed with the driver in the case the 
>> user has the newer
>> https://www.8devices.com/products/usb2can_korlan
>> device?
>>
>> Best regards,
>> Oliver
>>
>> On 13/12/2019 18.20, Gediminas Simanskis wrote:
>>> Seems like to USB2CAN buffer overflow and firmware crashing.
>>>
>>> Gediminas
>>>
>>> On 2019-12-13 18:27, Michal Sojka wrote:
>>>> On Fri, Dec 13 2019, Michal Sojka wrote:
>>>>> Hi Oliver,
>>>>>
>>>>> On Fri, Dec 13 2019, Oliver Hartkopp wrote:
>>>>>> Did you do anything weird (e.g. pulling the USB plug on the run) 
>>>>>> to get
>>>>>> this problem?
>>>>> No, I just connected it to an ECU and started sending messages on the
>>>>> bus. The behaviour was like if the messages were not acknowledged, 
>>>>> i.e.,
>>>>> initially, candump on my laptop showed the messages sent, but after 
>>>>> some
>>>>> time (perhaps after TX buffers were full), candump stopped. I was also
>>>>> not able to see any messages sent by the ECU (both before and after I
>>>>> sent my messages).
>>>>>
>>>>> When I used the same ECU and all the wiring with peak_usb, 
>>>>> communication
>>>>> with the ECU was without any problems.
>>>> I did more investigation - I was able to fix the problem by adding a
>>>> terminator resistor to the bus.
>>>>
>>>> However, the problem can be easily reproduced by the following sequence
>>>> of commands, when the USB2CAN is not connected to any bus:
>>>>
>>>>      ip link set can0 up txqueuelen 1000 type can bitrate 500000
>>>>      candump can0
>>>>      cangen -v -g 50 can0
>>>>
>>>> when candump stops printing the messages, run:
>>>>
>>>>      ip link set down dev can0
>>>>
>>>> and the warnings appear in dmesg. I was also trying this with latest
>>>> mainline kernel, which includes the fix for use-after-free, and the
>>>> warnings are still there.
>>>>
>>>> -Michal

  reply	other threads:[~2020-02-05 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h8245gyv.fsf@steelpick.2x.cz>
     [not found] ` <7429cd37-f4dd-247c-7fa3-259801f20944@rusoku.com>
2020-02-04 17:52   ` usb_8dev - WARN_ON(in_irq()) Oliver Hartkopp
2020-02-04 19:54     ` Gediminas Simanskis
2020-02-05 10:58       ` Oliver Hartkopp [this message]
2020-03-11 19:30         ` usb_8dev - WARN_ON(in_irq()) [#00560] Oliver Hartkopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72ef9952-df01-aa84-a186-93d578b06818@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=b.krumboeck@gmail.com \
    --cc=gediminas@rusoku.com \
    --cc=info@8devices.com \
    --cc=linux-can@vger.kernel.org \
    --cc=michal.sojka@cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.