Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Sep 2005 12:19:45 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 83743 for review
Message-ID:  <200509161219.j8GCJjhR084396@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=83743

Change 83743 by rwatson@rwatson_zoo on 2005/09/16 12:19:41

	Integrate netsmp branch from FreeBSD CVS:
	
	- Busdma memory barrier for Alpha.
	- !+ for assembly.
	- CAM tweaks for probing.
	- More wide use of time_uptime() rather than time_second().
	- Sundry ATA attachment and failure tweaks.
	- Several ethernet interfaces get free/detach fixes; if_tl mpsafe!
	- if_ed retrofitting and mii.
	- pccard cis and other attachment cleanups.
	- several devfs rules tweaks and devfs locking work
	- If IPI gets stuck... stumble onwards!
	- TSS fix
	- execve() and symlink locking fixes
	- Kqueue race fix
	- THREAD_NO_SLEEPING()/TDF_NOSLEEPING
	- Broken bpf optimization removed.
	- more fifo regression test work

Affected files ...

.. //depot/projects/netsmp/src/sys/alpha/alpha/busdma_machdep.c#2 integrate
.. //depot/projects/netsmp/src/sys/alpha/include/atomic.h#2 integrate
.. //depot/projects/netsmp/src/sys/amd64/include/atomic.h#4 integrate
.. //depot/projects/netsmp/src/sys/boot/pc98/boot2/io.c#2 integrate
.. //depot/projects/netsmp/src/sys/cam/cam_xpt.c#2 integrate
.. //depot/projects/netsmp/src/sys/conf/NOTES#3 integrate
.. //depot/projects/netsmp/src/sys/conf/files#9 integrate
.. //depot/projects/netsmp/src/sys/dev/aac/aac.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/aac/aac_cam.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/acpica/acpi_pcib_acpi.c#3 integrate
.. //depot/projects/netsmp/src/sys/dev/ata/ata-all.c#5 integrate
.. //depot/projects/netsmp/src/sys/dev/ata/ata-chipset.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/ata/ata-lowlevel.c#3 integrate
.. //depot/projects/netsmp/src/sys/dev/ata/ata-queue.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#11 integrate
.. //depot/projects/netsmp/src/sys/dev/bfe/if_bfe.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/bge/if_bge.c#8 integrate
.. //depot/projects/netsmp/src/sys/dev/cnw/if_cnw.c#5 integrate
.. //depot/projects/netsmp/src/sys/dev/digi/digi.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_ed.c#8 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_ed_cbus.c#3 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_ed_pccard.c#4 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_ed_pci.c#3 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_edreg.h#3 integrate
.. //depot/projects/netsmp/src/sys/dev/ed/if_edvar.h#4 integrate
.. //depot/projects/netsmp/src/sys/dev/em/if_em.c#7 integrate
.. //depot/projects/netsmp/src/sys/dev/en/if_en_pci.c#4 integrate
.. //depot/projects/netsmp/src/sys/dev/ep/if_ep_pccard.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/ex/if_ex.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/ex/if_ex_pccard.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm.c#4 integrate
.. //depot/projects/netsmp/src/sys/dev/ie/if_ie.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/ieee488/tnt4882.c#1 branch
.. //depot/projects/netsmp/src/sys/dev/ieee488/upd7210.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/ieee488/upd7210.h#3 integrate
.. //depot/projects/netsmp/src/sys/dev/nge/if_nge.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/pccard/card_if.m#2 integrate
.. //depot/projects/netsmp/src/sys/dev/pccard/pccard.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/pccard/pccard_cis.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/pccard/pccardvar.h#2 integrate
.. //depot/projects/netsmp/src/sys/dev/re/if_re.c#8 integrate
.. //depot/projects/netsmp/src/sys/dev/sn/if_sn.c#7 integrate
.. //depot/projects/netsmp/src/sys/dev/sn/if_sn_pccard.c#3 integrate
.. //depot/projects/netsmp/src/sys/dev/sn/if_snvar.h#3 integrate
.. //depot/projects/netsmp/src/sys/dev/sound/pcm/sndstat.c#2 integrate
.. //depot/projects/netsmp/src/sys/dev/txp/if_txp.c#7 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_aue.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_axe.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_cdce.c#4 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_cue.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_kue.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_rue.c#8 integrate
.. //depot/projects/netsmp/src/sys/dev/usb/if_udav.c#7 integrate
.. //depot/projects/netsmp/src/sys/dev/vge/if_vge.c#6 integrate
.. //depot/projects/netsmp/src/sys/dev/xe/if_xe_pccard.c#4 integrate
.. //depot/projects/netsmp/src/sys/fs/devfs/devfs.h#3 integrate
.. //depot/projects/netsmp/src/sys/fs/devfs/devfs_devs.c#3 integrate
.. //depot/projects/netsmp/src/sys/fs/devfs/devfs_rule.c#3 integrate
.. //depot/projects/netsmp/src/sys/fs/devfs/devfs_vnops.c#7 integrate
.. //depot/projects/netsmp/src/sys/fs/fifofs/fifo_vnops.c#16 integrate
.. //depot/projects/netsmp/src/sys/fs/nullfs/null_vnops.c#3 integrate
.. //depot/projects/netsmp/src/sys/geom/geom_io.c#4 integrate
.. //depot/projects/netsmp/src/sys/geom/geom_slice.c#2 integrate
.. //depot/projects/netsmp/src/sys/i386/i386/local_apic.c#2 integrate
.. //depot/projects/netsmp/src/sys/i386/i386/sys_machdep.c#2 integrate
.. //depot/projects/netsmp/src/sys/i386/include/atomic.h#2 integrate
.. //depot/projects/netsmp/src/sys/i386/include/pcb_ext.h#2 integrate
.. //depot/projects/netsmp/src/sys/i386/pci/pci_bus.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/imgact_elf.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/init_main.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/kern_conf.c#3 integrate
.. //depot/projects/netsmp/src/sys/kern/kern_event.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/kern_intr.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/kern_timeout.c#3 integrate
.. //depot/projects/netsmp/src/sys/kern/subr_sleepqueue.c#2 integrate
.. //depot/projects/netsmp/src/sys/kern/subr_witness.c#9 integrate
.. //depot/projects/netsmp/src/sys/kern/uipc_socket.c#6 integrate
.. //depot/projects/netsmp/src/sys/kern/vfs_lookup.c#3 integrate
.. //depot/projects/netsmp/src/sys/kern/vfs_syscalls.c#3 integrate
.. //depot/projects/netsmp/src/sys/net/bpf.c#6 integrate
.. //depot/projects/netsmp/src/sys/net/if_vlan.c#9 integrate
.. //depot/projects/netsmp/src/sys/net/route.h#2 integrate
.. //depot/projects/netsmp/src/sys/netinet/ip_fw2.c#6 integrate
.. //depot/projects/netsmp/src/sys/netinet/tcp_syncache.c#3 integrate
.. //depot/projects/netsmp/src/sys/netinet6/nd6_nbr.c#7 integrate
.. //depot/projects/netsmp/src/sys/pc98/cbus/fdc.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/cbus/gdc.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/cbus/nmi.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/cbus/sio.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/pc98/epsonio.h#2 delete
.. //depot/projects/netsmp/src/sys/pc98/pc98/machdep.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/pc98/pc98_machdep.c#2 integrate
.. //depot/projects/netsmp/src/sys/pc98/pc98/pc98_machdep.h#2 integrate
.. //depot/projects/netsmp/src/sys/pci/if_dc.c#9 integrate
.. //depot/projects/netsmp/src/sys/pci/if_pcn.c#10 integrate
.. //depot/projects/netsmp/src/sys/pci/if_rl.c#6 integrate
.. //depot/projects/netsmp/src/sys/pci/if_sf.c#8 integrate
.. //depot/projects/netsmp/src/sys/pci/if_sis.c#7 integrate
.. //depot/projects/netsmp/src/sys/pci/if_sk.c#7 integrate
.. //depot/projects/netsmp/src/sys/pci/if_ste.c#8 integrate
.. //depot/projects/netsmp/src/sys/pci/if_ti.c#6 integrate
.. //depot/projects/netsmp/src/sys/pci/if_tl.c#6 integrate
.. //depot/projects/netsmp/src/sys/pci/if_tlreg.h#2 integrate
.. //depot/projects/netsmp/src/sys/pci/if_vr.c#6 integrate
.. //depot/projects/netsmp/src/sys/pci/if_wb.c#7 integrate
.. //depot/projects/netsmp/src/sys/pci/if_xl.c#8 integrate
.. //depot/projects/netsmp/src/sys/powerpc/include/atomic.h#2 integrate
.. //depot/projects/netsmp/src/sys/sys/conf.h#4 integrate
.. //depot/projects/netsmp/src/sys/sys/filedesc.h#2 integrate
.. //depot/projects/netsmp/src/sys/sys/proc.h#3 integrate
.. //depot/projects/netsmp/src/tools/regression/fifo/fifo_io/fifo_io.c#3 integrate
.. //depot/projects/netsmp/src/tools/regression/fifo/fifo_misc/fifo_misc.c#3 integrate
.. //depot/projects/netsmp/src/tools/regression/sockets/shutdown/shutdown.c#2 integrate

