changeset 3124:1e9433216d87

6352976 SUNWckr pkgchk error for /etc/crypto/kcf.conf in Nevada nightly 11/18/05 6427539 Warning message during CD installation of SUNWdcar 6486793 DCA driver has problem with the 5825
author qs148142
date Wed, 15 Nov 2006 14:35:00 -0800
parents 8be00d188612
children 084bca4d4623
files usr/src/pkgdefs/SUNWdcar/postinstall usr/src/pkgdefs/SUNWdcar/preremove usr/src/uts/common/crypto/io/dca.c usr/src/uts/common/sys/crypto/dca.h
diffstat 4 files changed, 62 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkgdefs/SUNWdcar/postinstall	Wed Nov 15 14:17:46 2006 -0800
+++ b/usr/src/pkgdefs/SUNWdcar/postinstall	Wed Nov 15 14:35:00 2006 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -67,11 +67,11 @@
 	exit 2
 fi
 
+# to preserve the gid
+cp -p $kcfconf $tmpfile || error=yes
 if [ $start -eq 1 ]
 then
 	sed -e "/$pkg_start/,/$pkg_end/d" $kcfconf > $tmpfile || error=yes
-else
-	cp $kcfconf $tmpfile || error=yes
 fi
 
 #
@@ -100,11 +100,35 @@
 
 NAMEMAJOR="${BASEDIR}/etc/name_to_major"
 
+#
+# Is the hardware there?
+#
+check_hardware()
+{
+	for i in "pci14e4,5820" "pci14e4,5821" "pci14e4,5822" "pci14e4,5825" \
+		"pci108e,5454" "pci108e,5455" "pci108e,5456" "pci108e,5457"
+	do
+		prtconf -pv | egrep -s "$i"
+		if [ $? -eq 0 ]
+		then
+			return 1
+		fi
+	done
+	return 0
+}
+
+hw_opt=
+check_hardware
+if [ $? -eq 0 ]
+then
+	hw_opt="-n"
+fi
+
 if [ "${BASEDIR:=/}" = "/" ]
 then
-	ADD_DRV="/usr/sbin/add_drv"
+	ADD_DRV="/usr/sbin/add_drv $hw_opt"
 else
-	ADD_DRV="/usr/sbin/add_drv -b ${BASEDIR}"
+	ADD_DRV="/usr/sbin/add_drv $hw_opt -b ${BASEDIR}"
 fi
 
 grep -w dca ${NAMEMAJOR} > /dev/null 2>&1
--- a/usr/src/pkgdefs/SUNWdcar/preremove	Wed Nov 15 14:17:46 2006 -0800
+++ b/usr/src/pkgdefs/SUNWdcar/preremove	Wed Nov 15 14:35:00 2006 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -86,6 +86,8 @@
 
 if [ $start -eq 1 ]
 then
+	# To preserve the gid
+	cp -p $kcfconf $tmpfile
 	sed -e "/$pkg_start/,/$pkg_end/d" $kcfconf > $tmpfile || error=yes
 	if [ "$error" = no ]
 	then 
--- a/usr/src/uts/common/crypto/io/dca.c	Wed Nov 15 14:17:46 2006 -0800
+++ b/usr/src/uts/common/crypto/io/dca.c	Wed Nov 15 14:35:00 2006 -0800
@@ -695,6 +695,7 @@
 		if (subvenid && (subvenid == dca_devices[i].dd_vendor_id) &&
 		    subsysid && (subsysid == dca_devices[i].dd_device_id)) {
 			dca->dca_model = dca_devices[i].dd_model;
+			dca->dca_devid = dca_devices[i].dd_device_id;
 			break;
 		}
 		/*
@@ -706,6 +707,7 @@
 		if ((venid == dca_devices[i].dd_vendor_id) &&
 		    (devid == dca_devices[i].dd_device_id)) {
 			dca->dca_model = dca_devices[i].dd_model;
+			dca->dca_devid = dca_devices[i].dd_device_id;
 		}
 	}
 	/* try and handle an unrecognized device */
@@ -790,7 +792,14 @@
 	 * we always want to run in full-speed mode, this should be
 	 * harmless.
 	 */
