From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Stanislaw Gruszka <stf_xl@wp.pl>,
Andrew Victor <linux@maxim.org.za>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
linux-ide@vger.kernel.org, ddaney@caviumnetworks.com
Subject: Re: [RFC][PATCH] at91_ide driver
Date: Fri, 16 Jan 2009 17:58:37 +0100 [thread overview]
Message-ID: <200901161758.38037.bzolnier@gmail.com> (raw)
In-Reply-To: <49708C55.1020204@ru.mvista.com>
Hi,
On Friday 16 January 2009, Sergei Shtylyov wrote:
> Hello.
>
> Alan Cox wrote:
>
> >> +#ifdef AT91_GPIO_IRQ_HACK
> >> +#define NR_TRIES 10
> >> + int ntries = 0;
> >> + int pin_val1, pin_val2;
> >> + do {
> >> + pin_val1 = at91_get_gpio_value(AT91_PIN_PB20);
> >> + pin_val2 = at91_get_gpio_value(AT91_PIN_PB20);
> >> + } while (pin_val1 != pin_val2 && ntries++ < NR_TRIES);
> >>
> >
> > You really don't want to put special board specific code in generic
> > locations. In the libata case you don't need to and I think in the ide
> > case you can avoid it too by wrapping the IRQ handler.
>
> Unfortunately, it seems you can't wrap ide_intr(), at least with the
> current code.
Well... there shouldn't be much problem with:
* adding ->irq_handler method to struct ide_port_info and struct ide_host
[ which reminds me that struct ide_port_info would be better named struct
ide_host_info and IIRC somebody has already noticed it in the past ;-) ]
* exporting ide_intr()
* adding ide_interrupt() wrapper around ide_intr() which will do sth like:
if (host->irq_handler)
return host->irq_handler()
else
return ide_intr()
and then passing &ide_interrupt instead of &ide_intr to request_irq()
* implementing at91_irq_handler()
* Et Voila!
In the longer term it would also be useful for other purposes
(like adding ATA-like flash devices support to IDE).
> > Libata also supports polled mode.
> >
>
> Yeah. Stanslaw, I'd (have to) advise going the libata way in this
> case -- in case you want to avoid the additional trouble of porting this
> broken-minded IRQ implementation to the IDE core... although the real
> issue seems to olny be with the development board.
Enhancing pata_at32 seems to be also a good idea but at91_ide
looks almost ready for merge, is clean and relatively simple.
I think that the only things needing fixing before merge are:
- IRQ hack
- not using IDE_TIMINGS
and both should be easy to address IMHO.
> > Other comments:
> > - The old and new ATA layers both have timing tables and timing
> > functions so you don't need all the duplicated timing table logic.
> >
>
> Stanislaw's patch is adding the DIOx- to address hold time (t9) to
> the existing ones. While there's has been already a patch by David Daney
> adding this timing to libata (however, the author have ditched this idea
> finally), the table in ide-timings.c still misses it, as well as the PIO
> mode 6 timings...
Indeed... should be easy and quick to fix though.
> Hm, besides the address setup and active/recovery times there seem
> wrong for the PIO mode 5: they should be 15 and 65/25, not 20 and 50/30.
> Bart, are you reading this? :-)
Yeah. Where's the patch? :-)
Thanks,
Bart
next prev parent reply other threads:[~2009-01-16 16:59 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 [this message]
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
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=200901161758.38037.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=ddaney@caviumnetworks.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@atmel.com \
--cc=sshtylyov@ru.mvista.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).