Differences ...

==== //depot/projects/netsmp/src/sys/alpha/alpha/busdma_machdep.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.51 2005/05/25 07:25:12 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.52 2005/09/15 17:09:42 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -891,6 +891,10 @@
 			}
 		}
 	}
+
+	/* Ensure any pending writes have drained. */
+	if (op & (BUS_DMASYNC_PREWRITE))
+		alpha_mb();
 }
 
 static void

==== //depot/projects/netsmp/src/sys/alpha/include/atomic.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.22 2005/07/15 18:17:57 jhb Exp $
+ * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.23 2005/09/15 19:31:22 jhb Exp $
  */
 
 #ifndef _MACHINE_ATOMIC_H_
@@ -56,12 +56,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldl_l %0, %2\n\t"		/* load old value */
-		"bis %0, %3, %0\n\t"		/* calculate new value */
+		"1:\tldl_l %0, %3\n\t"		/* load old value */
+		"bis %0, %2, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "m" (*p), "r" (v)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -72,12 +72,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldl_l %0, %1\n\t"		/* load old value */
+		"1:\tldl_l %0, %3\n\t"		/* load old value */
 		"bic %0, %2, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -88,12 +88,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldl_l %0, %1\n\t"		/* load old value */
+		"1:\tldl_l %0, %3\n\t"		/* load old value */
 		"addl %0, %2, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -104,12 +104,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldl_l %0, %1\n\t"		/* load old value */
