Re: PATCH 2.5.x disable BAR when sizing

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Fri Dec 20 2002 - 13:50:29 EST


On Fri, Dec 20, 2002 at 09:05:53AM -0800, Linus Torvalds wrote:
> One solution in the long term may be to not even probe the BAR's at all in
> generic code, and only do it in the pci_enable_dev() stuff. That way it
> would literally only be done by the driver, who can hopefully make sure
> that the device is ok with it.

I don't think that generic BAR probing is ever avoidable - too often
it's the only way to build a consistent resource tree. Without that
the driver cannot know whether the BAR setting is safe or there is a
conflict with something else.
Anyway, in the short term we could give the architecture ability to use its
own probing code, something like this:

In include/linux/pci.h:

#include <asm/pci.h>

+#ifndef HAVE_ARCH_PCI_BAR_PROBE
+#define pcibios_read_bases(dev, n, rom) 0
+#endif

In drivers/pci/probe.c:

static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
{
        unsigned int pos, reg, next;
        u32 l, sz;
        struct resource *res;

+ if (pcibios_read_bases(dev, howmany, rom))
+ return;
+
        for(pos=0; pos<howmany; pos = next) {
        ...

Ivan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:27 EST