From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: Tomoya MORINAGA <tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
Masayuki Ohtake
<masa-korg-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
margie.foster-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
joel.clark-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Christian Pellegrin <chripell-VaTbYqLCNhc@public.gmane.org>,
qi.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH net-next-2.6 v2] can: Topcliff: PCH_CAN driver: Add Flow control,
Date: Tue, 16 Nov 2010 11:16:27 +0100 [thread overview]
Message-ID: <4CE259FB.5090402@grandegger.com> (raw)
In-Reply-To: <001501cb8567$c7a38820$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
Hi Tomoya,
On 11/16/2010 09:25 AM, Tomoya MORINAGA wrote:
> On Monday, November 15, 2010 11:21 PM, Wolfgang Grandegger wrote:
>
>>
>> More comments to the lec handling below.
>>
>>> + cf->data[6] = ioread32(&priv->regs->errc) & PCH_TEC;
>>> + cf->data[7] = (ioread32(&priv->regs->errc) & PCH_REC) >> 8;
>>
>> Could be handle with just *one* register access.
>
> I will modify.
>
>> if (reg_stat & PCH_BUS_OFF ||
>> (reg_stat & PCH_LEC_ALL) != PCH_LEC_ALL) {
>>
>> Your lec handling is still not correc,
>
> I will modify like above.
>
>> I believe. The driver needs to
>> write PCH_LEC_ALL to the "stat" register once in the initialization code
> This is NOT true.
> I heard even if CAN driver detects PCH_LEC_ALL, the driver doesn't have to
> write PCH_LEC_ALL to LEC.
> "PCH_LEC_ALL" means there is no error event.
OK, but...
> In case error is occurred, lec value is updated automatically.
... I doubt that it's updated automatically. At least I understand
chapter "13.4.2.2 CAN Status Register (CANSTAT)" and "Table 507. Last
Error Code (LEC) Details of Operation" differently. Please *check* the
real behavior by adding debugging code.
>> and then after each error observed (lec != PCH_LEC_ALL). I still do not
>> find such code. Could you show us the output of
>>
>> "# candump any,0:0,#FFFFFFFF"
>>
>> when yo send CAN messages *without* a cable connected?.
>
>
> [root@localhost can-utils]# ./candump any,0:0,#FFFFFFFF
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
> can0 20000024 [8] 00 28 00 00 00 00 88 00 ERRORFRAME
To inteprete the error messages, please have a look to
http://lxr.linux.no/#linux/include/linux/can/error.h
The id is "CAN_EFF_FLAG | CAN_ERR_ACK | CAN_ERR_CRTL" and data[1] is
"CAN_ERR_CRTL_TX_PASSIVE | CAN_ERR_CRTL_TX_WARNING".
Which is *not* 100% OK.
> ......It seems the same line continues forever.
Yes, it will continue until you connect the cable, that's normal
behavior. But that's not the full sequence. Could you please repeat the
test as shown below:
First start the following command in a *separate* session.
# candump any,0:0,#FFFFFFFF"
Then setup and start the CAN controller:
# ip link set can0 up type can bitrate 125000
# cansend can0 123#deadbeef
Wolfgang.
next prev parent reply other threads:[~2010-11-16 10:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 8:30 [PATCH net-next-2.6 v2] can: Topcliff: PCH_CAN driver: Add Flow control, Tomoya MORINAGA
[not found] ` <4CE0EFA7.9020007-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2010-11-15 9:11 ` Marc Kleine-Budde
2010-11-16 5:18 ` Tomoya MORINAGA
[not found] ` <001401cb854d$b46e13c0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-16 8:14 ` Marc Kleine-Budde
2010-11-16 9:33 ` Tomoya MORINAGA
2010-11-16 17:11 ` David Miller
2010-11-15 9:37 ` Marc Kleine-Budde
2010-11-16 5:30 ` Tomoya MORINAGA
2010-11-15 14:21 ` Wolfgang Grandegger
2010-11-16 8:25 ` Tomoya MORINAGA
[not found] ` <001501cb8567$c7a38820$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-16 10:16 ` Wolfgang Grandegger [this message]
2010-11-19 7:36 ` Tomoya MORINAGA
[not found] ` <00bf01cb87bc$8ed6e300$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-19 8:57 ` Wolfgang Grandegger
2010-11-22 5:20 ` Tomoya MORINAGA
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=4CE259FB.5090402@grandegger.com \
--to=wg-5yr1bzd7o62+xt7jha+gda@public.gmane.org \
--cc=andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=chripell-VaTbYqLCNhc@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=joel.clark-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=margie.foster-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=masa-korg-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=qi.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org \
--cc=tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org \
--cc=yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@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).