+		"1:\tldl_l %0, %3\n\t"		/* load old value */
 		"subl %0, %2, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -121,12 +121,12 @@
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
 		"wmb\n"			/* ensure pending writes have drained */
-		"1:\tldl_l %0,%2\n\t"	/* load current value, asserting lock */
+		"1:\tldl_l %0,%3\n\t"	/* load current value, asserting lock */
 		"ldiq %1,0\n\t"		/* value to store */
 		"stl_c %1,%2\n\t"	/* attempt to store */
 		"beq %1,1b\n"		/* if the store failed, spin */
-		: "=&r"(result), "=&r"(temp), "+m" (*addr)
-		:
+		: "=&r"(result), "=&r"(temp), "=m" (*addr)
+		: "m" (*addr)
 		: "memory");
 #endif
 
@@ -139,12 +139,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldq_l %0, %1\n\t"		/* load old value */
+		"1:\tldq_l %0, %3\n\t"		/* load old value */
 		"bis %0, %2, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -155,12 +155,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldq_l %0, %1\n\t"		/* load old value */
+		"1:\tldq_l %0, %3\n\t"		/* load old value */
 		"bic %0, %2, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -171,12 +171,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldq_l %0, %1\n\t"		/* load old value */
+		"1:\tldq_l %0, %3\n\t"		/* load old value */
 		"addq %0, %2, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -187,12 +187,12 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldq_l %0, %1\n\t"		/* load old value */
+		"1:\tldq_l %0, %3\n\t"		/* load old value */
 		"subq %0, %2, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
-		: "=&r" (temp), "+m" (*p)
-		: "r" (v)
+		: "=&r" (temp), "=m" (*p)
+		: "r" (v), "m" (*p)
 		: "memory");
 #endif
 }
@@ -204,12 +204,12 @@
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
 		"wmb\n"			/* ensure pending writes have drained */
-		"1:\tldq_l %0,%2\n\t"	/* load current value, asserting lock */
+		"1:\tldq_l %0,%3\n\t"	/* load current value, asserting lock */
 		"ldiq %1,0\n\t"		/* value to store */
 		"stq_c %1,%2\n\t"	/* attempt to store */
 		"beq %1,1b\n"		/* if the store failed, spin */
