From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Race in PCI probing vs. IRQs
Date: Sat, 14 Feb 2004 14:30:11 +1100 [thread overview]
Message-ID: <1076729411.7305.223.camel@gaston> (raw)
An old problem, though I suppose the actual race window is very
small:
The PCI code, when probing for a device will write the the BARs to
get the size, then restore the BAR to their original state. It does
that with interrupts enabled on all CPUs of course.
That mean that for a short window of time, we have the device no longer
accessible on the PCI bus.
However, that device may be a system device of some kind which may be
involved in the interrupt processing.
An example is PowerMacs. Their main interrupt controller is on the
MacIO PCI ASIC. We "probe" it using the OF device-tree, and IRQs are
initialized before PCI. We have a couple of other system devices like
the Power Manager unit which we communicate to via interfaces in
this ASIC, and those are setup & initialized before PCI is probed.
That means that we have potential driver activity and interrupts
going on during the PCI probe. So there is a window where the MacIO
ASIC may be temporarily inaccessible on the PCI bus during boot,
and thus the PIC and some other device, while we can actually take
an interrupt and try to tap them.... bad...
I don't think the "other" CPUs during boot are much active during
the PCI probe, but they might well take interrupts too...
What would be a good fix for that ? I'd hate to have to use an IPI
to gather all CPUs into some wait loop with IRQs off and do all of
the PCI probe with IRQs off, but that may be the best solution if we
want to be completely safe...
Ben.
reply other threads:[~2004-02-14 3:31 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=1076729411.7305.223.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox