linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Zarre <info-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Cc: Oliver Hartkopp
	<socketcan-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>,
	linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
Subject: Re: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527
Date: Thu, 22 Dec 2011 14:20:04 +0100	[thread overview]
Message-ID: <4EF32E84.1080006@essax.com> (raw)
In-Reply-To: <4EF2FA3F.3010308-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

Hello Wolfgang,
> Hi Wolfgang,
>
> On 12/21/2011 07:32 PM, Wolfgang Zarre wrote:
>> Hello Wolfgang,
> ...
>
>>> It's a bug! netif_start_queue is missing at the end of the open
>>> function. Got lost some how. I have just updated (rebased!) my
>>> wg-linux-can-next repository.
>>
>> Ok, I was checking out last week and since I'm running one test series
>> after the other.
>>
>> There are several odd issues I could found and I'm trying to trace them
>> down beside some other work.
>>
>> Even with an assumed correct configuration like I was using with the lincan
>> driver I'm loosing telegrams so around 1 till 2 in 500000 but might be a
>> different sample-point at the PLC which is opaque due the predefined
>> setting.
>
> In principle, messages can be lost because the cc770 does buffer only up
> to two messages in hardware. If they are not read out quickly enough,
> message loss will happen. The CAN statistics should list such overruns,
> though.
>
Actually I loose them on transmission, not reception, but as mentioned
one time we traced with a second PC and there the telegrams are not lost
which means they are really going over the bus physically.
So maybe just a timing issue but for now secondary.

However the telegrams are sent with 5ms space parallel to the heartbeat.

>> For the next test I'll set the BTR's directly.
>
> OK, if you do not see bus errors, everything should be fine.
>

The test with BTR's set was not working out due the fact that
the software for coding the PLC doesn't allow, I'm loving it.

>> Further sometimes I can find one in dropped but mostly not.
>>
>> But more odd is that after an undefined time the transmission gets
>> stuck followed by a buffer overrun but can receive.
>
> I recently found a bug. Please try this fix:
>
> http://marc.info/?l=linux-can&m=132370253713701&w=4

The fix is already included as checked out.

>
> Did you realize related error messages in the dmesg output?

Nothing at all, as mentioned .

>
>> No error messages nor changes in ip -d -s link show can0.
>>
>> Additional it seems that neither the automatic restart nor
>> the manual one works.
>
> What version are you using. I think this problem has been fixed by
> adding the missing netif_start_queue() at the end of the open
> function, as mentioned above. Do you have that in your driver?
>

Yes, is already included as well, I'm using commit
eec921ac28fde243456078a557768808d93d94a3


>> ip link set can0 up type can restart gives me 'RTNETLINK answers: Invalid
>> argument' and ip link set can0 up type can bitrate 500000 restart a
>> RTNETLINK answers: Device or resource busy but nothing connected to can0.
>
> The error message is shown because you try to set bitrate when the
> device is up. For the restart after bus-off just type:
>
>    # ip link set can0 type can restart

Actually I tried it when it's get stuck but is anyway a hint that
the device is still up,

>
> Anyway, if you run into a bus-off, then it's likely that you have
> electrical problems on the CAN bus, e.g. termination, mismatching
> bit-timing parameters.

As said I have no indication of any kind of problem:
5: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
     link/can
     can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 2000
     bitrate 500000 sample-point 0.750
     tq 125 prop-seg 5 phase-seg1 6 phase-seg2 4 sjw 1
     cc770: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
     clock 16000000
     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
     76506      74616    0       0       0       0
     TX: bytes  packets  errors  dropped carrier collsns
     2450703    616355   0       0       0       0

>
>> So I have to perform per example  ip link set can0 down;ip link set can0 up
>> type can bitrate 500000 restart-ms 2000 sample-point 0.75
>> but this is emptying the buffer and these telegrams are lost then as well.
>>
>> I was comparing with my lincan driver which was running so far ok also
>> to confirm a proper working PLC.
>>
>> First I assumed that maybe the set_reset_mode procedure is responsible for
>> that misbehaviour because according to the cc770 manual we should wait for
>> a zero of bit 7 RstST of the CPU interface register but when the
>> transmission
>> gets stuck there was no call for set_reset_mode.
>>
>> Maybe it's ending up somehow recessive.
>>
>> Anyway, I might compare the registers of both drivers just to figure out
>> what's going on but maybe You have an idea as well.
>>
>> Problem is just it runs always quite some time until the issues happen
>> otherwise it would be more easy.
>
> Again, please check if you have netif_start_queue() at the end of the
> open function.
>

As said I'm using eec921ac28fde243456078a557768808d93d94a3

However, I'll try further to investigate that issue due the fact having it
running with my lincan without problems and therefore it should be possible
to find the problem.

> Wolfgang.

Wolfgang

  parent reply	other threads:[~2011-12-22 13:20 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25  9:43 [PATCH net-next v2 0/4] can: cc770: add support for the Bosch CC770 and Intel AN82527 Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 1/4] can: cc770: add driver core " Wolfgang Grandegger
     [not found]   ` <1322214204-1121-2-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-26 15:11     ` Oliver Hartkopp
2011-11-28 11:28   ` [Socketcan-users] " Marc Kleine-Budde
2011-11-28 13:52     ` Wolfgang Grandegger
     [not found]       ` <4ED3922A.50704-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-28 14:01         ` Marc Kleine-Budde
