[parisc-linux-cvs] 2.4.16-pa26

Thomas Bogendoerfer tsbogend@alpha.franken.de
Wed, 26 Dec 2001 23:04:48 +0100


Hi,

I've checked in my pending dino changes and fixed the problem with my
B132 (and other non superio machines), which got uncovered again by
the fixed hba numbering.

Thomas.

Index: arch/parisc/kernel/pci.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/pci.c,v
retrieving revision 1.31
diff -u -p -r1.31 pci.c
--- arch/parisc/kernel/pci.c	2001/12/26 06:12:50	1.31
+++ arch/parisc/kernel/pci.c	2001/12/26 20:13:33
@@ -504,15 +504,9 @@ pcibios_assign_unassigned_resources(stru
 */
 void pcibios_register_hba(struct pci_hba_data *hba)
 {
-	char *name;
-
 	ASSERT(pci_hba_count < PCI_HBA_MAX);
 
 	/* pci_port->in/out() uses parisc_pci_hba to lookup parameter. */
 	parisc_pci_hba[pci_hba_count] = hba;
 	hba->hba_num = pci_hba_count++;
-
-	name = kmalloc(8, GFP_KERNEL);
-	sprintf(name, "PCI %d", hba->hba_num);
-	hba->lmmio_space.name = hba->io_space.name = name;
 }
Index: drivers/gsc/asp.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/asp.c,v
retrieving revision 1.14
diff -u -p -r1.14 asp.c
--- drivers/gsc/asp.c	2001/10/23 21:02:54	1.14
+++ drivers/gsc/asp.c	2001/12/08 00:26:26
@@ -97,7 +97,7 @@ asp_init_chip(struct parisc_device *dev)
 	gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, asp);
+	ret = register_busdevice(dev, asp, NULL);
 	if (ret)
 		goto out;
 
Index: drivers/gsc/busdevice.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/busdevice.h,v
retrieving revision 1.7
diff -u -p -r1.7 busdevice.h
--- drivers/gsc/busdevice.h	2001/10/29 18:38:21	1.7
+++ drivers/gsc/busdevice.h	2001/12/08 00:24:52
@@ -27,7 +27,7 @@ struct busdevice {
 /* short cut to keep the compiler happy */
 #define BUSDEV_DEV(x)	((struct busdevice *) (x))
 
-int register_busdevice(struct parisc_device *gsc_parent, struct busdevice *busdev_new);
+int register_busdevice(struct parisc_device *gsc_parent, struct busdevice *busdev_new, struct irq_region *);
 
 void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs);
 
Index: drivers/gsc/dino.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/dino.c,v
retrieving revision 1.48
diff -u -p -r1.48 dino.c
--- drivers/gsc/dino.c	2001/12/21 23:50:07	1.48
+++ drivers/gsc/dino.c	2001/12/26 20:36:01
@@ -496,6 +496,7 @@ dino_card_setup(struct pci_bus *bus, uns
 		return;
 	}
 	bus->resource[1] = res;
+	bus->resource[0] = &(dino_dev->hba.io_space);
 
 	/* Now tell dino what range it has */
 	for (i = 1; i < 31; i++) {
@@ -774,20 +775,12 @@ dino_common_init(struct parisc_device *d
 	dino_busdevice->parent_irq = gsc_irq.irq;
 	dino_busdevice->eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data;
 
-	ret = register_busdevice(dev, dino_busdevice);
+	ret = register_busdevice(dev, dino_busdevice, dino_dev->dino_region);
 	if (ret) {
 		kfree(dino_busdevice);
 		return ret;
 	}
 
-	/* 
-	 * FIXME, we can't simply free the memory, because irq.c still
-	 * holds a reference. Clean solution might be to provide
-	 * free_irq_region()
-	 */
-	/* kfree(dino_busdevice->busdev_region); */
-	dino_busdevice->busdev_region = dino_dev->dino_region;
-
 	fixup_child_irqs(dev, dino_busdevice->busdev_region->data.irqbase,
 			dino_choose_irq);
 
@@ -806,10 +799,12 @@ dino_common_init(struct parisc_device *d
 
 	/* allocate I/O Port resource region */
 	res = &dino_dev->hba.io_space;
-	if (dev->id.hversion == 0x680) {
-		res->name = "Dino";
+	if (dev->id.hversion == 0x680 || is_card_dino(&dev->id)) {
+		res->name = "Dino I/O Port";
+	        dino_dev->hba.lmmio_space.name = "Dino LMMIO";
 	} else {
-		res->name = "Cujo";
+		res->name = "Cujo I/O Port";
+	        dino_dev->hba.lmmio_space.name = "Cujo LMMIO";
 	}
 	res->start = HBA_PORT_BASE(dino_dev->hba.hba_num);
 	res->end = res->start + (HBA_PORT_SPACE_SIZE - 1);
Index: drivers/gsc/gsc.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/gsc.c,v
retrieving revision 1.28
diff -u -p -r1.28 gsc.c
--- drivers/gsc/gsc.c	2001/11/05 07:42:15	1.28
+++ drivers/gsc/gsc.c	2001/12/08 00:25:49
@@ -159,17 +159,20 @@ struct irq_region_ops busdev_irq_ops = {
 
 
 int register_busdevice(struct parisc_device *gsc_parent, 
-			struct busdevice *busdev)
+			struct busdevice *busdev, struct irq_region *irqregion)
 {
 	struct resource *res;
 
 	busdev->gsc = gsc_parent;
 
-	/* the IRQs we simulate */
-	busdev->busdev_region = alloc_irq_region(32, &busdev_irq_ops,
-			    busdev->name, busdev);
-	if (!busdev->busdev_region)
-		return -ENOMEM;
+	if (irqregion == NULL) {
+		/* the IRQs we simulate */
+		busdev->busdev_region = alloc_irq_region(32, &busdev_irq_ops,
+							 busdev->name, busdev);
+		if (!busdev->busdev_region)
+			return -ENOMEM;
+	} else
+		busdev->busdev_region = irqregion;
 
 	/* allocate resource region */
 	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
Index: drivers/gsc/lasi.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/lasi.c,v
retrieving revision 1.33
diff -u -p -r1.33 lasi.c
--- drivers/gsc/lasi.c	2001/11/29 19:33:40	1.33
+++ drivers/gsc/lasi.c	2001/12/08 00:26:30
@@ -212,7 +212,7 @@ lasi_init_chip(struct parisc_device *dev
 	gsc_writel(lasi->eim, lasi->hpa + OFFSET_IAR);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, lasi);
+	ret = register_busdevice(dev, lasi, NULL);
 	if (ret) {
 		kfree(lasi);
 		return ret;
Index: drivers/gsc/wax.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/wax.c,v
retrieving revision 1.16
diff -u -p -r1.16 wax.c
--- drivers/gsc/wax.c	2001/11/29 19:33:40	1.16
+++ drivers/gsc/wax.c	2001/12/08 00:26:45
@@ -119,7 +119,7 @@ wax_init_chip(struct parisc_device *dev)
 //	gsc_writel(wax->eim, wax->hpa + OFFSET_IAR);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, wax);
+	ret = register_busdevice(dev, wax, NULL);
 	if (ret) {
 		kfree(wax);
 		return ret;



-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                 [ Alexander Viro on linux-kernel ]