From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Andrew Victor <linux@maxim.org.za>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
linux-ide@vger.kernel.org
Subject: Re: [RFC][PATCH] at91_ide driver
Date: Thu, 22 Jan 2009 12:44:10 +0300 [thread overview]
Message-ID: <49783FEA.3010302@ru.mvista.com> (raw)
In-Reply-To: <200901211133.05095.stf_xl@wp.pl>
Hello.
Stanislaw Gruszka wrote:
>> Besides, we have ide_timing_compute() doing the same thing.
>>
> I'm trying use it, but have too bigger results - 1 or 2 cycles is added.
>
That's most probably because ide_timing_compute() assumes non-zero
minimum recovery time for PIO modes 0 to 2 (libata does the same) --
that actually smells of over-caution. It then tries to stretch the
active time if the sum of active and recovery times is less than cycle
time (all quantized already).
> I'm doing something wrong.
>
Well, you don't compute t2i. And you use recover field returend by
ide_timing_compute() instead of rev8b.
> T = 1000000000 / (mck_hz / 1000);
> pdbg("pio %u T %u\n", pio, T);
> ret = ide_timing_compute(drive, pio + XFER_PIO_0, &timing, T, 1);
>
> t0 = timing->cyc8b;
> t1 = timing->setup;
> t2 = timing->act8b;
> t2i = timing->recover;
>
No, you should use rec8b.
> t9 = 0;
> pdbg("1: t0=%02u t1=%02u t2=%02u t2i=%02u t9=%02u\n", t0, t1, t2, t2i, t9);
>
> Clock is approx 100MHz , results should be the same as in standard
> divided by 10.
>
> hda: host max PIO5 wanted PIO0 selected PIO0
> at91_ide_set_pio_mode pio 0 T 10004
> set_ebi_timings 1: t0=60 t1=07 t2=32 t2i=29 t9=00
> set_ebi_timings 2: t0=60 t1=07 t2=29 t2i=00 t9=02
>
Yeah, with the PIO0 active time 290 ns + revovery time 240 ns giving
530 ns, the function should stretch the active time.
> hda: host max PIO5 wanted PIO1 selected PIO1
> at91_ide_set_pio_mode pio 1 T 10004
> set_ebi_timings 1: t0=39 t1=05 t2=29 t2i=18 t9=00
> set_ebi_timings 2: t0=39 t1=05 t2=29 t2i=00 t9=02
>
Here 290 + 100 gives 390, so no stretching occurs.
> hda: host max PIO5 wanted PIO2 selected PIO2
> at91_ide_set_pio_mode pio 2 T 10004
> set_ebi_timings 1: t0=33 t1=03 t2=29 t2i=12 t9=00
> set_ebi_timings 2: t0=24 t1=03 t2=29 t2i=00 t9=01
>
Here 290 + 40 gives 330, so no stretching occurs.
> hda: host max PIO5 wanted PIO3 selected PIO3
> at91_ide_set_pio_mode pio 3 T 10004
> set_ebi_timings 1: t0=18 t1=03 t2=09 t2i=09 t9=00
> set_ebi_timings 2: t0=18 t1=03 t2=08 t2i=07 t9=04
>
Here 80 + 70 gives 150, so the active time is stretched.
> hda: host max PIO5 wanted PIO4 selected PIO4
> at91_ide_set_pio_mode pio 4 T 10004
> set_ebi_timings 1: t0=12 t1=03 t2=08 t2i=04 t9=00
> set_ebi_timings 2: t0=12 t1=03 t2=07 t2i=03 t9=01
>
Here 70 + 30 gives 100, so the active time is stretched.
> hda: host max PIO5 wanted PIO5 selected PIO5
> at91_ide_set_pio_mode pio 5 T 10004
> set_ebi_timings 1: t0=12 t1=02 t2=07 t2i=05 t9=00
> set_ebi_timings 2: t0=10 t1=02 t2=07 t2i=03 t9=01
>
Here 50 + 30 gives 80 (the IDE core doesn't know about CF extended
modes, so uses non-standard PIO5 timings), so the active time is
stretched again.
> Cheers
> Stanislaw Gruszka
>
MBR, Sergei
next prev parent reply other threads:[~2009-01-22 9:44 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 12:45 [RFC][PATCH] at91_ide driver Stanislaw Gruszka
2009-01-14 12:58 ` Haavard Skinnemoen
2009-01-14 13:21 ` Stanislaw Gruszka
2009-01-14 17:05 ` Sergei Shtylyov
2009-01-22 11:19 ` Stanislaw Gruszka
2009-01-14 13:17 ` Alan Cox
2009-01-14 14:35 ` Stanislaw Gruszka
2009-01-14 15:14 ` Alan Cox
2009-01-16 13:32 ` Sergei Shtylyov
2009-01-16 15:03 ` Stanislaw Gruszka
2009-01-16 15:34 ` Sergei Shtylyov
2009-01-16 16:13 ` Alan Cox
2009-01-17 20:08 ` Sergei Shtylyov
2009-01-17 20:20 ` Alan Cox
2009-01-18 10:58 ` Sergei Shtylyov
2009-01-18 15:29 ` Sergei Shtylyov
2009-01-19 11:51 ` Stanislaw Gruszka
2009-01-19 15:20 ` Sergei Shtylyov
2009-01-16 16:58 ` Bartlomiej Zolnierkiewicz
2009-01-17 16:45 ` Sergei Shtylyov
2009-01-19 22:50 ` Sergei Shtylyov
2009-01-27 15:31 ` Bartlomiej Zolnierkiewicz
2009-01-19 11:14 ` Stanislaw Gruszka
2009-01-19 12:52 ` Bartlomiej Zolnierkiewicz
2009-01-16 17:43 ` Bartlomiej Zolnierkiewicz
2009-01-19 11:20 ` Stanislaw Gruszka
2009-01-30 9:05 ` Stanislaw Gruszka
2009-02-01 17:13 ` Bartlomiej Zolnierkiewicz
2009-02-02 12:35 ` Stanislaw Gruszka
2009-01-20 11:07 ` Sergei Shtylyov
2009-01-20 14:49 ` Stanislaw Gruszka
2009-01-20 15:33 ` Sergei Shtylyov
2009-01-21 10:33 ` Stanislaw Gruszka
2009-01-22 9:44 ` Sergei Shtylyov [this message]
2009-01-22 10:15 ` Stanislaw Gruszka
2009-01-22 11:12 ` Stanislaw Gruszka
2009-01-22 12:06 ` Sergei Shtylyov
2009-01-22 12:16 ` Sergei Shtylyov
2009-01-22 12:24 ` Sergei Shtylyov
2009-01-22 12:57 ` Stanislaw Gruszka
2009-01-22 13:38 ` Sergei Shtylyov
2009-01-22 13:14 ` Stanislaw Gruszka
2009-01-22 13:48 ` Sergei Shtylyov
2009-01-22 14:13 ` Stanislaw Gruszka
2009-01-27 15:46 ` Sergei Shtylyov
2009-01-29 14:48 ` Stanislaw Gruszka
2009-01-29 15:22 ` Sergei Shtylyov
2009-01-22 14:39 ` Stanislaw Gruszka
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=49783FEA.3010302@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@atmel.com \
--cc=stf_xl@wp.pl \
/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).