2011-11-28 14:01           ` [Socketcan-users] " David Laight
     [not found]           ` <4ED3941D.3070302-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 14:10             ` Wolfgang Grandegger
     [not found]               ` <4ED3966E.7080609-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-28 14:18                 ` Marc Kleine-Budde
     [not found]     ` <4ED3704D.5020903-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-29  9:20       ` Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527 Wolfgang Grandegger
     [not found]   ` <1322214204-1121-3-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-26 14:59     ` Oliver Hartkopp
2011-11-28  8:56       ` Wolfgang Zarre
2011-11-28  9:17         ` Wolfgang Grandegger
2011-11-28 12:03           ` Wolfgang Zarre
     [not found]             ` <4ED37885.8080909-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-11-28 16:06               ` Oliver Hartkopp
     [not found]                 ` <4ED3B198.2040308-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2011-11-29  9:16                   ` Wolfgang Grandegger
     [not found]                     ` <4ED4A2EC.40103-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-04 18:47                       ` Wolfgang Zarre
2011-12-04 18:56                         ` Wolfgang Grandegger
     [not found]                           ` <4EDBC25D.50405-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-06 21:08                             ` Wolfgang Zarre
     [not found]                               ` <4EDE8435.5080100-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-07 13:42                                 ` Wolfgang Grandegger
2011-12-09 10:26                                   ` Wolfgang Grandegger
2011-12-11 18:33                                     ` Wolfgang Zarre
     [not found]                                       ` <4EE4F76E.3000506-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-12  9:23                                         ` Wolfgang Grandegger
     [not found]                                           ` <4EE5C824.2050704-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-12 11:18                                             ` Wolfgang Zarre
2011-12-12 11:55                                               ` Wolfgang Grandegger
     [not found]                                                 ` <4EE5EBBF.6080007-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-21 18:32                                                   ` Wolfgang Zarre
2011-12-22  9:37                                                     ` Wolfgang Grandegger
     [not found]                                                       ` <4EF2FA3F.3010308-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-22 13:20                                                         ` Wolfgang Zarre [this message]
     [not found]                                                           ` <4EF32E84.1080006-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-31  9:39                                                             ` Wolfgang Zarre
2012-01-04 13:10                                                               ` Wolfgang Grandegger
2012-01-05  3:29                                                                 ` Wolfgang Zarre
     [not found]                                                                   ` <4F051927.8010600-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2012-01-05 11:51                                                                     ` Wolfgang Grandegger
2012-01-05 12:00                                                                       ` David Laight
2012-01-09 21:47                                                                         ` Wolfgang Zarre
2012-01-09 23:11                                                                           ` Marc Kleine-Budde
2012-01-10  9:30                                                                             ` Wolfgang Grandegger
2012-01-10 12:30                                                                               ` Wolfgang Zarre
2012-01-10 14:20                                                                                 ` Wolfgang Grandegger
2012-01-10 14:25                                                                                   ` Wolfgang Grandegger
2012-01-11  9:00                                                                                 ` Wolfgang Zarre
2012-01-11  9:37                                                                                   ` David Laight
2012-01-11 14:37                                                                                     ` Wolfgang Zarre
2012-01-11  9:38                                                                                   ` Marc Kleine-Budde
2012-01-11 14:42                                                                                     ` Wolfgang Zarre
2012-01-11 15:02                                                                                       ` Marc Kleine-Budde
2012-01-10 10:00                                                                           ` David Laight
2012-01-10 12:41                                                                             ` Wolfgang Zarre
2012-01-10 14:43                                                                               ` Wolfgang Grandegger
2012-01-10 14:50                                                                                 ` Oliver Hartkopp
2012-01-10 16:13                                                                                 ` Wolfgang Zarre
2012-01-10 16:20                                                                                   ` Marc Kleine-Budde
2012-01-10 16:23                                                                                   ` Wolfgang Grandegger
2012-01-10 19:02                                                                                     ` Wolfgang Zarre
2012-01-11  9:05                                                                                       ` Wolfgang Zarre
2012-01-11  9:31                                                                                         ` Marc Kleine-Budde
2012-01-10 11:41                                                                           ` Henrik Maier
2012-01-10 11:59                                                                             ` Wolfgang Grandegger
2012-01-10 12:43                                                                               ` Wolfgang Zarre
2012-01-05 19:45                                                                       ` Oliver Hartkopp
2012-01-05 20:48                                                                         ` Oliver Hartkopp
2011-12-23 11:32                                                       ` peak_pci: device channels chained list issue Grosjean Stephane
2011-12-23 12:11                                                       ` peak_pci: device channels chained list issue (cont.) Grosjean Stephane
2012-01-31 22:12                                                         ` Marc Kleine-Budde
2011-11-28 12:09   ` [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527 Marc Kleine-Budde
     [not found]     ` <4ED379F3.1070206-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 13:59       ` Wolfgang Grandegger
2011-11-28 14:03         ` David Laight
     [not found]           ` <AE90C24D6B3A694183C094C60CF0A2F6D8AEE9-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2011-11-28 14:09             ` Marc Kleine-Budde
     [not found]               ` <4ED3960F.4040508-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 15:10                 ` Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 3/4] can: cc770: add platform " Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 4/4] powerpc: tqm8548/tqm8xx: add and update CAN device nodes Wolfgang Grandegger

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=4EF32E84.1080006@essax.com \
    --to=info-pyqshjvljn8avxtiumwx3w@public.gmane.org \
    --cc=linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=socketcan-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org \
    --cc=socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org \
    --cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.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).