* ahci: ahci_host_intr() problem(s)?
@ 2006-04-15 16:59 Bastiaan Jacques
2006-04-15 18:47 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Bastiaan Jacques @ 2006-04-15 16:59 UTC (permalink / raw)
To: linux-ide
Hello,
I was looking at ahci_host_intr() when I noticed something strange: it always
returns 1. Now, that alone is odd because when a function is successful it
ordinarily returns 0 (zero).
But more importantly, it is called in ahci_interrupt():
if (!ahci_host_intr(ap, qc))
if (ata_ratelimit())
dev_printk(KERN_WARNING, host_set->dev,
"unhandled interrupt on port %u\n",
i);
So that if-statement is always false; this seems like a logic error to me.
Back to ahci_host_intr itself. it does:
serr = readl(port_mmio + PORT_SCR_ERR);
writel(serr, port_mmio + PORT_SCR_ERR);
This looks like first we are reading a value from the port, and then writing
the same value back without modification. Why?
I would like to fix the first problem described above, but I don't understand
what this function does.. so perhaps someone who has a greater understanding
of this code should post a patch. Or explain what it should do :)
---
Bastiaan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ahci: ahci_host_intr() problem(s)?
2006-04-15 16:59 ahci: ahci_host_intr() problem(s)? Bastiaan Jacques
@ 2006-04-15 18:47 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-04-15 18:47 UTC (permalink / raw)
To: Bastiaan Jacques; +Cc: linux-ide
Bastiaan Jacques wrote:
> I was looking at ahci_host_intr() when I noticed something strange: it always
> returns 1. Now, that alone is odd because when a function is successful it
> ordinarily returns 0 (zero).
>
> But more importantly, it is called in ahci_interrupt():
>
> if (!ahci_host_intr(ap, qc))
> if (ata_ratelimit())
> dev_printk(KERN_WARNING, host_set->dev,
> "unhandled interrupt on port %u\n",
> i);
>
> So that if-statement is always false; this seems like a logic error to me.
Its dead code at present, yes.
> Back to ahci_host_intr itself. it does:
>
> serr = readl(port_mmio + PORT_SCR_ERR);
> writel(serr, port_mmio + PORT_SCR_ERR);
>
> This looks like first we are reading a value from the port, and then writing
> the same value back without modification. Why?
Standard write-1s-to-clear register behavior.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-15 18:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-15 16:59 ahci: ahci_host_intr() problem(s)? Bastiaan Jacques
2006-04-15 18:47 ` Jeff Garzik
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).