-		: "=&r"(result), "=&r"(temp), "+m" (*addr)
-		:
+		: "=&r"(result), "=&r"(temp), "=m" (*addr)
+		: "m" (*addr)
 		: "memory");
 #endif
 
@@ -289,15 +289,15 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldl_l %0, %1\n\t"		/* load old value */
+		"1:\tldl_l %0, %4\n\t"		/* load old value */
 		"cmpeq %0, %2, %0\n\t"		/* compare */
 		"beq %0, 2f\n\t"		/* exit if not equal */
 		"mov %3, %0\n\t"		/* value to store */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n\t"		/* if it failed, spin */
 		"2:\n"
-		: "=&r" (ret), "+m" (*p)
-		: "r" ((long)(int)cmpval), "r" (newval)
+		: "=&r" (ret), "=m" (*p)
+		: "r" ((long)(int)cmpval), "r" (newval), "m" (*p)
 		: "memory");
 #endif
 
@@ -316,15 +316,15 @@
 
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile (
-		"1:\tldq_l %0, %1\n\t"		/* load old value */
+		"1:\tldq_l %0, %4\n\t"		/* load old value */
 		"cmpeq %0, %2, %0\n\t"		/* compare */
 		"beq %0, 2f\n\t"		/* exit if not equal */
 		"mov %3, %0\n\t"		/* value to store */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n\t"		/* if it failed, spin */
 		"2:\n"
-		: "=&r" (ret), "+m" (*p)
-		: "r" (cmpval), "r" (newval)
+		: "=&r" (ret), "=m" (*p)
+		: "r" (cmpval), "r" (newval), "m" (*p)
 		: "memory");
 #endif
 

==== //depot/projects/netsmp/src/sys/amd64/include/atomic.h#4 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/atomic.h,v 1.37 2005/08/18 14:36:47 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/atomic.h,v 1.38 2005/09/15 19:31:22 jhb Exp $
  */
 #ifndef _MACHINE_ATOMIC_H_
 #define	_MACHINE_ATOMIC_H_
@@ -99,8 +99,8 @@
 atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
 {							\
 	__asm __volatile(__XSTRING(MPLOCKED) OP		\
-			 : "+m" (*p)			\
-			 : CONS (V));			\
+			 : "=m" (*p)			\
+			 : CONS (V), "m" (*p));		\
 }							\
 struct __hack
 
@@ -119,15 +119,16 @@
 
 	__asm __volatile (
 	"	" __XSTRING(MPLOCKED) "	"
-	"	cmpxchgl %1,%2 ;	"
+	"	cmpxchgl %2,%1 ;	"
 	"       setz	%%al ;		"
 	"	movzbl	%%al,%0 ;	"
 	"1:				"
 	"# atomic_cmpset_int"
-	: "+a" (res)			/* 0 (result) */
-	: "r" (src),			/* 1 */
-	  "m" (*(dst))			/* 2 */
-	: "memory");				 
+	: "+a" (res), 			/* 0 (result) */
+	  "=m" (*dst)			/* 1 */
+	: "r" (src),			/* 2 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }
@@ -139,15 +140,16 @@
 
 	__asm __volatile (
 	"	" __XSTRING(MPLOCKED) "	"
-	"	cmpxchgq %1,%2 ;	"
+	"	cmpxchgq %2,%1 ;	"
 	"       setz	%%al ;		"
 	"	movzbq	%%al,%0 ;	"
 	"1:				"
 	"# atomic_cmpset_long"
-	: "+a" (res)			/* 0 (result) */
-	: "r" (src),			/* 1 */
-	  "m" (*(dst))			/* 2 */
-	: "memory");				 
+	: "+a" (res),			/* 0 (result) */
+	  "=m" (*dst)			/* 1 */
+	: "r" (src),			/* 2 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }
@@ -185,8 +187,9 @@
 							\
 	__asm __volatile(__XSTRING(MPLOCKED) LOP	\
 	: "=a" (res),			/* 0 (result) */\
-	  "+m" (*p)			/* 1 */		\
-	: : "memory");				 	\
+	  "=m" (*p)			/* 1 */		\
+	: "m" (*p)			/* 2 */		\
+	: "memory");				 	\
 							\
 	return (res);					\
 }							\
@@ -198,9 +201,9 @@
 atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
 {							\
 	__asm __volatile(SOP				\
-	: "+m" (*p),			/* 0 */		\
+	: "=m" (*p),			/* 0 */		\
 	  "+r" (v)			/* 1 */		\
-	: : "memory");				 	\
+	: "m" (*p));			/* 2 */		\
 }							\
 struct __hack
 
