linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: How to cleanly setup legacy IDE irq ?
Date: Sun, 3 Oct 2004 22:54:16 +0200	[thread overview]
Message-ID: <200410032254.16900.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <1096763626.3634.58.camel@gaston>

On Sunday 03 October 2004 02:33, Benjamin Herrenschmidt wrote:
> On Sun, 2004-10-03 at 00:56, Bartlomiej Zolnierkiewicz wrote:
> 
> > I think that if platform is using specific driver it is a
> > correct place to put such information but I may be wrong.
> > 
> > Well, at least it allows somebody knowing nothing about specific
> > platform (me) to see what IRQs are needed and why they are needed.
> > Following all IDE code paths using the default stuff and guessing
> > which parts are overridden by specific platform can get you insane.
> > 
> > I know that is not perfect and I'm open for better ideas.
> 
> I see your point, but I'd still rather have some generic way (since
> the problem is actually common with controllers in legacy mode).
> 
> Something like
> 
>   if (hwif->irq == NO_IRQ) (*)
>       hwif->irq = ide_get_legacy_irq(hwif);

This is really bad from maintainability and sanity point of view ie.
you change something in IDE code and then suddenly have to grep
arch and platform specific code and worry about what these callbacks
wanted to achieve and watch out to not break them (or more likely,
don't know about this issue completely and break them silently :).
With placing IRQ setup in host drivers everything is clear _immediately_.

Also what happens when one architecture can use two different
drivers both needing different legacy IRQs?

Hm, why there are no such things in other (much more successful)
subsystems (SCSI, network) but some devices also use weird IRQs?

> Or maybe just de-obsolete one of the old "default" callbacks

grep kernel for occurrences of ide_default_irq() and then try to match
archs/platforms/IRQs to host drivers and code which setup IRQs vs code
which make use of it... really traumatic experience...

> (*) and please, don't compare with 0, 0 is a valid IRQ number on a
> number of platforms !)

ide-probe.c heavily depends on !hwif->irq but maybe somebody
will finally fix IDE to not use 0 to represent unknown IRQ.

  reply	other threads:[~2004-10-03 20:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01  3:51 How to cleanly setup legacy IDE irq ? Benjamin Herrenschmidt
2004-10-01 14:11 ` Bartlomiej Zolnierkiewicz
2004-10-02  4:30   ` Benjamin Herrenschmidt
2004-10-02 14:56     ` Bartlomiej Zolnierkiewicz
2004-10-03  0:33       ` Benjamin Herrenschmidt
2004-10-03 20:54         ` Bartlomiej Zolnierkiewicz [this message]
2004-10-03 23:42           ` Benjamin Herrenschmidt
2004-10-04  0:27             ` Bartlomiej Zolnierkiewicz
2004-10-04  1:05               ` Benjamin Herrenschmidt
2004-10-04  1:20                 ` Benjamin Herrenschmidt
2004-10-04 21:35                   ` Bartlomiej Zolnierkiewicz
2004-10-04 23:27                     ` Benjamin Herrenschmidt
2004-10-04  1:27                 ` Jeff Garzik
2004-10-04  1:26                   ` Benjamin Herrenschmidt
2004-10-04  1:33                     ` Jeff Garzik
2004-10-04  1:33                       ` Benjamin Herrenschmidt
2004-10-04 21:21                         ` Bartlomiej Zolnierkiewicz
2004-10-04 23:26                           ` Benjamin Herrenschmidt
2004-10-04 23:56                             ` Bartlomiej Zolnierkiewicz

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=200410032254.16900.bzolnier@elka.pw.edu.pl \
    --to=bzolnier@elka.pw.edu.pl \
    --cc=benh@kernel.crashing.org \
    --cc=linux-ide@vger.kernel.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).