patch-2.3.16 linux/drivers/pci/quirks.c

Next file: linux/drivers/pnp/isapnp.c
Previous file: linux/drivers/pci/proc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/drivers/pci/quirks.c linux/drivers/pci/quirks.c
@@ -58,6 +58,27 @@
 
 
 /*
+ *  S3 868 and 968 chips report region size equal to 32M, but they decode 64M.
+ *  If it's needed, re-allocate the region.
+ */
+
+static void __init quirk_s3_64M(struct pci_dev *dev)
+{
+	struct resource *r = &dev->resource[0];
+
+	if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) {
+		printk("PCI: Re-allocating buggy S3 card at %s: ", dev->name);
+		r->start = 0;
+		r->end = 0x3ffffff;
+		if (pcibios_assign_resource(dev, 0))
+			printk("FAILED\n");
+		else
+			printk("moved to %08lx\n", r->start);
+	}
+}
+
+
+/*
  *  The main table of quirks.
  */
 
@@ -69,6 +90,8 @@
 	 * quantity.
 	 */
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_0,	quirk_isa_dma_hangs },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_868,		quirk_s3_64M },
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_968,		quirk_s3_64M },
 	{ 0 }
 };
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)