From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Zang Roy-r61911 <tie-fei.zang@freescale.com>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc: Fix irq routing on some PowerMac 32 bits
Date: Wed, 10 Jan 2007 23:13:17 +1100 [thread overview]
Message-ID: <1168431197.22458.336.camel@localhost.localdomain> (raw)
In-Reply-To: <1168419440.1704.16.camel@localhost.localdomain>
> Thanks for all your suggestions. I had thought you could point out where
> was wrong :-). Now, I have to trace it myself. I do not have HW
> debugging tools, I only have printk().
>
> I catch the bug. In your patch:
>
> + /* not a root bus, we need to get our parent */
> + parent = scan_OF_for_pci_bus(bus->parent);
> + if (parent == NULL)
> + return NULL;
> +
> + /* now iterate for children for a match */
> + np = scan_OF_for_pci_dev(parent, bus->self->devfn);
> + of_node_put(parent);
> +
> + /* sanity check */
> + if (strcmp(np->type, "pci") != 0)
> + printk(KERN_WARNING "pci: wrong type \"%s\" for bridge %s\n",
> + np->type, np->full_name);
>
> I think you should judge np != NULL before using it. If np == NULL,
> np->type will cause memory access error. On CDS and some other Freescle
> board, such as 8641HPCN, there is pci bridge, np = NULL , this will
> cause error.
> If you agree, you or I will provide a patch to fix it:-).
While I agree that we should definitely test for NULL and properly fail
instead of crashing, there is still the question of why do you fail at
this point. Do you have PCI devices that don't have corresponding device
nodes ? That is not a problem per-se, I'm just wondering if you have a
device that is supposed to have a node but it's not matching due to a
problem with the "reg" property...
In any case, a patch is definitely needed to properly check for NULL and
should get into 2.6.20, so if you want to do it, it will be much
welcome !
Cheers,
Ben.
next prev parent reply other threads:[~2007-01-10 12:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-11 3:09 [PATCH] powerpc: Fix irq routing on some PowerMac 32 bits Benjamin Herrenschmidt
2006-12-11 6:22 ` Paul Collins
2006-12-11 6:40 ` Benjamin Herrenschmidt
2007-01-10 3:00 ` Zang Roy-r61911
2007-01-10 3:16 ` Benjamin Herrenschmidt
2007-01-10 3:34 ` Zang Roy-r61911
2007-01-10 3:58 ` Benjamin Herrenschmidt
2007-01-10 8:57 ` Zang Roy-r61911
2007-01-10 12:13 ` Benjamin Herrenschmidt [this message]
2007-01-10 12:22 ` Segher Boessenkool
2007-01-11 5:29 ` Zang Roy-r61911
2007-01-10 17:42 ` Wang Haiying-r54964
2007-01-11 5:25 ` Zang Roy-r61911
2007-01-11 5:28 ` Benjamin Herrenschmidt
2007-01-11 5:36 ` Zang Roy-r61911
2007-01-11 5:40 ` Benjamin Herrenschmidt
2007-01-11 5:58 ` Zang Roy-r61911
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=1168431197.22458.336.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=tie-fei.zang@freescale.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).