Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2001 15:02:00 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Warner Losh <imp@harmony.village.org>
Cc:        "Mike Atkinson" <mikea@kconline.com>, freebsd-mobile@FreeBSD.ORG, msmith@FreeBSD.ORG
Subject:   Re: PCI -> PCMCIA -> Wavelan/IEEE 
Message-ID:  <200106212202.f5LM20w01556@mass.dis.org>
In-Reply-To: Your message of "Thu, 21 Jun 2001 10:27:40 MDT." <200106211627.f5LGReV89934@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_1597958760
Content-Type: text/plain; charset=us-ascii

> In message <011a01c0fa2a$a322a120$1385f1d8@kconline.com> "Mike Atkinson" writes:
> : Installing the pci_pci.c patch allowed pccbb0 to allocate memory but now
> : there is a problem with allocating an IRQ:
> : 
> : pccbb0: PCI memory allocated: 44000000
> : pci_cfgintr_unique: hard-routed to irq -1
> : pci_cfgintr: 0:30 INTC routed to irq -1
> : pcib1: routed slot 11 INTA to irq -1
> : pccbb: Unable to map IRQ...
> : panic: resume_list_release: can't find resource
> 
> Ugg. I don't know what that means.  I've cc'd mike smith on this since
> he wrote the interrupt routing code.

It means I'm not checking the return value from ffs().  Whoops.

This will prevent the panic, but it may not actually help.  In the first 
case, we have a routing table entry for the slot, but there aren't any 
bits set for it, so we may not be able to route anything (it's possible 
that we can route an interrupt out of the for-PCI list if there's 
anything in it).

This needs to be committed once the plaintiff has tested it.



--==_Exmh_1597958760
Content-Type: text/plain ; name="pci.diff"; charset=us-ascii
Content-Description: pci.diff
Content-Disposition: attachment; filename="pci.diff"

--- /sys/i386/pci/pci_cfgreg.c	Wed Jun 20 18:09:26 2001
+++ pci_cfgreg.c	Thu Jun 21 14:58:52 2001
@@ -249,8 +249,10 @@
     
     if (powerof2(pe->pe_intpin[pin - 1].irqs)) {
 	irq = ffs(pe->pe_intpin[pin - 1].irqs) - 1;
-	printf("pci_cfgintr_unique: hard-routed to irq %d\n", irq);
-	return(irq);
+	if (irq >= 0) {
+	    printf("pci_cfgintr_unique: hard-routed to irq %d\n", irq);
+	    return(irq);
+	}
     }
     return(255);
 }
@@ -285,9 +287,11 @@
 	    /* link destination mapped to a unique interrupt? */
 	    if (powerof2(pi->irqs)) {
 		irq = ffs(pi->irqs) - 1;
-		printf("pci_cfgintr_linked: linked (%x) to hard-routed irq %d\n",
-		       pi->link, irq);
-		return(irq);
+		if (irq >= 0) {
+		    printf("pci_cfgintr_linked: linked (%x) to hard-routed irq %d\n",
+			   pi->link, irq);
+		    return(irq);
+		}
 	    } 
 
 	    /* look for the real PCI device that matches this table entry */

--==_Exmh_1597958760
Content-Type: text/plain; charset=us-ascii

... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E

--==_Exmh_1597958760--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106212202.f5LM20w01556>