-	SETBIT(dca, CSR_DMACTL, DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE);
+	if (dca->dca_devid == 0x5825) {
+		/* for 5825 - increase the DMA read size */
+		SETBIT(dca, CSR_DMACTL,
+		    DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE | DMACTL_RD256);
+	} else {
+		SETBIT(dca, CSR_DMACTL,
+		    DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE);
+	}
 	if (dca_check_acc_handle(dca, dca->dca_regs_handle,
 	    DCA_FM_ECLASS_NONE) != DDI_SUCCESS) {
 		goto failed;
@@ -1026,7 +1035,14 @@
 		return (DDI_FAILURE);
 
 	/* restore interrupt enables */
-	SETBIT(dca, CSR_DMACTL, DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE);
+	if (dca->dca_devid == 0x5825) {
+		/* for 5825 set 256 byte read size to improve performance */
+		SETBIT(dca, CSR_DMACTL,
+		    DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE | DMACTL_RD256);
+	} else {
+		SETBIT(dca, CSR_DMACTL,
+		    DMACTL_MCR1IE | DMACTL_MCR2IE | DMACTL_EIE);
+	}
 	if (dca_check_acc_handle(dca, dca->dca_regs_handle,
 	    DCA_FM_ECLASS_NONE) != DDI_SUCCESS)
 		return (DDI_FAILURE);
@@ -1104,6 +1120,7 @@
 	mutex_init(&wlp->dwl_lock, NULL, MUTEX_DRIVER, dca->dca_icookie);
 	mutex_init(&wlp->dwl_freereqslock, NULL, MUTEX_DRIVER,
 	    dca->dca_icookie);
+	mutex_init(&wlp->dwl_freelock, NULL, MUTEX_DRIVER, dca->dca_icookie);
 	cv_init(&wlp->dwl_cv, NULL, CV_DRIVER, NULL);
 
 	mutex_enter(&wlp->dwl_lock);
@@ -1226,6 +1243,7 @@
 
 		mutex_destroy(&wlp->dwl_lock);
 		mutex_destroy(&wlp->dwl_freereqslock);
+		mutex_destroy(&wlp->dwl_freelock);
 		cv_destroy(&wlp->dwl_cv);
 		wlp->dwl_prov = NULL;
 	}
@@ -1806,8 +1824,9 @@
 	dca_worklist_t	*wlp = WORKLIST(dca, mcr);
 	dca_work_t	*workp;
 
-	ASSERT(mutex_owned(&wlp->dwl_lock));
+	mutex_enter(&wlp->dwl_freelock);
 	workp = (dca_work_t *)dca_dequeue(&wlp->dwl_freework);
+	mutex_exit(&wlp->dwl_freelock);
 	if (workp) {
 		int	nreqs;
 		bzero(workp->dw_mcr_kaddr, 8);
@@ -1823,8 +1842,9 @@
 void
 dca_freework(dca_work_t *workp)
 {
-	ASSERT(mutex_owned(&workp->dw_wlp->dwl_lock));
+	mutex_enter(&workp->dw_wlp->dwl_freelock);
 	dca_enqueue(&workp->dw_wlp->dwl_freework, (dca_listnode_t *)workp);
+	mutex_exit(&workp->dw_wlp->dwl_freelock);
 }
 
 dca_request_t *
@@ -2377,10 +2397,10 @@
 			nreclaimed++;
 		}
 
-		mutex_enter(&wlp->dwl_lock);
-
 		/* now we can release the work */
 		dca_freework(workp);
+
+		mutex_enter(&wlp->dwl_lock);
 	}
 	DBG(dca, DRECLAIM, "reclaimed %d cmds", nreclaimed);
 }
--- a/usr/src/uts/common/sys/crypto/dca.h	Wed Nov 15 14:17:46 2006 -0800
+++ b/usr/src/uts/common/sys/crypto/dca.h	Wed Nov 15 14:35:00 2006 -0800
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -352,6 +352,7 @@
 	char			dwl_name[16];
 	int			dwl_mcr;
 	kmutex_t		dwl_lock;
+	kmutex_t		dwl_freelock;
 	kmutex_t		dwl_freereqslock;
 	kcondvar_t		dwl_cv;
 	dca_listnode_t		dwl_freereqs;	/* available requests */
@@ -469,6 +470,7 @@
 	 * hardware model
 	 */
 	char			*dca_model;
+	ushort_t		dca_devid;
 
 	/*
 	 * Kstats.  There is no standard for what standards
@@ -585,6 +587,7 @@
 #define	DMACTL_RNG8		0x01000000U	/* 1 RNG bit per 8 cycles */
 #define	DMACTL_RNG16		0x01800000U	/* 1 RNG bit per 16 cycles */
 #define	DMACTL_MODNORM		0x00400000U	/* s/w modulus normalization */
+#define	DMACTL_RD256		0x00020000U	/* 256 byte read DMA size */
 #define	DMACTL_FRAGMASK		0x0000FFFFU	/* output fragment size */
 
 #define	DMASTAT_MAIP		0x80000000U	/* master access in progress */