From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
davidm@hpl.hp.com, grundler@cup.hp.com,
linux-kernel@vger.kernel.org
Subject: Re: [patch 2.5] PCI: allow alternative methods for probing the BARs
Date: Mon, 6 Jan 2003 18:33:28 +0300 [thread overview]
Message-ID: <20030106183328.B677@localhost.park.msu.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0301052009050.3087-100000@home.transmeta.com>; from torvalds@transmeta.com on Sun, Jan 05, 2003 at 08:14:53PM -0800
On Sun, Jan 05, 2003 at 08:14:53PM -0800, Linus Torvalds wrote:
> Can you do the same with a multi-pass thing?
>
> I really think the single-pass approach is broken, because it means that
> we _cannot_ have a fixup for device that runs _before_ the fixup for the
> bridge that bridges to the device.
>
> As such, the "PCI_FIXUP_EARLY" is not _nearly_ early enough, since it's
> way too late for the actual problem that started this whole thread (ie in
> order to turn off a bridge, we have to make sure that everything behind
> the bridge is turned off _first_).
I totally agree, 2-phase approach is a right way to go. However, I've been
confused by that "feature freeze" thing. ;-)
This patch has zero impact on existing code - I thought it's a "feature"
(and I still believe it's ok for 2.4).
OTOH, I've actually tried to implement 2-phase probing _inside_ the
pci_do_scan_bus, and that was ugly as hell.
I believe the phase #2 must be a separate top-level function -
something like pci_probe_resources (better naming?), but this
assumes some changes to PCI code for every architecture and hotplug
drivers.
> In other words, we really should be able to do all the bus number setup
> _first_. That isn't dependent ont eh BAR's or anything else. The actual
> _sizing_ of the bus is clearly somethign we cannot do early, but we can
> (and should) enumerate the devices first in phase #1.
>
> Alternatively, we could even have a very limited phase #1 that only
> enumerates _reachable_ devices (ie it doesn't even try to create bus
> numbers, it only enumerates devices and buses that have already been set
> up by the firmware, and ignores bridges that aren't set up yet). A pure
> discovery phase, without any configuration at all.
I like the former. Even if we have to reassign the bus numbers,
we won't affect anything but forwarding the PCI configuration
cycles.
For now I'd start with following:
phase #1. pci_do_scan_bus() - build the bus/device tree, read in
dev/vendor IDs, header type and class code; call
"PCI_FIXUP_EARLY" fixups.
phase #2. pci_probe_resources(bus) - walk the bus tree again,
probe the BARs, maybe call pci_read_bridge_bases for
bridges; fill in the rest of PCI header; call "PCI_FIXUP_HEADER"
fixups.
(Also there are phases #3 and #4 - assign resources and assign unassigned
resources, but it's another story)
Then, for example on alpha, we'll have
/* Scan all of the recorded PCI controllers. */
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
hose->first_busno = next_busno;
hose->last_busno = 0xff;
bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);
hose->bus = bus;
next_busno = hose->last_busno = bus->subordinate;
+ pci_probe_resources(bus);
next_busno += 1;
}
Hmm, this looks good - now we can do early bus-specific fixups
without introducing "pcibios_init_bus" thing (suggested by Grant and
myself quite a while ago).
I'll try to code up all of this and do some basic testing on alpha
and i386 in next few days.
Comments?
Ivan.
next prev parent reply other threads:[~2003-01-06 15:27 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-19 21:37 PATCH 2.5.x disable BAR when sizing Grant Grundler
2002-12-20 2:54 ` Alan Cox
2002-12-20 2:27 ` David Mosberger
2002-12-20 6:05 ` Linus Torvalds
2002-12-20 19:50 ` Grant Grundler
2002-12-20 20:14 ` Linus Torvalds
2002-12-20 21:22 ` Grant Grundler
2002-12-21 18:34 ` Maciej W. Rozycki
2002-12-20 20:37 ` Richard B. Johnson
2002-12-20 21:29 ` Grant Grundler
2002-12-20 5:57 ` Linus Torvalds
2002-12-20 9:42 ` David Mosberger
2002-12-20 12:53 ` Ivan Kokshaysky
2002-12-20 17:05 ` Linus Torvalds
2002-12-20 18:26 ` David Mosberger
2002-12-20 19:28 ` Linus Torvalds
2002-12-21 22:06 ` Eric W. Biederman
2002-12-21 22:44 ` Linus Torvalds
2002-12-22 7:15 ` Paul Mackerras
2002-12-22 15:03 ` Benjamin Herrenschmidt
2002-12-22 19:21 ` Ivan Kokshaysky
2002-12-23 0:29 ` Paul Mackerras
2002-12-23 15:26 ` Ivan Kokshaysky
2003-01-05 12:37 ` [patch 2.5] PCI: allow alternative methods for probing the BARs Ivan Kokshaysky
2003-01-06 0:29 ` Anton Blanchard
2003-01-06 4:14 ` Linus Torvalds
2003-01-06 5:22 ` Eric W. Biederman
2003-01-06 10:31 ` Benjamin Herrenschmidt
2003-01-06 11:32 ` Andrew Walrond
2003-01-06 22:01 ` Grant Grundler
2003-01-06 19:45 ` Grant Grundler
2003-01-07 17:05 ` Ivan Kokshaysky
2003-01-07 17:46 ` Linus Torvalds
2003-01-07 20:17 ` Grant Grundler
2003-01-08 14:47 ` Ivan Kokshaysky
2003-01-08 22:34 ` Grant Grundler
2003-01-06 15:33 ` Ivan Kokshaysky [this message]
2003-01-06 21:52 ` Grant Grundler
2003-01-06 23:19 ` Linus Torvalds
2003-01-07 0:13 ` Grant Grundler
2003-01-07 12:33 ` Alan Cox
2003-01-07 17:27 ` Ivan Kokshaysky
2003-01-07 18:46 ` Alan Cox
2003-01-07 17:44 ` Linus Torvalds
2003-01-08 16:55 ` Ivan Kokshaysky
2003-01-09 17:46 ` [patch 2.5] 2-pass PCI probing, generic part Ivan Kokshaysky
2003-01-09 17:52 ` Benjamin Herrenschmidt
2003-01-09 22:09 ` Ivan Kokshaysky
2003-01-09 22:16 ` Linus Torvalds
2003-01-09 22:26 ` Benjamin Herrenschmidt
2003-01-10 3:49 ` Alan Cox
2003-01-09 23:19 ` Ivan Kokshaysky
2003-01-09 23:35 ` Linus Torvalds
2003-01-10 1:09 ` Grant Grundler
2003-01-10 7:56 ` Eric W. Biederman
2003-01-10 19:00 ` Grant Grundler
2003-01-10 21:42 ` Ivan Kokshaysky
2003-01-10 23:07 ` Grant Grundler
2003-01-11 19:39 ` Scott Murray
2003-01-12 7:19 ` Greg KH
2003-01-13 6:28 ` Scott Murray
2003-01-10 13:35 ` Ivan Kokshaysky
2003-01-14 16:39 ` Ivan Kokshaysky
2003-01-09 18:36 ` David Mosberger
2003-01-09 19:52 ` Grant Grundler
2003-01-09 22:40 ` Ivan Kokshaysky
2003-01-09 17:48 ` [patch 2.5] 2-pass PCI probing, hotplug changes Ivan Kokshaysky
2003-01-09 17:51 ` [patch 2.5] 2-pass PCI probing, i386 USB quirk Ivan Kokshaysky
2003-01-07 17:12 ` [patch 2.5] PCI: allow alternative methods for probing the BARs Ivan Kokshaysky
2003-01-07 17:06 ` Ivan Kokshaysky
2002-12-22 19:51 ` PATCH 2.5.x disable BAR when sizing Linus Torvalds
2002-12-22 19:57 ` Eric W. Biederman
2002-12-22 10:38 ` Eric W. Biederman
2002-12-22 18:39 ` Ivan Kokshaysky
2002-12-22 19:47 ` Eric W. Biederman
2002-12-22 21:05 ` Ivan Kokshaysky
2002-12-20 18:50 ` Ivan Kokshaysky
2002-12-20 19:11 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2003-01-06 10:31 [patch 2.5] PCI: allow alternative methods for probing the BARs Benjamin Herrenschmidt
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=20030106183328.B677@localhost.park.msu.ru \
--to=ink@jurassic.park.msu.ru \
--cc=benh@kernel.crashing.org \
--cc=davidm@hpl.hp.com \
--cc=ebiederm@xmission.com \
--cc=grundler@cup.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@transmeta.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