[patch 1/2] increase PCIBIOS_MIN_IO on x86

From: Ivan Kokshaysky
Date: Tue Aug 02 2005 - 18:01:47 EST


On Tue, Aug 02, 2005 at 02:57:19PM -0700, Linus Torvalds wrote:
> But you don't need to split up any patches you've already prepared: I can
> easily just edit away the part I already committed.

OK, I keep your change here - mostly for Mikael, so he can try that ASAP.


There is a number of x86 laptops that have some non-PCI IO ports
in the 0x1000-0x1fff range, and it's quite hard to control the correct
order of resource allocation between PCI and other subsystems controlling
these ports. Especially with modular kernel. So just increase
PCIBIOS_MIN_IO to 0x4000 to prevent any new PCI resource allocations
in the problematic range (this limitation must apply _only_ to the
root bus resources - see Linus' change in pci_bus_alloc_resource).
As PCIBIOS_MIN_IO and PCIBIOS_MIN_CARDBUS_IO are the same now on i386
and x86-64, we can remove the latter.

Signed-off-by: Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>

--- 2.6.13-rc5/drivers/pci/bus.c Wed Aug 3 00:11:42 2005
+++ linux/drivers/pci/bus.c Wed Aug 3 00:19:41 2005
@@ -60,7 +60,9 @@ pci_bus_alloc_resource(struct pci_bus *b
continue;

/* Ok, try it out.. */
- ret = allocate_resource(r, res, size, min, -1, align,
+ ret = allocate_resource(r, res, size,
+ r->start ? : min,
+ -1, align,
alignf, alignf_data);
if (ret == 0)
break;
--- 2.6.13-rc5/include/asm-i386/pci.h Wed Aug 3 00:11:55 2005
+++ linux/include/asm-i386/pci.h Wed Aug 3 02:51:00 2005
@@ -18,10 +18,8 @@ extern unsigned int pcibios_assign_all_b
#define pcibios_scan_all_fns(a, b) 0

extern unsigned long pci_mem_start;
-#define PCIBIOS_MIN_IO 0x1000
+#define PCIBIOS_MIN_IO 0x4000
#define PCIBIOS_MIN_MEM (pci_mem_start)
-
-#define PCIBIOS_MIN_CARDBUS_IO 0x4000

void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus);
--- 2.6.13-rc5/include/asm-x86_64/pci.h Wed Aug 3 00:11:58 2005
+++ linux/include/asm-x86_64/pci.h Wed Aug 3 02:51:33 2005
@@ -22,10 +22,8 @@ extern unsigned int pcibios_assign_all_b
extern int no_iommu, force_iommu;

extern unsigned long pci_mem_start;
-#define PCIBIOS_MIN_IO 0x1000
+#define PCIBIOS_MIN_IO 0x4000
#define PCIBIOS_MIN_MEM (pci_mem_start)
-
-#define PCIBIOS_MIN_CARDBUS_IO 0x4000

void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/