[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] EHCI driver interrupt checking.



PCI interrupt handlers are put into chain.
Check if the interrupt was triggered by the device we're driving.
Return d0 register unmodified if the interrupt is not ours.
Contributed by David Galvez.
diff -r cfb11317e677 -r f154b35c5c5d sys/usb/src.km/ucd/ehci/ehci-pci.c
--- a/sys/usb/src.km/ucd/ehci/ehci-pci.c	Mon Nov 24 16:52:10 2014 +0100
+++ b/sys/usb/src.km/ucd/ehci/ehci-pci.c	Tue Dec 02 17:19:50 2014 +0100
@@ -250,7 +250,7 @@
 	return 0;
 }
 
-long ehci_interrupt_handle(long param)
+long ehci_interrupt_handle(long param, long biosparam)
 {
 	struct ehci *ehci = (struct ehci *)param;
 	unsigned long status;
@@ -278,6 +278,8 @@
 				usb_rh_wakeup();
 		}
 	}
+	else /* not our interrupt */
+		return biosparam;
 
 	/* Disable interrupt */
 	ehci_writel(&ehci->hcor->or_usbsts, status);
diff -r cfb11317e677 -r f154b35c5c5d sys/usb/src.km/ucd/ehci/ehci.S
--- a/sys/usb/src.km/ucd/ehci/ehci.S	Mon Nov 24 16:52:10 2014 +0100
+++ b/sys/usb/src.km/ucd/ehci/ehci.S	Tue Dec 02 17:19:50 2014 +0100
@@ -33,9 +33,10 @@
 _ehci_int_handle_asm:
 	subq.l #8,sp
 	movem.l d1/a1,(sp)
+	move.l d0,-(sp)		// PCI_BIOS specification: INT not for us leave d0 untouched
 	move.l a0,-(sp)		// PCI_BIOS specification: parameter is in a0
 	jsr _ehci_interrupt_handle
-	addq.l #4,sp
+	addq.l #8,sp
 	movem.l (sp),d1/a1
 	addq.l #8,sp
 	rts
diff -r cfb11317e677 -r f154b35c5c5d sys/usb/src.km/ucd/ehci/ehci.h
--- a/sys/usb/src.km/ucd/ehci/ehci.h	Mon Nov 24 16:52:10 2014 +0100
+++ b/sys/usb/src.km/ucd/ehci/ehci.h	Tue Dec 02 17:19:50 2014 +0100
@@ -207,7 +207,7 @@
 long ehci_hcd_init(void);
 long ehci_hcd_stop(void);
 long ehci_alloc_ucdif(struct ucdif **);
-long ehci_interrupt_handle(long);
+long ehci_interrupt_handle(long, long);
 
 /* Interface with bus/platform */