mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Grant Grundler <grundler@cup.hp.com>,
	Paul Mackerras <paulus@samba.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	davidm@hpl.hp.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	greg@kroah.com
Subject: Re: [patch 2.5] 2-pass PCI probing, generic part
Date: Fri, 10 Jan 2003 16:35:03 +0300	[thread overview]
Message-ID: <20030110163503.A4486@jurassic.park.msu.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0301091531260.1506-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Thu, Jan 09, 2003 at 03:35:32PM -0800

On Thu, Jan 09, 2003 at 03:35:32PM -0800, Linus Torvalds wrote:
> 
> On Fri, 10 Jan 2003, Ivan Kokshaysky wrote:
> > 
> > PCI-PCI, PCI-ISA bridges - probably, but not host bridges. On x86 they
> > often have quite a few BARs, like AGP window, AGP MMIO, power management
> > etc., which we cannot ignore.
> 
> Oh, but we _can_ ignore it.
> 
> All those things are stuff that if the kernel doesn't use them, the kernel 
> doesn't even need to know they are there. 

It does - even if we don't use it, this stuff occupies regions in the bus
address space. If we ignore it we'll end up with incomplete resource
tree and pci_assign_resource() won't work anymore. Especially with AGP
aperture window, which tends to be large (32-128M), we'd have very good
chances to allocate a new resource (either by hotplug drivers or just
working around BIOS allocation bugs) in the middle of this window. Ouch.

> Sure, if we support AGP, we need to see the aperture size etc, but then 
> we'd have the AGP driver just do the "pci_enable_dev()" thing to work it 
> out.
> 
> The only real reason to worry about BAR sizing is really to do resource
> discovery in order to make sure that out bridges have sufficiently big
> windows for the IO regions. Agreed?

Yes, and as Grant already pointed out, to deal with overlapping (or just
incorrectly allocated) regions.

> And that should be a non-issue especially on a host bridge, since we 
> almost certainly don't want to reprogram the bridge windows there anyway.

[Hmm, on alpha we're doing that for years. :-)]
But even if we don't reprogram the bridge, we need to know about the
ranges that it decodes as we don't want to step on them accidentally.

> So I'd like to make the _default_ be to probe the minimal possible, 
> _especially_ for host bridges. Then, the PCI quirks could be used to 
> expand on that default.

I agree in general. Reasonable probing policy certainly is a good thing.
"Don't probe by default" would work wonderfully for PCI and ISA bridges -
I've yet to see one with normal BARs.
I'm just afraid that with the default "don't probe northbridges" we'll end
up with a lot more quirks than with "probe by default".

In either case, all of this can be trivially implemented on the top of
that patch. I'd suggest another pci_dev bit - "force_probe", to override
default policy:

static inline int default_probing_policy(struct pci_dev *dev)
{
	switch (dev->class >> 8) {
	case PCI_CLASS_BRIDGE_ISA:
	case PCI_CLASS_BRIDGE_EISA:
	case PCI_CLASS_BRIDGE_PCI:
		return 0;	/* Don't probe */
	case PCI_CLASS_BRIDGE_HOST:
		return ???
	default:
		return 1;	/* Do probe */
	}
}

static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
{
	...

	if (dev->skip_probe ||
	    (!dev->force_probe && !default_probing_policy(dev)))
		return;

	/* Disable I/O & memory decoding while we size the BARs. */
	pci_read_config_word(dev, PCI_COMMAND, &cmd);
	...

Ivan.

  parent reply	other threads:[~2003-01-10 13:29 UTC|newest]

Thread overview: 78+ 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
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 [this message]
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

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=20030110163503.A4486@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=davidm@hpl.hp.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.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

all inboxes | Powered by JetHome®