From 26aad69e3dd854abe9028ca873fb40b410a39dd7 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 26 Aug 2005 10:40:10 -0700 Subject: Only pre-allocate 256 bytes of cardbio IO range It may seem small, but most cards need much less, if any, and this not only makes the code adhere to the comment, it seems to fix a boot-time lockup on a ThinkPad 380XD laptop reported by Tero Roponen Signed-off-by: Linus Torvalds --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pci') diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index a2eebc6eaacc..6d864c502a1f 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -40,7 +40,7 @@ * FIXME: IO should be max 256 bytes. However, since we may * have a P2P bridge below a cardbus bridge, we need 4K. */ -#define CARDBUS_IO_SIZE (4096) +#define CARDBUS_IO_SIZE (256) #define CARDBUS_MEM_SIZE (32*1024*1024) static void __devinit -- cgit v1.2.3 From 755528c860b05fcecda1c88a2bdaffcb50760a7f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 26 Aug 2005 10:49:22 -0700 Subject: Ignore disabled ROM resources at setup Writing even a disabled value seems to mess up some matrox graphics cards. It may be a card-related issue, but we may also be writing reserved low bits in the result. This was a fall-out of switching x86 over to the generic PCI resource allocation code, and needs more debugging. In particular, the old x86 code defaulted to not doing any resource allocations at all for ROM resources. In the meantime, this has been reported to make X happier by Helge Hafting . Signed-off-by: Linus Torvalds --- drivers/pci/setup-res.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/pci') diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 84eedc965688..5598b4714f77 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -53,7 +53,9 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) if (resno < 6) { reg = PCI_BASE_ADDRESS_0 + 4 * resno; } else if (resno == PCI_ROM_RESOURCE) { - new |= res->flags & IORESOURCE_ROM_ENABLE; + if (!(res->flags & IORESOURCE_ROM_ENABLE)) + return; + new |= PCI_ROM_ADDRESS_ENABLE; reg = dev->rom_base_reg; } else { /* Hmm, non-standard resource. */ -- cgit v1.2.3