From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Masayuki Ohtake <masa-korg-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
margie.foster-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
chripell-VaTbYqLCNhc@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
joel.clark-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
morinaga526-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org,
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
qi.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35
Date: Tue, 12 Oct 2010 09:56:18 +0200 [thread overview]
Message-ID: <4CB414A2.8020202@pengutronix.de> (raw)
In-Reply-To: <000c01cb69dc$5d2aaab0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2267 bytes --]
Hello Masayuki,
On 10/12/2010 09:09 AM, Masayuki Ohtake wrote:
> We have implemented our CAN driver with FIFO mode, and
> We are testing our CAN driver with FIFO mode.
> However, we have found Our CAN hardware spec is different from our anticipated.
> Our CAN HW FIFO is not common FIFO.
> Using FIFO mode, there is possibility received packets are out-of-order.
It's called a FIFO in the Documentation, but it's not a real FIFO as we
all hoped.
> e.g.
> Recv packet-A from NW and set to FIFO.
> |A|
>
> Recv packet-B from NW and set to FIFO.
> |A|B|
>
> Recv packet-C is about to set to FIFO
> |A|B|(C)|
>
> Userspace Copies A from Driver
> Userspace Copies B from Driver
> | | |(C)|
>
> packet-C set to FIFO (C is not head.)
> Recv packet-D from NW(Next packet is set to head)
> |D| |C|
>
> Userspace Copies D from Driver
> Userspace Copies C from Driver
> Userspace raceived packet order is like below
> A-B-D-C
I just had a small peak at the datasheet. It seems you can implement the
same scheme for rx as on the at91, if you enough rx buffers. In the at91
driver I use 8+4 = 12 buffers for rx. Have a look at the driver, the rx
path is documented.
The driver uses 8 + 4 rx buffers, the trick is that a buffer in read but
_not_ marked as free, if I understand the intel datasheet correctly this
is by not resetting the NEWDAT bit. Becasue the driver doesn't free the
buffers it knows that the next CAN frame is in the next buffer. After
reading the 8th buffer, the first 8 buffers (0-7) are marked as free.
Then the driver continues to read buffers 8-11, they might have been
filled before marking 0-7 as free. Then the driver continues from the
beginning.
> So, I think normal-mode is better than FIFO-mode.
> I will revert like the following spec.
> Rx 1 Message Object
> Tx 1 Message Object
>
> Could you agree the above ?
ahh common...the hardware doesn't seem that bad :)
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
next prev parent reply other threads:[~2010-10-12 7:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4C9C7C6F.1000003@dsn.okisemi.com>
[not found] ` <4C9C7C6F.1000003-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2010-09-27 8:38 ` [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35 Wolfgang Grandegger
2010-09-30 9:10 ` Wolfgang Grandegger
[not found] ` <4CA4541F.5040804-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-09-30 18:50 ` David Miller
2010-10-01 10:02 ` Masayuki Ohtake
[not found] ` <000401cb614f$c932c750$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-01 12:40 ` Wolfgang Grandegger
2010-10-05 10:21 ` Masayuki Ohtake
2010-10-05 11:08 ` Marc Kleine-Budde
2010-10-05 12:09 ` Masayuki Ohtake
[not found] ` <002e01cb6486$2ed72cc0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-05 18:45 ` David Miller
2010-10-06 3:07 ` Masayuki Ohtake
[not found] ` <000b01cb6503$962bc7f0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-06 3:09 ` David Miller
[not found] ` <20101005.200904.71120150.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-10-06 9:12 ` Wolfgang Grandegger
2010-10-12 7:09 ` Masayuki Ohtake
[not found] ` <000c01cb69dc$5d2aaab0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-12 7:42 ` Wolfgang Grandegger
2010-10-12 7:56 ` Marc Kleine-Budde [this message]
2010-10-13 4:23 ` Masayuki Ohtake
[not found] ` <000701cb6a8e$60de6900$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-13 7:38 ` Marc Kleine-Budde
2010-10-13 10:09 ` Masayuki Ohtake
[not found] ` <004a01cb6abe$c41a9cc0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-10-13 11:08 ` Wolfgang Grandegger
2010-10-13 12:05 ` Masayuki Ohtake
2010-09-24 10:24 Masayuki Ohtak
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=4CB414A2.8020202@pengutronix.de \
--to=mkl-bicnvbalz9megne8c9+irq@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=morinaga526-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=wg-5Yr1BZd7O62+XT7JhA+gdA@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).