linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Possible bug in IRQ handling in pata_of_platform  / pata_platform
@ 2008-08-11 14:48 Steven A. Falco
  2008-08-11 15:19 ` [PATCH] pata_of_platform: fix no irq handling Anton Vorontsov
  0 siblings, 1 reply; 16+ messages in thread
From: Steven A. Falco @ 2008-08-11 14:48 UTC (permalink / raw)
  To: linuxppc-dev

I think there is a bug in the communications between pata_of_platform
and pata_platform.  I will refer to the master branch of the DENX git
tree, which is roughly v2.6.26.1 at this time.  I am using a Sequoia
board with a PPC440EPx.

In pata_of_platform, we have:

    ret = of_irq_to_resource(dn, 0, &irq_res);
    if (ret == NO_IRQ)
        irq_res.start = irq_res.end = -1;

so if there is no interrupt defined, then start and end are -1. 
However, __pata_platform_probe has:

    if (irq_res && irq_res->start > 0) {
        irq = irq_res->start;
        irq_flags = irq_res->flags;
    }

You might think that the (irq_res->start > 0) test will fail, as it
should in this no-irq case.  But, start is a u64, so the -1 actually
looks like a large positive number in the comparison.  So,
__pata_platform_probe attempts to use an interrupt when there isn't one.

I think the fix would be to change __pata_platform_probe to:

    if (irq_res && irq_res->start != -1) {

but that might have other unintended consequences, so I'll defer to
whomever knows more about the intent of this code.

    Steve

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-08-13 21:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-11 14:48 Possible bug in IRQ handling in pata_of_platform / pata_platform Steven A. Falco
2008-08-11 15:19 ` [PATCH] pata_of_platform: fix no irq handling Anton Vorontsov
2008-08-11 16:23   ` Steven A. Falco
2008-08-11 17:07     ` Anton Vorontsov
2008-08-11 22:00       ` Benjamin Herrenschmidt
2008-08-12 14:00         ` Steven A. Falco
2008-08-12 14:04           ` Anton Vorontsov
2008-08-12 14:18             ` Stefan Roese
2008-08-12 14:18             ` Sergei Shtylyov
2008-08-12 14:31               ` Anton Vorontsov
2008-08-13 21:25                 ` Steven A. Falco
2008-08-11 16:29   ` Alan Cox
2008-08-11 16:36   ` Ben Dooks
2008-08-11 16:26     ` Alan Cox
2008-08-11 16:42     ` Steven A. Falco
2008-08-11 22:02     ` Benjamin Herrenschmidt

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).