@@ -246,12 +249,13 @@
 {
 	u_int result;
 
+	result = 0;
 	__asm __volatile (
-	"	xorl	%0,%0 ;		"
 	"	xchgl	%1,%0 ;		"
 	"# atomic_readandclear_int"
-	: "=&r" (result)		/* 0 (result) */
-	: "m" (*addr));			/* 1 (addr) */
+	: "+r" (result),		/* 0 (result) */
+	  "=m" (*addr)			/* 1 (addr) */
+	: "m" (*addr));
 
 	return (result);
 }
@@ -261,12 +265,13 @@
 {
 	u_long result;
 
+	result = 0;
 	__asm __volatile (
-	"	xorq	%0,%0 ;		"
 	"	xchgq	%1,%0 ;		"
 	"# atomic_readandclear_long"
-	: "=&r" (result)		/* 0 (result) */
-	: "m" (*addr));			/* 1 (addr) */
+	: "+r" (result),		/* 0 (result) */
+	  "=m" (*addr)			/* 1 (addr) */
+	: "m" (*addr));
 
 	return (result);
 }

==== //depot/projects/netsmp/src/sys/boot/pc98/boot2/io.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/io.c,v 1.8 2005/05/10 12:02:14 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/io.c,v 1.9 2005/09/14 12:39:06 nyan Exp $");
 
 #include "boot.h"
 #include <machine/cpufunc.h>
@@ -354,7 +354,6 @@
 	int	ret;
 	int	i;
 	int	data = 0;
-	u_char epson_machine_id = *(unsigned char *)V(0xA1624);
 	
 	/* PC98_SYSTEM_PARAMETER(0x501) */
 	ret = ((*(unsigned char*)V(0xA1501)) & 0x08) >> 3;
@@ -390,18 +389,8 @@
 		} else {
 			ret |= M_NOT_H98;
 		}
-	} else {
+	} else
 		ret |= M_NOT_H98;
-		switch (epson_machine_id) {
-		case 0x20:	/* note A */
-		case 0x22:	/* note W */
-		case 0x27:	/* note AE */
-		case 0x2a:	/* note WR */
-			ret |= M_NOTE;
-			break;
-		default:
-			    break;
-		}
-	}
+
 	(*(unsigned long *)V(0xA1620)) = ret;
 }

==== //depot/projects/netsmp/src/sys/cam/cam_xpt.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.155 2005/07/01 15:21:29 avatar Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.156 2005/09/16 01:26:17 mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -45,6 +45,7 @@
 
 #include <sys/lock.h>
 #include <sys/mutex.h>
+#include <sys/sysctl.h>
 
 #ifdef PC98
 #include <pc98/pc98/pc98_machdep.h>	/* geometry translation */
@@ -208,16 +209,31 @@
 	u_int mintags;
 	u_int maxtags;
 };
+
+static int cam_srch_hi = 0;
+TUNABLE_INT("kern.cam.cam_srch_hi", &cam_srch_hi);
+static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS);
+SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
+    sysctl_cam_search_luns, "I",
+    "allow search above LUN 7 for SCSI3 and greater devices");
+
 #define	CAM_SCSI2_MAXLUN	8
 /*
  * If we're not quirked to search <= the first 8 luns
  * and we are either quirked to search above lun 8,
- * or we're > SCSI-2, we can look for luns above lun 8.
+ * or we're > SCSI-2 and we've enabled hilun searching,
+ * or we're > SCSI-2 and the last lun was a success,
+ * we can look for luns above lun 8.
  */
