All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Arbuckle <tom.d.arbuckle@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] "multifunc-device": fix IRQ assignment by also scanning dummy nodes
Date: Wed, 11 Feb 2009 20:41:48 -0000	[thread overview]
Message-ID: <op.uo7fryg3fq1scd@kams> (raw)

Hello, Ben.


I've regenerated this patch against 2.6.28.4.

______

Kernel: 2.6.28.4; function: scan_OF_pci_childs; file: arch/powerpc/kernel/pci_32.c
Quoting from line 206 : 'some OFs create a parent node "multifunc-device" as a
fake root for all functions of a multi-function device. we go down them as well.'

Function scan_OF_for_pci_dev (line 225) also needs to be taught about
these dummy nodes to prevent misallocation/non-allocation of IRQs for
this class of devices.

Bug seen when using a bt878 multimedia controller card on a G3 Powermac.
This PCI card has separate audio and video nodes and was not being properly
assigned interrupts. (Either 'cannot grab irq 0' or type of assigned
interrupt wrt 'edge/level' was incorrect).

Signed off by: Tom Arbuckle <tom.d.arbuckle (at) gmail.com>

______

Regards,


Tom Arbuckle

Homepage: http://www.ece.ul.ie/homepage/Tom_Arbuckle/
LinkedIn: http://www.linkedin.com/in/tomarbuckle


--- linux-2.6.28.4/arch/powerpc/kernel/pci_32.c.orig    2009-02-06 21:47:45.000000000 +0000
+++ linux-2.6.28.4/arch/powerpc/kernel/pci_32.c 2009-02-07 16:37:04.000000000 +0000
@@ -226,15 +226,21 @@ static struct device_node *scan_OF_for_p
                                               unsigned int devfn)
 {
        struct device_node *np;
+       struct device_node *np_sub = NULL;
        const u32 *reg;
        unsigned int psize;
 
        for_each_child_of_node(parent, np) {
                reg = of_get_property(np, "reg", &psize);
-               if (reg == NULL || psize < 4)
-                       continue;
-               if (((reg[0] >> 8) & 0xff) == devfn)
-                       return np;
+               if (reg && psize >= 4) {
+                       if (((reg[0] >> 8) & 0xff) == devfn)
+                               return np;
+               }
+               if (!strcmp(np->name, "multifunc-device")) {
+                       np_sub = scan_OF_for_pci_dev(np, devfn);
+                       if (np_sub)
+                               return np_sub;
+               }
        }
        return NULL;
 }

                 reply	other threads:[~2009-02-11 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=op.uo7fryg3fq1scd@kams \
    --to=tom.d.arbuckle@gmail.com \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.