Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2013 12:15:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253960 - head/sys/cam
Message-ID:  <201308051215.r75CFsOR071015@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Aug  5 12:15:53 2013
New Revision: 253960
URL: http://svnweb.freebsd.org/changeset/base/253960

Log:
  MFprojects/camlock r249006:
  Pass SIM pointer as an argument to camisr_runqueue() instead of doneq
  pointer.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Mon Aug  5 11:56:47 2013	(r253959)
+++ head/sys/cam/cam_xpt.c	Mon Aug  5 12:15:53 2013	(r253960)
@@ -246,7 +246,7 @@ static xpt_devicefunc_t xptpassannouncef
 static void	 xptaction(struct cam_sim *sim, union ccb *work_ccb);
 static void	 xptpoll(struct cam_sim *sim);
 static void	 camisr(void *);
-static void	 camisr_runqueue(void *);
+static void	 camisr_runqueue(struct cam_sim *);
 static dev_match_ret	xptbusmatch(struct dev_match_pattern *patterns,
 				    u_int num_patterns, struct cam_eb *bus);
 static dev_match_ret	xptdevicematch(struct dev_match_pattern *patterns,
@@ -3052,7 +3052,7 @@ xpt_polled_action(union ccb *start_ccb)
 	   dev->ccbq.dev_openings < 0) && (--timeout > 0)) {
 		DELAY(100);
 		(*(sim->sim_poll))(sim);
-		camisr_runqueue(&sim->sim_doneq);
+		camisr_runqueue(sim);
 	}
 
 	dev->ccbq.devq_openings++;
@@ -3062,7 +3062,7 @@ xpt_polled_action(union ccb *start_ccb)
 		xpt_action(start_ccb);
 		while(--timeout > 0) {
 			(*(sim->sim_poll))(sim);
-			camisr_runqueue(&sim->sim_doneq);
+			camisr_runqueue(sim);
 			if ((start_ccb->ccb_h.status  & CAM_STATUS_MASK)
 			    != CAM_REQ_INPROG)
 				break;
@@ -4309,7 +4309,7 @@ xpt_batch_done(struct cam_sim *sim)
 	sim->flags &= ~CAM_SIM_BATCH;
 	if (!TAILQ_EMPTY(&sim->sim_doneq) &&
 	    (sim->flags & CAM_SIM_ON_DONEQ) == 0)
-		camisr_runqueue(&sim->sim_doneq);
+		camisr_runqueue(sim);
 }
 
 union ccb *
@@ -4929,7 +4929,7 @@ camisr(void *dummy)
 		while ((sim = TAILQ_FIRST(&queue)) != NULL) {
 			TAILQ_REMOVE(&queue, sim, links);
 			CAM_SIM_LOCK(sim);
-			camisr_runqueue(&sim->sim_doneq);
+			camisr_runqueue(sim);
 			sim->flags &= ~CAM_SIM_ON_DONEQ;
 			CAM_SIM_UNLOCK(sim);
 		}
@@ -4939,15 +4939,14 @@ camisr(void *dummy)
 }
 
 static void
-camisr_runqueue(void *V_queue)
+camisr_runqueue(struct cam_sim *sim)
 {
-	cam_isrq_t *queue = V_queue;
 	struct	ccb_hdr *ccb_h;
 
-	while ((ccb_h = TAILQ_FIRST(queue)) != NULL) {
+	while ((ccb_h = TAILQ_FIRST(&sim->sim_doneq)) != NULL) {
 		int	runq;
 
-		TAILQ_REMOVE(queue, ccb_h, sim_links.tqe);
+		TAILQ_REMOVE(&sim->sim_doneq, ccb_h, sim_links.tqe);
 		ccb_h->pinfo.index = CAM_UNQUEUED_INDEX;
 
 		CAM_DEBUG(ccb_h->path, CAM_DEBUG_TRACE,
@@ -4989,8 +4988,8 @@ camisr_runqueue(void *V_queue)
 			dev = ccb_h->path->device;
 
 			cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h);
-			ccb_h->path->bus->sim->devq->send_active--;
-			ccb_h->path->bus->sim->devq->send_openings++;
+			sim->devq->send_active--;
+			sim->devq->send_openings++;
 			runq = TRUE;
 
 			if (((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0
@@ -5011,14 +5010,12 @@ camisr_runqueue(void *V_queue)
 			 && (--dev->tag_delay_count == 0))
 				xpt_start_tags(ccb_h->path);
 			if (!device_is_queued(dev)) {
-				(void)xpt_schedule_devq(
-				    ccb_h->path->bus->sim->devq, dev);
+				(void)xpt_schedule_devq(sim->devq, dev);
 			}
 		}
 
 		if (ccb_h->status & CAM_RELEASE_SIMQ) {
-			xpt_release_simq(ccb_h->path->bus->sim,
-					 /*run_queue*/TRUE);
+			xpt_release_simq(sim, /*run_queue*/TRUE);
 			ccb_h->status &= ~CAM_RELEASE_SIMQ;
 			runq = FALSE;
 		}
@@ -5029,7 +5026,7 @@ camisr_runqueue(void *V_queue)
 					 /*run_queue*/TRUE);
 			ccb_h->status &= ~CAM_DEV_QFRZN;
 		} else if (runq) {
-			xpt_run_devq(ccb_h->path->bus->sim->devq);
+			xpt_run_devq(sim->devq);
 		}
 
 		/* Call the peripheral driver's callback */



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