From: Jeff Garzik <jgarzik@pobox.com>
To: Unicorn Chang <uchang@tw.ibm.com>
Cc: linux-ide@vger.kernel.org, "Tejun Heo ]" <htejun@gmail.com>
Subject: Re: [PATCH 1/2] libata: make both legacy ports share one host_set , take #2
Date: Fri, 30 Jun 2006 12:15:28 -0400 [thread overview]
Message-ID: <44A54E20.9050401@pobox.com> (raw)
In-Reply-To: <44977C93.7090001@tw.ibm.com>
Unicorn Chang wrote:
> @@ -5336,11 +5383,21 @@ int ata_device_add(const struct ata_prob
> ap->ioaddr.cmd_addr,
> ap->ioaddr.ctl_addr,
> ap->ioaddr.bmdma_addr,
> - ent->irq);
> + irq);
>
> ata_chk_status(ap);
> host_set->ops->irq_clear(ap);
> ata_eh_freeze_port(ap); /* freeze port before requesting IRQ */
> +
> + if (ap->ioaddr.irq){
> + /* obtain nonshared per-port irq */
> + rc = request_irq(irq, ent->port_ops->irq_handler, 0, DRV_NAME, ap);
> + if (rc) {
> + dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n",
> + irq, rc);
> + goto err_out;
> + }
> + }
> count++;
> }
>
> @@ -5348,12 +5405,14 @@ int ata_device_add(const struct ata_prob
> goto err_free_ret;
>
> /* obtain irq, that is shared between channels */
> - rc = request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags,
> - DRV_NAME, host_set);
> - if (rc) {
> - dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n",
> - ent->irq, rc);
> - goto err_out;
> + if (ent->irq){
> + rc = request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags,
> + DRV_NAME, host_set);
> + if (rc) {
> + dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n",
> + ent->irq, rc);
> + goto err_out;
> + }
> }
I'm sorry, but any patch that adds additional request_irq() calls to
libata in this manner will be NAK'd.
The current location of request_irq() inside libata is a design mistake
on my part, and this sort of change compounds that mistake.
An improved control flow, which moves request_irq() from libata-core to
LLDD, might be:
* LLDD initializes the host controller, in driver.c (as it does today)
* LLDD, perhaps via bmdma helpers, makes certain that no pending
interrupt conditions exist (many LLDDs do this today)
* LLDD, perhaps via bmdma helpers, calls request_irq()
- problem: need to pass it a useful pointer
-> move drivers to familiar model where LLDD allocs
host_set and ports, does <stuff>, then
registers host_set/ports with system
* LLDD proceeds to register itself with libata core
Overall, the current libata request_irq() design restricts us from doing
a better job with legacy ports (your case), and also prevents doing
advanced stuff with MSI-X and other approaching technologies.
Jeff
prev parent reply other threads:[~2006-06-30 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 4:41 [PATCH 1/2] libata: make both legacy ports share one host_set , take #2 Unicorn Chang
2006-06-30 16:15 ` Jeff Garzik [this message]
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=44A54E20.9050401@pobox.com \
--to=jgarzik@pobox.com \
--cc=htejun@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=uchang@tw.ibm.com \
/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).