linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Problem with OF interrupt parsing code
@ 2007-10-02 12:40 Gerhard Pircher
  0 siblings, 0 replies; 18+ messages in thread
From: Gerhard Pircher @ 2007-10-02 12:40 UTC (permalink / raw)
  To: benh, segher; +Cc: linuxppc-dev


-------- Original-Nachricht --------
> Datum: Tue, 02 Oct 2007 08:54:04 +1000
> Von: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> An: Segher Boessenkool <segher@kernel.crashing.org>
> CC: Gerhard Pircher <gerhard_pircher@gmx.net>, linuxppc-dev@ozlabs.org
> Betreff: Re: Problem with OF interrupt parsing code

> It shoudn't normally happen. The reason it -does- happen in fact is that
> the above node is also missing the #interrupt-cells property, which
> cause the parent-lookup routine to skip it before it gets a chance to
> see that there's an "interrupt-controller" property in there.
> 
> I'm not sure whether linux behaviour is a bug or not since I believe we
> are clearly in undefined-land as an interrupt controller should always
> have a #interrupt-cells property.
I think these properties weren't specified in the OF CHRP ISA PIC device
binding document for the PIC node, thus I may have forgotten about them
(CHRP also defines a parent interrupt controller for the PIC, right?).
But the AmigaOne is not a CHRP platform, so I'll add them to the device
tree and then I will see how it works.

Thanks!

Gerhard

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Problem with OF interrupt parsing code
@ 2007-10-01 21:00 Gerhard Pircher
  2007-10-01 21:11 ` Gerhard Pircher
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Gerhard Pircher @ 2007-10-01 21:00 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

I think I found an issue in the OF interrupt parsing code, although I
have to admit that my device tree source doesn't really follow the
specification.

First some information about my target setup. I didn't specify an
interrupt-map and interrupt-map-mask property in the pci node, because
AFAIK there are three different AmigaOne models with different IRQ
routing. Secondly the AmigaOne is a desktop system with 4 PCI/AGP slots,
thus I can't specify device nodes for all possible devices. By looking at
pci_read_irq_line() in pci_common.c it should be possible for the kernel
to fall back to the interrupt settings in the PCI config space of every
device.

Unfortunately I couldn't capture the kernel log, because the serial
console is not yet working, so here comes a description of what I think
is going on.
Well, pci_read_irq_line() starts with PCI device 00:00.0 (PCI host bridge)
and invokes of_irq_map_pci() in prom_parse.c. It find the predefined
device node in the device tree. Since of_irq_map_one() can't find an
interrupt property in the device node, it returns to pci_read_irq_line()
and setups the interrupt mapping based on the settings in the PCI config
space. So far so good.
The problem occurs now, if there is no device node defined for another
PCI device. In this case, of_irq_map_pci() checks for an interrupt pin,
searches again for the host bridge node and calls of_irq_map_raw() with
the device node of the host bridge. The function finds the
#interrupt-cells, #address-cells, interrupt-controller properties, but
fails to find the interrupt-map property (because it's missing in the
device tree). Therefore the function then tries to find a new parent,
which leads to an endless loop (it always selects the PCI2ISA southbridge
in the device tree).

Can somebody confirm my explanation? It would help, if the kernel could
fall back to the PCI settings in this case, too.

Thanks!

regards,

Gerhard
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

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

end of thread, other threads:[~2007-10-03  7:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 12:40 Problem with OF interrupt parsing code Gerhard Pircher
  -- strict thread matches above, loose matches on Subject: below --
2007-10-01 21:00 Gerhard Pircher
2007-10-01 21:11 ` Gerhard Pircher
2007-10-01 21:39   ` Benjamin Herrenschmidt
2007-10-01 22:33   ` Segher Boessenkool
2007-10-01 22:54     ` Benjamin Herrenschmidt
2007-10-01 22:55       ` Benjamin Herrenschmidt
2007-10-01 23:36       ` Segher Boessenkool
2007-10-02 12:38       ` Gerhard Pircher
2007-10-02 22:03         ` Benjamin Herrenschmidt
2007-10-03  7:43           ` Gerhard Pircher
2007-10-01 21:26 ` Scott Wood
2007-10-01 21:37   ` Scott Wood
2007-10-01 21:43     ` Benjamin Herrenschmidt
2007-10-01 21:48       ` Scott Wood
2007-10-01 22:07         ` Benjamin Herrenschmidt
2007-10-02 12:46   ` Gerhard Pircher
2007-10-01 21:36 ` 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).