From: Andrew Morton <akpm@osdl.org>
To: Andy Whitcroft <apw@shadowen.org>
Cc: greg@kroah.com, mbligh@google.com, linux-kernel@vger.kernel.org,
colpatch@us.ibm.com, apw@shadowen.org
Subject: Re: [PATCH] pci device sysdata may be null check in pcibus_to_node
Date: Tue, 20 Dec 2005 15:16:09 -0800 [thread overview]
Message-ID: <20051220151609.565160d9.akpm@osdl.org> (raw)
In-Reply-To: <20051220210338.GA20681@shadowen.org>
Andy Whitcroft <apw@shadowen.org> wrote:
>
> pci device sysdata may be null, check in pcibus_to_node
>
> We have been seeing panic's on NUMA systems in pci_call_probe() in
> 2.6.15-rc5-mm2 and -mm3. It seems that some changes have occured
> to the meaning of the 'sysdata' for a device such that it is no
> longer just an integer containing the node, it is now a structure
> containing the node and other data. However, it seems that we do not
> always initialise this sysdata before we probe the device.
>
> Below are three examples from a boot with this checked for. It is
> not clear to me whether it is reasonable to attempt to probe this
> device without the bus sysdata being initialised. The attached
> patch adds a safety check to pcibus_to_node() to avoid the panic,
> this restores the 'call anytime' semantic for this function.
>
> ...
>
> -#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
> +#define pcibus_to_node(bus) (((bus)->sysdata)? ((struct pci_sysdata *)((bus)->sysdata))->node : -1)
> #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus))
>
It would be neater and faster to simply require that the platform always
put something sane bus->sysdata, even if that's a pointer to some
statically allocated struct. IOW:
static struct pci_sysdata dummy_sysdata = { .node = -1 };
somewhere_in_initialisation()
{
...
if (bus->sysdata == NULL)
bus->sysdata = dummy_sysdata;
}
next prev parent reply other threads:[~2005-12-20 23:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-15 7:40 2.6.15-rc5-mm3 Andrew Morton
2005-12-15 9:48 ` 2.6.15-rc5-mm3 Andi Kleen
2005-12-15 15:36 ` 2.6.15-rc5-mm3 Andi Kleen
2005-12-15 14:30 ` 2.6.15-rc5-mm3 Alexander E. Patrakov
2005-12-16 12:50 ` 2.6.15-rc5-mm3 Lenar Lõhmus
2005-12-16 23:17 ` 2.6.15-rc5-mm3 Greg KH
2005-12-17 0:15 ` 2.6.15-rc5-mm3 J.A. Magallon
2005-12-17 1:42 ` 2.6.15-rc5-mm3 Greg KH
2005-12-20 21:03 ` [PATCH] pci device sysdata may be null check in pcibus_to_node Andy Whitcroft
2005-12-20 23:16 ` Andrew Morton [this message]
2005-12-22 21:06 ` [PATCH] pci device ensure sysdata initialised Andy Whitcroft
2005-12-22 23:18 ` Greg KH
2005-12-22 23:43 ` Andy Whitcroft
2005-12-22 23:51 ` Greg KH
2005-12-22 23:56 ` Andy Whitcroft
2005-12-18 8:16 ` 2.6.15-rc5-mm3 Grant Coady
2005-12-18 11:31 ` 2.6.15-rc5-mm3 Rafael J. Wysocki
2005-12-18 19:54 ` 2.6.15-rc5-mm3 Grant Coady
2005-12-22 17:48 ` 2.6.15-rc5-mm3 Greg KH
2005-12-23 1:05 ` 2.6.15-rc5-mm3 David Brownell
2005-12-21 23:14 ` 2.6.15-rc5-mm3 Jesper Juhl
2005-12-22 4:16 ` 2.6.15-rc5-mm3 Con Kolivas
2005-12-22 18:13 ` 2.6.15-rc5-mm3 Mattia Dongili
2005-12-29 23:46 ` 2.6.15-rc5-mm3 [BUG] smp_processor_id() in preemptible code Peter Williams
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=20051220151609.565160d9.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=colpatch@us.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@google.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