From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public•gmane.org>
To: Tomoya <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,
Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@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: Fix build warnings
Date: Fri, 29 Oct 2010 14:57:49 +0200 [thread overview]
Message-ID: <4CCAC4CD.7000503@pengutronix.de> (raw)
In-Reply-To: <4CCAA3D4.8070408-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4262 bytes --]
Hello,
On 10/29/2010 12:37 PM, Tomoya wrote:
>>>> what does this loop do? why is it nessecarry? I don't like delay loops
>>>> in the hot path of a driver.
>>> This loop is for waiting for all tx Message Object completion.
>>> This is Topcliff CAN HW specification.
>> What do you mean with "tx Message Object completion"? Is TX done not
>> signaled via interrupt?
> Yes Tx done is signaled via interrupt.
> On the other hand, register "CANTREQx" also shows the status of Message Object.
> Reading the register, CAN driver can know the Message Object is empty or not.
> In case of this processing, using this register is better, I think.
>
>> Please explain why you need to wait multiples of
>>> 500us here in the hot TX path.
> You are right. The value "500us" was too big.
> According to Topcliff document, it takes 3~6 cycles for transferring between
> register and Message Object RAM.
> Since 50MHz is, 1cycle=0.02usec, 6cycle=0.12. May be true.
> I will modify 500usec to 1usec.
>
>>>>> All these check if busy in the code make me a bit nervous, can you
>>>>> please explain why they are needed. A pointer to the manual is okay, too.
>>>> Me too. I already ask in my previous mail how long that functions
>>>> usually blocks.
>>> When accessing read/write from/to Message RAM,
>>> Since it takes much time for transferring between Register and Message RAM,
>> Much time means how many mirco-seconds?
> ditto
>
>>> SW must check busy flag of CAN register.
>>> This is a Topcliff HW specification.
>> Maybe the busy check could also be done *before* the Message RAM is
>> accessed to avoid (or minimize) waiting.
> Yes, *before* is right.
> If there is *after* processing, this is a bug.
> Can you see anyway ?
Sorry I don't understand what you mean.
>> Can you give us a pointer into intel's documentation?
> You have already had Intel's data sheet(Topcliff/Atom E6xx series), right ?
> What's document for ?
You probably know the datasheet, but I don't, although I've printed
chapter 13 from the Intel Controller Hub EG20T datasheet, but it's 50+
pages. If the hardware needs the busy waiting in the hot tx path a
pointer to the respective section in the manual is a good idea. Just
something like:
According to the Datasheet $REFERENCE section $SECTION_NUMBER we
need to wait until the $FOO operation finished.
>>> If you figured out how to use the endianess conversion functions from
>>> the cpu_to_{le,be}-{le,to}_to_cpup family use them here, too.
> Sorry, I misunderstood the spec of Topcliff CAN endianess.
> I have understood endianess conversion is not necessary.
> (CAN data is set as Big-Endian in Topcliff CAN register)
>> You have to change the definition of the regs struct a bit:
>>> u32 if1_mcont;
>>> u32 if1_data[4];
>>> u32 reserve2;
> Uh, I can't find this. Where is this ?
Here's a patch to illustrate what I meant:
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 55ec324..5ee7589 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -150,10 +150,7 @@ struct pch_can_regs {
u32 if1_id1;
u32 if1_id2;
u32 if1_mcont;
- u32 if1_dataa1;
- u32 if1_dataa2;
- u32 if1_datab1;
- u32 if1_datab2;
+ u32 if1_data[4];
u32 reserve2;
u32 reserve3[12];
u32 if2_creq;
>> BTW: Where can I get this Intel Hardware to improve and test the driver?
> We don't know, please contact to Intel,
> Topcliff is formally called "Atom E6xx series" http://edc.intel.com/Platforms/Atom-E6xx/
> I have completed modifying for your comments excepting above.
> Receiving many comments, your indication may be dropped. If you find, please indicate again?.
> For your confirming my modification, I show current whole of CAN driver.
The driver has already been merged. Please send incremental patches
against david's net-2.6 branch.
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 parent reply other threads:[~2010-10-29 12:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4CCAA3D4.8070408@dsn.okisemi.com>
[not found] ` <4CCAA3D4.8070408-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2010-10-29 12:57 ` Marc Kleine-Budde [this message]
[not found] ` <4CCAC4CD.7000503-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-10-29 16:23 ` [PATCH net-next-2.6 v2] can: Topcliff: PCH_CAN driver: Fix build warnings Marc Kleine-Budde
[not found] ` <4CCAF517.2000409-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-10-29 19:32 ` Wolfgang Grandegger
2010-11-01 11:05 ` Marc Kleine-Budde
[not found] ` <4CCE9F0B.1000901-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-11-03 16:15 ` Wolfgang Grandegger
2010-11-12 11:10 ` Tomoya MORINAGA
[not found] ` <004a01cb825a$3a8bd060$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-12 11:45 ` Wolfgang Grandegger
2010-11-15 7:39 ` Tomoya MORINAGA
2010-11-15 8:39 ` Tomoya MORINAGA
2010-11-02 10:27 ` Tomoya MORINAGA
[not found] ` <001701cb7a78$99e1fe20$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-02 11:03 ` Marc Kleine-Budde
2010-11-15 8:41 ` Tomoya MORINAGA
2010-10-29 16:46 ` Oliver Hartkopp
[not found] ` <4CCAFA68.2030903-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2010-10-29 17:58 ` Marc Kleine-Budde
2010-11-09 12:26 ` Tomoya MORINAGA
[not found] ` <00fd01cb8009$5efc5fd0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-09 14:47 ` Marc Kleine-Budde
2010-11-01 7:15 ` Tomoya MORINAGA
[not found] <005301cb7ffa$5b63cd90$66f8800a@maildom.okisemi.com>
2010-11-09 12:26 ` Tomoya MORINAGA
[not found] ` <00fe01cb8009$62e11410$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-09 12:59 ` Marc Kleine-Budde
2010-11-11 9:56 ` Tomoya MORINAGA
[not found] ` <002501cb8186$b56a6280$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
2010-11-11 10:04 ` Marc Kleine-Budde
2010-10-29 10:37 Tomoya
[not found] <4CC61B1B.3090602@dsn.okisemi.com>
[not found] ` <4CC61B1B.3090602-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2010-10-26 17:52 ` David Miller
[not found] ` <20101026.105206.15244527.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-10-26 17:55 ` David Miller
[not found] ` <20101026.105545.200376685.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-10-26 18:27 ` Wolfgang Grandegger
[not found] ` <4CC71DA4.3020600-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-10-26 18:52 ` Marc Kleine-Budde
2010-10-27 0:50 ` Tomoya MORINAGA
-- strict thread matches above, loose matches on Subject: below --
2010-10-26 0:04 Tomoya
2010-10-25 2:32 Tomoya
[not found] ` <4CC4EC38.2040208-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2010-10-25 19:14 ` David Miller
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=4CCAC4CD.7000503@pengutronix.de \
--to=mkl-bicnvbalz9megne8c9+irq@public$(echo .)gmane.org \
--cc=andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
--cc=chripell-VaTbYqLCNhc@public$(echo .)gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
--cc=joel.clark-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
--cc=kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=margie.foster-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
--cc=masa-korg-ECg8zkTtlr0C6LszWs/t0g@public$(echo .)gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=qi.wang-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public$(echo .)gmane.org \
--cc=socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public$(echo .)gmane.org \
--cc=tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public$(echo .)gmane.org \
--cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public$(echo .)gmane.org \
--cc=yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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