linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: "krumboeck@universalnet.at" <krumboeck@universalnet.at>
Cc: linux-can@vger.kernel.org, info@gerhard-bertelsmann.de,
	gediminas@8devices.com
Subject: Re: [PATCH] usb2can: Add support for USB2CAN interface from 8 devices
Date: Mon, 03 Dec 2012 08:26:04 +0100	[thread overview]
Message-ID: <50BC540C.4040800@grandegger.com> (raw)
In-Reply-To: <50BBF5CA.500@universalnet.at>

On 12/03/2012 01:43 AM, krumboeck@universalnet.at wrote:
> Am 2012-12-02 14:35, schrieb Wolfgang Grandegger:
>> Hi Bernd,
>>
>> nice to see this driver being pushed mainline. As Oliver already pointed
>> out, there are a few general naming and coding style issues:
>>
>> - The preferred multi line comment styles is:
>>
>>    /*
>>     * A Comment
>>     */
> 
> The Script checkpatch.pl didn't like this comment style. I'll change it
> again.

I'm confused. Could you please show the comment and the checkpatch.pl
message. I hope it does not argue against:

http://lxr.linux.no/#linux+v3.6.8/Documentation/CodingStyle#L446

>>
>> - The patch does not yet apply to David Millers "net-next" GIT tree.
>>    There are problems with Kconfig and Makefile.
> 
> I assume this is the right command and repository url:
> git clone
> "http://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git"
> 
>>
>> Could you please show the output of "candump -e any,0:0,#FFFFFFFF" when
>> the device goes 1) error passive and 2) bus-off. You could provoke
>> these states by 1) sending without connection to the bus or 2)
>> short-circuiting CAN high and low.
> 
> bek@debian:~/software/socketcan/trunk/can-utils$ ./candump -e
> any,0:0,#FFFFFFFF
>   can0  20000088  [8] 00 00 04 00 00 00 00 01   ERRORFRAME
>         protocol-violation{{bit-stuffing-error}{}}
>         bus-error
>         error-counter-tx-rx{{0}{1}}
>   can0  2000008C  [8] 00 04 00 00 00 00 00 63   ERRORFRAME
>         controller-problem{rx-error-warning}
>         protocol-violation{{}{}}
>         bus-error
>         error-counter-tx-rx{{0}{99}}
>   can0  2000008C  [8] 00 10 00 00 00 00 00 7F   ERRORFRAME
>         controller-problem{rx-error-passive}
>         protocol-violation{{}{}}
>         bus-error
>         error-counter-tx-rx{{0}{127}}

The last two messages just seem to be "controller-problem". You should
drop the "bus-error" and "protocol-violation" bits then.

>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03
>   can0  500  [4] 00 01 02 03

These messages should up after reconnecting the cable?

> In my tests I was not able to provoke "bus-off".


Even by short-circuiting CAN high and low while sending messages out to
the bus? This should always work.

> One of the tests from Gerd provoked "bus-off":
>   can0  12345678  [8] 55 55 55 55 33 33 33 33
>   can0  20000088  [8] 00 00 90 00 00 00 10 00   ERRORFRAME

BUSERROR, PROT, PROT_BIT1, PROT_TX

>   can0  2000008C  [8] 00 08 00 00 00 00 68 00   ERRORFRAME

BUSERROR, PROT, CTRL, TX_WARNING

>   can0  2000008C  [8] 00 20 00 00 00 00 88 00   ERRORFRAME

BUSERROR, PROT, CTRL, TX_PASSIVE

>   can0  20000040  [8] 00 00 00 00 00 00 F8 00   ERRORFRAME

BUS-OFF

>> Another question: is it possible to switch off bus-error reporting?
> 
> No. At least I didn't found anything in the firmware.
> 
> 
>>> +
>>> +/* Send data to device */
>>> +static netdev_tx_t usb2can_start_xmit(struct sk_buff *skb,
>>> +                      struct net_device *netdev)
>>> +{
>>> +    struct usb2can *dev = netdev_priv(netdev);
>>> +    struct net_device_stats *stats = &netdev->stats;
>>> +    struct can_frame *cf = (struct can_frame *)skb->data;
>>
>> Is the cast needed?
> 
> Yes.
> 
>>
>> The driver does collect similar statistics and therefore I do not see a
>> need for these sysfs files... apart from printing the firmware version
>> when the device is probed. BTW: what is "show_hardware" good for?
>>
> 
> I don't exactly know, but I assume it is the hardware revision.

OK, I think it shouöd be fine if it's printed when the device is probed.

Wolfgang.


  reply	other threads:[~2012-12-03  7:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02  9:25 [PATCH] usb2can: Add support for USB2CAN interface from 8 devices krumboeck
2012-12-02 10:36 ` Oliver Hartkopp
2012-12-02 11:45   ` Kurt Van Dijck
2012-12-02 13:35 ` Wolfgang Grandegger
2012-12-03  0:43   ` krumboeck
2012-12-03  7:26     ` Wolfgang Grandegger [this message]
     [not found]       ` <50BCF810.6060108@universalnet.at>
2012-12-03 20:12         ` Wolfgang Grandegger
2012-12-03 20:41       ` krumboeck
2012-12-03  8:15     ` Wolfgang Grandegger
  -- strict thread matches above, loose matches on Subject: below --
2012-12-13  7:44 "Bernd Krumböck"

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=50BC540C.4040800@grandegger.com \
    --to=wg@grandegger.com \
    --cc=gediminas@8devices.com \
    --cc=info@gerhard-bertelsmann.de \
    --cc=krumboeck@universalnet.at \
    --cc=linux-can@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).