lkml.org 
[lkml]   [2000]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[PATCH] x86 PCI detection and documentation
(This is a repost of a mail I made just before vger went
offline. My apoligies to Linus and Martin Mares for mailing
this twice to them, but any comments should be received
by all.)

Hi.

(This has mostly been discussed in an earlier thread. This is a
follow-up with some extra added.)

There currently is a mismatch between the documentation for the
config option CONFIG_PCI_GOBIOS and the code it describes. The
help text states that if 'any' (CONFIG_PCI_GOANY) is picked,
linux will first probe for PCI devices directly, falling back to
asking the BIOS if direct access fails. In reality, the code
tries both (first BIOS then directly) and keeps the direct access
results (if valid) or else uses the BIOS results (if valid).

I discussed this mismatch with Martin Mares at a time when I
thought that the code should be changed to do as the help text
stated (because that made my machine boot :) ), and he wrote:

> Some years ago, the PCI routines have really used this strategy
> (and the obsolete help text reflects this situation), but unfortunately,
> there exist machines where the direct access detection gives bogus
> results, so it's much better to ask the BIOS first. Also, it's conceptually
> cleaner to use a well-defined BIOS interface than to probe random
> ports (well, they are random on all non-PCI machines).
>
> These are the reasons why I'd prefer keeping the current code and
> just fixing the documentation.

AFAICS the current code does not follow this line of thought
completely, as it still probes the hw directly after asking the
BIOS, even though the BIOS might have returned valid data.

So I propose the following patch (patch 1) that changes the code
to check the BIOS results before probing directly and changes the
documentation to reflect this.

If this is rejected for some reason, I include a patch 2 that
merely changes the Documentation/Configure.help to reflect how
the code works currently.

Please comment.


Patch 1:

--- linux-240-test10-pre4-clean/arch/i386/kernel/pci-pc.c Thu Oct 19 21:16:44 2000
+++ linux/arch/i386/kernel/pci-pc.c Thu Oct 19 22:44:55 2000
@@ -969,7 +969,7 @@
}
#endif
#ifdef CONFIG_PCI_DIRECT
- if (pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
+ if (!bios && pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
dir = pci_check_direct();
#endif
if (dir)
--- linux-240-test10-pre4-clean/Documentation/Configure.help Thu Oct 19 21:20:29 2000
+++ linux/Documentation/Configure.help Thu Oct 19 21:53:27 2000
@@ -2437,8 +2437,8 @@
With this option, you can specify how Linux should detect the PCI
devices. If you choose "BIOS", the BIOS will be used, if you choose
"Direct", the BIOS won't be used, and if you choose "Any", the
- kernel will try the direct access method and falls back to the BIOS
- if that doesn't work. If unsure, go with the default, which is
+ kernel will try through the BIOS and fall back to the direct access
+ method if that doesn't work. If unsure, go with the default, which is
"Any".

PCI device name database


patch 2:

--- linux-240-test10-pre4-clean/Documentation/Configure.help Thu Oct 19 21:20:29 2000
+++ linux/Documentation/Configure.help Thu Oct 19 22:49:44 2000
@@ -2437,9 +2437,9 @@
With this option, you can specify how Linux should detect the PCI
devices. If you choose "BIOS", the BIOS will be used, if you choose
"Direct", the BIOS won't be used, and if you choose "Any", the
- kernel will try the direct access method and falls back to the BIOS
- if that doesn't work. If unsure, go with the default, which is
- "Any".
+ kernel will try asking the BIOS first and then use the direct access
+ method regardless of the BIOS scan. If unsure, go with the default,
+ which is "Any".

PCI device name database
CONFIG_PCI_NAMES
--
Regards,
Rasmus(rasmus@jaquet.dk)

Outside of the killings, Washington has one of the lowest crime rates in
the country. -Mayor Marion Barry, Washington, DC

----- End forwarded message -----
--
Rasmus(rasmus@jaquet.dk)

When C++ is your hammer, everything looks like a thumb. Steven M. Haflich
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.236 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site