Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2007 15:09:34 GMT
From:      Matt Jacob <mjacob@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 118729 for review
Message-ID:  <200704241509.l3OF9Ylj021167@repoman.freebsd.org>

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

Change 118729 by mjacob@mjexp on 2007/04/24 15:09:27

	Fix a couple LORs in isp_attach. Stop a couple of pcmd leaks.
	Fix an oops about RELENG_4- sim_action is called at softcam-
	not cam, so we have to raise priority for RELENG_4.

Affected files ...

.. //depot/projects/mjexp/sys/dev/isp/isp_freebsd.c#21 edit

Differences ...

==== //depot/projects/mjexp/sys/dev/isp/isp_freebsd.c#21 (text+ko) ====

@@ -219,8 +219,11 @@
 	/*
 	 * Create device nodes
 	 */
+	ISP_UNLOCK(isp);
 	(void) make_dev(&isp_cdevsw, device_get_unit(isp->isp_dev), UID_ROOT,
 	    GID_OPERATOR, 0600, "%s", device_get_nameunit(isp->isp_dev));
+	isp_sysctl_update(isp);
+	ISP_LOCK(isp);
 
 	if (isp->isp_role != ISP_ROLE_NONE) {
 		isp->isp_state = ISP_RUNSTATE;
@@ -235,9 +238,6 @@
 		}
 		tmp->isp_osinfo.next = isp;
 	}
-	ISP_UNLOCK(isp);
-	isp_sysctl_update(isp);
-	ISP_LOCK(isp);
 
 	/*
 	 * Create a kernel thread for fibre channel instances.
@@ -2052,6 +2052,7 @@
 		if (XS_CMD_DONE_P(xs)) {
 			isp_prt(isp, ISP_LOGDEBUG2,
 			    "watchdog cleanup for handle 0x%x", handle);
+			isp_free_pcmd(isp, (union ccb *)xs);
 			xpt_done((union ccb *) xs);
 		} else if (XS_CMD_GRACE_P(xs)) {
 			/*
@@ -2386,9 +2387,22 @@
 #endif
 }
 
+#if __FreeBSD_version < 500000  
+static void isp_action_wrk(struct cam_sim *, union ccb *);
 static void
 isp_action(struct cam_sim *sim, union ccb *ccb)
 {
+	ispsoftc_t *isp = (ispsoftc_t *)cam_sim_softc(sim);
+	ISP_LOCK(isp);
+	isp_action_wrk(sim, ccb);
+	ISP_UNLOCK(isp);
+}
+#define	isp_action isp_action_wrk
+#endif
+
+static void
+isp_action(struct cam_sim *sim, union ccb *ccb)
+{
 	int bus, tgt, ts, error, lim;
 	ispsoftc_t *isp;
 	struct ccb_trans_settings *cts;
@@ -2493,22 +2507,23 @@
 			cam_release_devq(ccb->ccb_h.path,
 			    RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0);
 			XS_SETERR(ccb, CAM_REQUEUE_REQ);
+			isp_free_pcmd(isp, ccb);
 			xpt_done(ccb);
 			break;
 		case CMD_EAGAIN:
+			XS_SETERR(ccb, CAM_REQUEUE_REQ);
 			isp_free_pcmd(isp, ccb);
-			XS_SETERR(ccb, CAM_REQUEUE_REQ);
 			xpt_done(ccb);
 			break;
 		case CMD_COMPLETE:
 			isp_done((struct ccb_scsiio *) ccb);
 			break;
 		default:
-			isp_free_pcmd(isp, ccb);
 			isp_prt(isp, ISP_LOGERR,
 			    "What's this? 0x%x at %d in file %s",
 			    error, __LINE__, __FILE__);
 			XS_SETERR(ccb, CAM_REQ_CMP_ERR);
+			isp_free_pcmd(isp, ccb);
 			xpt_done(ccb);
 		}
 		break;



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