-#define	CAN_SRCH_HI(dv)					\
+#define	CAN_SRCH_HI_SPARSE(dv)				\
+  (((dv->quirk->quirks & CAM_QUIRK_NOHILUNS) == 0) 	\
+  && ((dv->quirk->quirks & CAM_QUIRK_HILUNS)		\
+  || (SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2 && cam_srch_hi)))
+
+#define	CAN_SRCH_HI_DENSE(dv)				\
   (((dv->quirk->quirks & CAM_QUIRK_NOHILUNS) == 0) 	\
   && ((dv->quirk->quirks & CAM_QUIRK_HILUNS)		\
-  || SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2))
+  || (SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2)))
 
 typedef enum {
 	XPT_FLAG_OPEN		= 0x01
@@ -5334,7 +5350,7 @@
 			s = splcam();
 			device = TAILQ_FIRST(&target->ed_entries);
 			if (device != NULL) {
-				phl = CAN_SRCH_HI(device);
+				phl = CAN_SRCH_HI_SPARSE(device);
 				if (device->lun_id == 0)
 					device = TAILQ_NEXT(device, links);
 			}
@@ -5351,7 +5367,7 @@
 			if ((device->quirk->quirks & CAM_QUIRK_NOLUNS) == 0) {
 				/* Try the next lun */
 				if (lun_id < (CAM_SCSI2_MAXLUN-1)
-				  || CAN_SRCH_HI(device))
+				  || CAN_SRCH_HI_DENSE(device))
 					lun_id++;
 			}
 		}
@@ -6115,6 +6131,23 @@
 	device->quirk = (struct xpt_quirk_entry *)match;
 }
 
