Module Name:    src
Committed By:   snj
Date:           Fri Aug 14 21:37:03 UTC 2009

Modified Files:
        src/sys/dev/ic [netbsd-5]: i82365.c

Log Message:
Pull up following revision(s) (requested by jun in ticket #899):
        sys/dev/ic/i82365.c: revision 1.108
fix pcic kthread creation timing.
see http://mail-index.netbsd.org/current-users/2008/07/15/msg003526.html
fix kern/41791 & port-hpcmips/41164.
ok by uwe & tsutsui


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.102.14.1 src/sys/dev/ic/i82365.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/i82365.c
diff -u src/sys/dev/ic/i82365.c:1.102 src/sys/dev/ic/i82365.c:1.102.14.1
--- src/sys/dev/ic/i82365.c:1.102	Tue Apr  8 12:07:26 2008
+++ src/sys/dev/ic/i82365.c	Fri Aug 14 21:37:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365.c,v 1.102 2008/04/08 12:07:26 cegger Exp $	*/
+/*	$NetBSD: i82365.c,v 1.102.14.1 2009/08/14 21:37:03 snj Exp $	*/
 
 /*
  * Copyright (c) 2004 Charles M. Hannum.  All rights reserved.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.102 2008/04/08 12:07:26 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.102.14.1 2009/08/14 21:37:03 snj Exp $");
 
 #define	PCICDEBUG
 
@@ -397,7 +397,6 @@
 	struct pcmciabus_attach_args paa;
 	struct pcic_softc *sc = (struct pcic_softc *)h->ph_parent;
 	int locs[PCMCIABUSCF_NLOCS];
-	char cs[4];
 
 	/* initialize the rest of the handle */
 
@@ -424,21 +423,6 @@
 		return;
 	}
 
-	/*
-	 * queue creation of a kernel thread to handle insert/removal events.
-	 */
-#ifdef DIAGNOSTIC
-	if (h->event_thread != NULL)
-		panic("pcic_attach_socket: event thread");
-#endif
-	config_pending_incr();
-	snprintf(cs, sizeof(cs), "%d,%d", h->chip, h->socket);
-
-	if (kthread_create(PRI_NONE, 0, NULL, pcic_event_thread, h,
-	    &h->event_thread, "%s,%s", device_xname(h->ph_parent), cs)) {
-		aprint_error_dev(h->ph_parent, "unable to create event thread for sock 0x%02x\n", h->sock);
-		panic("pcic_attach_socket");
-	}
 }
 
 /*
@@ -466,6 +450,7 @@
 {
 	struct pcic_softc *sc = (struct pcic_softc *)h->ph_parent;
 	int reg;
+	char cs[4];
 
 	DPRINTF(("%s: attach finish socket %ld\n", device_xname(h->ph_parent),
 	    (long) (h - &sc->handle[0])));
@@ -520,6 +505,22 @@
 	} else {
 		h->laststate = PCIC_LASTSTATE_EMPTY;
 	}
+
+	/*
+	 * queue creation of a kernel thread to handle insert/removal events.
+	 */
+#ifdef DIAGNOSTIC
+	if (h->event_thread != NULL)
+		panic("pcic_attach_socket: event thread");
+#endif
+	config_pending_incr();
+	snprintf(cs, sizeof(cs), "%d,%d", h->chip, h->socket);
+
+	if (kthread_create(PRI_NONE, 0, NULL, pcic_event_thread, h,
+	    &h->event_thread, "%s,%s", device_xname(h->ph_parent), cs)) {
+		aprint_error_dev(h->ph_parent, "unable to create event thread for sock 0x%02x\n", h->sock);
+		panic("pcic_attach_socket");
+	}
 }
 
 void

Reply via email to