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

Re: wdc0 and CF slot on MC-R530



"TAKEMURA, Shin" <takemura@netbsd.org> writes:

> ...そうでもないみたいで、今日2/11のソースで作ったカーネルで
> ne0 があると wdc0 は認識されず pcmcia1 を素通りです。
> NIC が挿入されていないと wdc0 は認識されます。

こんな patch あてるとうまくいったりますか?  仕様なのかどこか他の code 
が bug っているのかよくわかりませんが.

enami.
Index: i82365.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/i82365.c,v
retrieving revision 1.47
diff -u -r1.47 i82365.c
--- i82365.c	2000/02/10 09:00:19	1.47
+++ i82365.c	2000/02/12 00:28:25
@@ -1328,6 +1332,7 @@
 	tsleep(pcic_delay, PWAIT, wmesg, roundup(timo * hz, 1000) / 1000);
 }
 
+int pcic_enabled = 0;
 void
 pcic_chip_socket_enable(pch)
 	pcmcia_chipset_handle_t pch;
@@ -1338,6 +1343,10 @@
 	int reg;
 #endif
 
+	while (pcic_enabled > 0)
+		tsleep(&pcic_enabled, PWAIT, "pcicen", 0);
+	pcic_enabled++;
+
 #ifdef DIAGNOSTIC
 	if (h->flags & PCIC_FLAG_ENABLED)
 		printf("pcic_chip_socket_enable: enabling twice");
@@ -1393,9 +1402,6 @@
 	 * delay routine.
 	 */
 	delay(20);
-#ifdef __hpcmips__
-	pcic_delay(h, 22, "pccen3");		/* XXX */
-#endif
 
 	/* clear the reset flag */
 	intr |= PCIC_INTR_RESET;
@@ -1439,6 +1445,8 @@
 	/* finally enable the interrupt */
 	intr |= h->ih_irq;
 	pcic_write(h, PCIC_INTR, intr);
+	pcic_enabled--;
+	wakeup(&pcic_enabled);
 }
 
 void
@@ -1448,6 +1456,10 @@
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	int intr;
 
+	while (pcic_enabled > 0)
+		tsleep(&pcic_enabled, PWAIT, "pcicen", 0);
+	pcic_enabled++;
+
 	DPRINTF(("pcic_chip_socket_disable\n"));
 
 	/* disable interrupts */
@@ -1459,6 +1471,8 @@
 	pcic_write(h, PCIC_PWRCTL, 0);
 
 	h->flags &= ~PCIC_FLAG_ENABLED;
+	pcic_enabled--;
+	wakeup(&pcic_enabled);
 }
 
 static u_int8_t