+static int
+sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS)
+{
+	int error, bool;
+
+	bool = cam_srch_hi;
+	error = sysctl_handle_int(oidp, &bool, sizeof(bool), req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+	if (bool == 0 || bool == 1) {
+		cam_srch_hi = bool;
+		return (0);
+	} else {
+		return (EINVAL);
+	}
+}
+
 #ifdef CAM_NEW_TRAN_CODE
 
 static void

==== //depot/projects/netsmp/src/sys/conf/NOTES#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1328 2005/07/27 21:47:55 pjd Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1329 2005/09/15 13:28:33 phk Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -1999,13 +1999,17 @@
 
 #
 # IEEE-488 hardware:
-#	pcii:	PCIIA cards (uPD7210 based isa cards)
+# pcii:		PCIIA cards (uPD7210 based isa cards)
+# tnt4882:	National Instruments PCI-GPIB card.
+
 device	pcii
 hint.pcii.0.at="isa"
 hint.pcii.0.port="0x2e1"
 hint.pcii.0.irq="5"
 hint.pcii.0.drq="1"
 
+device	tnt4882
+
 #
 # Miscellaneous hardware:
 #

==== //depot/projects/netsmp/src/sys/conf/files#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1047 2005/09/11 03:38:18 obrien Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1048 2005/09/15 13:28:33 phk Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -648,9 +648,12 @@
 dev/ida/ida_pci.c		optional ida pci
 dev/ie/if_ie.c			optional ie isa nowerror
 dev/ie/if_ie_isa.c		optional ie isa
-dev/ieee488/ibfoo.c		optional pcii
-dev/ieee488/pcii.c		optional pcii
+dev/ieee488/ibfoo.c		optional pcii 
+dev/ieee488/ibfoo.c		optional tnt4882
+dev/ieee488/pcii.c		optional pcii 
+dev/ieee488/tnt4882.c		optional tnt4882
 dev/ieee488/upd7210.c		optional pcii
+dev/ieee488/upd7210.c		optional tnt4882
 dev/iicbus/if_ic.c		optional ic
 dev/iicbus/iic.c		optional iic
 dev/iicbus/iicbb.c		optional iicbb

==== //depot/projects/netsmp/src/sys/dev/aac/aac.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.109 2005/06/01 07:11:17 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.110 2005/09/14 05:46:28 scottl Exp $");
 
 /*
  * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -925,7 +925,7 @@
 	cm->cm_datalen = bp->bio_bcount;
 	cm->cm_complete = aac_bio_complete;
 	cm->cm_private = bp;
-	cm->cm_timestamp = time_second;
+	cm->cm_timestamp = time_uptime;
 	cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
 
 	/* build the FIB */
@@ -1426,7 +1426,7 @@
 	/*
 	 * First wait for the adapter to come ready.
 	 */
-	then = time_second;
+	then = time_uptime;
 	do {
 		code = AAC_GET_FWSTATUS(sc);
 		if (code & AAC_SELF_TEST_FAILED) {
@@ -1438,7 +1438,7 @@
 				      "FATAL: controller kernel panic\n");
 			return(ENXIO);
 		}
-		if (time_second > (then + AAC_BOOT_TIMEOUT)) {
+		if (time_uptime > (then + AAC_BOOT_TIMEOUT)) {
 			device_printf(sc->aac_dev,
 				      "FATAL: controller not coming ready, "
 					   "status %x\n", code);
@@ -1573,7 +1573,7 @@
 		ip->HostPhysMemPages =
 		    (ip->HostPhysMemPages + AAC_PAGE_SIZE) / AAC_PAGE_SIZE;
 	}
-	ip->HostElapsedSeconds = time_second;	/* reset later if invalid */
+	ip->HostElapsedSeconds = time_uptime;	/* reset later if invalid */
 
 	/*
 	 * Initialise FIB queues.  Note that it appears that the layout of the
@@ -1701,9 +1701,9 @@
 	AAC_QNOTIFY(sc, AAC_DB_SYNC_COMMAND);
 
 	/* spin waiting for the command to complete */
-	then = time_second;
+	then = time_uptime;
 	do {
-		if (time_second > (then + AAC_IMMEDIATE_TIMEOUT)) {
+		if (time_uptime > (then + AAC_IMMEDIATE_TIMEOUT)) {
 			debug(1, "timed out");
 			return(EIO);
 		}
@@ -1997,14 +1997,14 @@
 	 * only.
 	 */
 	timedout = 0;
-	deadline = time_second - AAC_CMD_TIMEOUT;
+	deadline = time_uptime - AAC_CMD_TIMEOUT;
 	TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) {
 		if ((cm->cm_timestamp  < deadline)
 			/* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) {
 			cm->cm_flags |= AAC_CMD_TIMEDOUT;
 			device_printf(sc->aac_dev,
 				      "COMMAND %p TIMEOUT AFTER %d SECONDS\n",
-				      cm, (int)(time_second-cm->cm_timestamp));
+				      cm, (int)(time_uptime-cm->cm_timestamp));
 			AAC_PRINT_FIB(sc, cm->cm_fib);
 			timedout++;
 		}
@@ -2602,7 +2602,7 @@
 	if ((error = copyin(ufib, cm->cm_fib, size)) != 0)
 		goto out;
 	cm->cm_fib->Header.Size = size;
-	cm->cm_timestamp = time_second;
+	cm->cm_timestamp = time_uptime;
 
 	/*
 	 * Pass the FIB to the controller, wait for it to complete.

==== //depot/projects/netsmp/src/sys/dev/aac/aac_cam.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.20 2005/02/09 11:47:05 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.21 2005/09/14 05:49:34 scottl Exp $");
 
 /*
  * CAM front-end for communicating with non-DASD devices
@@ -397,7 +397,7 @@
 
 	cm->cm_complete = aac_cam_complete;
 	cm->cm_private = ccb;
-	cm->cm_timestamp = time_second;
+	cm->cm_timestamp = time_uptime;
 	cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
 
 	fib->Header.XferState =

==== //depot/projects/netsmp/src/sys/dev/acpica/acpi_pcib_acpi.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.48 2005/09/11 18:39:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.49 2005/09/16 07:02:29 imp Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -322,6 +322,8 @@
      */
     if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
 	start = acpi_host_mem_start;
+    if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
+	start = 0x1000;
     return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
 	count, flags));
 }

==== //depot/projects/netsmp/src/sys/dev/ata/ata-all.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.256 2005/08/29 18:19:06 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.257 2005/09/14 12:45:06 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -158,7 +158,7 @@
     device_t *children;
     int nchildren, i;
 
-    /* check that we have a vaild channel to detach */
+    /* check that we have a valid channel to detach */
     if (!ch->r_irq)
 	return ENXIO;
 
@@ -183,10 +183,11 @@
 ata_reinit(device_t dev)
 {
     struct ata_channel *ch = device_get_softc(dev);
+    struct ata_request *request;
     device_t *children;
     int nchildren, i;
 
-    /* check that we have a vaild channel to reinit */
+    /* check that we have a valid channel to reinit */
     if (!ch || !ch->r_irq)
 	return ENXIO;
 
@@ -216,12 +217,25 @@
 		     * this child we need to inform the request that the 
 		     * device is gone and remove it from ch->running
 		     */
+		    mtx_lock(&ch->state_mtx);
 		    if (ch->running && ch->running->dev == children[i]) {
-			device_printf(ch->running->dev,
+			callout_stop(&ch->running->callout);
+			request = ch->running;
+    			ch->running = NULL;
+		    }
+		    else
+			request = NULL;
+    		    mtx_unlock(&ch->state_mtx);
+
+		    if (request) {
+			request->result = ENXIO;
+			device_printf(request->dev,
 				      "FAILURE - device detached\n");
-			ch->running->dev = NULL;
-			ch->running = NULL;
-		    }
+
+			/* if not timeout finish request here */
+			if (!(request->flags & ATA_R_TIMEOUT))
+			    ata_finish(request);
+                    }
 		    device_delete_child(dev, children[i]);
 		}
 	}
@@ -230,7 +244,23 @@
     }
 
     /* catch request in ch->running if we havn't already */
-    ata_catch_inflight(dev);
+    mtx_lock(&ch->state_mtx);
+    if ((request = ch->running))
+	callout_stop(&request->callout);
+    ch->running = NULL;
+    mtx_unlock(&ch->state_mtx);
+
+    /* if we got one put it on the queue again */
+    if (request) {
+	device_printf(request->dev,
+		      "WARNING - %s requeued due to channel reset",
+		      ata_cmd2str(request));
+	if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
+	    printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
+	printf("\n");
+	request->flags |= ATA_R_REQUEUE;
+	ata_queue_request(request);
+    }
 
     /* we're done release the channel for new work */
     mtx_lock(&ch->state_mtx);
@@ -297,7 +327,7 @@
     mtx_lock(&ch->state_mtx);
     do {
 	/* do we have a running request */
-	if (!(request = ch->running) || (request->flags & ATA_R_TIMEOUT))
+	if (!(request = ch->running))
 	    break;
 
 	ATA_DEBUG_RQ(request, "interrupt");
@@ -311,8 +341,7 @@
 
 	/* check for the right state */
 	if (ch->state != ATA_ACTIVE && ch->state != ATA_STALL_QUEUE) {
-	    device_printf(request->dev,
-			  "interrupt state=%d unexpected\n", ch->state);
+	    device_printf(request->dev, "interrupt on idle channel ignored\n");
 	    break;
 	}
 

==== //depot/projects/netsmp/src/sys/dev/ata/ata-chipset.c#6 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.132 2005/08/29 09:01:57 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.133 2005/09/14 12:45:06 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -313,13 +313,12 @@
 ata_sata_phy_event(void *context, int dummy)
 {
     struct ata_connect_task *tp = (struct ata_connect_task *)context;
+    struct ata_channel *ch = device_get_softc(tp->dev);
     device_t *children;
     int nchildren, i;
 
     mtx_lock(&Giant);   /* newbus suckage it needs Giant */
     if (tp->action == ATA_C_ATTACH) {
-	struct ata_channel *ch = device_get_softc(tp->dev);
-
 	device_printf(tp->dev, "CONNECTED\n");
 	ata_sata_connect(ch);
 	ata_identify(tp->dev);
@@ -331,6 +330,9 @@
 		    device_delete_child(tp->dev, children[i]);
 	    free(children, M_TEMP);
 	}    
+	mtx_lock(&ch->state_mtx);
+	ch->state = ATA_IDLE;
+	mtx_unlock(&ch->state_mtx);
 	device_printf(tp->dev, "DISCONNECTED\n");
     }
     mtx_unlock(&Giant); /* suckage code dealt with, release Giant */

==== //depot/projects/netsmp/src/sys/dev/ata/ata-lowlevel.c#3 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.70 2005/08/17 15:00:33 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.71 2005/09/14 12:45:06 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -117,7 +117,8 @@
 	    /* if write command output the data */
 	    if (write) {
 		if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) {
-		    device_printf(request->dev,"timeout waiting for write DRQ");
+		    device_printf(request->dev,
+				  "timeout waiting for write DRQ\n");
 		    request->result = EIO;
 		    goto begin_finished;
 		}
@@ -278,7 +279,8 @@
 	    /* if read data get it */
 	    if (request->flags & ATA_R_READ) {
 		if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) {
-		    device_printf(request->dev, "timeout waiting for read DRQ");
+		    device_printf(request->dev,
+				  "timeout waiting for read DRQ\n");
 		    request->result = EIO;
 		    goto end_finished;
 		}
@@ -302,7 +304,7 @@
 		    /* if we get an error here we are done with the HW */
 		    if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) {
 			device_printf(request->dev,
-				      "timeout waiting for write DRQ");
+				      "timeout waiting for write DRQ\n");
 			request->status = ATA_IDX_INB(ch, ATA_STATUS);
 			goto end_finished;
 		    }

>>> TRUNCATED FOR MAIL (1000 lines) <<<



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