From owner-svn-src-projects@FreeBSD.ORG Mon Oct 21 09:51:07 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 37E0D1DB; Mon, 21 Oct 2013 09:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24F6E29F8; Mon, 21 Oct 2013 09:51:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L9p7VU087395; Mon, 21 Oct 2013 09:51:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L9p6ID087392; Mon, 21 Oct 2013 09:51:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310210951.r9L9p6ID087392@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 09:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256840 - projects/camlock/sys/cam X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 09:51:07 -0000 Author: mav Date: Mon Oct 21 09:51:06 2013 New Revision: 256840 URL: http://svnweb.freebsd.org/changeset/base/256840 Log: Collect some garbage left after several code refactorings. Modified: projects/camlock/sys/cam/cam_sim.c projects/camlock/sys/cam/cam_sim.h projects/camlock/sys/cam/cam_xpt.c Modified: projects/camlock/sys/cam/cam_sim.c ============================================================================== --- projects/camlock/sys/cam/cam_sim.c Mon Oct 21 09:34:04 2013 (r256839) +++ projects/camlock/sys/cam/cam_sim.c Mon Oct 21 09:51:06 2013 (r256840) @@ -95,9 +95,6 @@ cam_sim_alloc(sim_action_func sim_action sim->flags |= CAM_SIM_MPSAFE; callout_init(&sim->callout, 1); } - mtx_init(&sim->sim_doneq_mtx, "CAM doneq", NULL, MTX_DEF); - TAILQ_INIT(&sim->sim_doneq); - return (sim); } @@ -117,7 +114,6 @@ cam_sim_free(struct cam_sim *sim, int fr if (free_devq) cam_simq_free(sim->devq); - mtx_destroy(&sim->sim_doneq_mtx); free(sim, M_CAMSIM); } Modified: projects/camlock/sys/cam/cam_sim.h ============================================================================== --- projects/camlock/sys/cam/cam_sim.h Mon Oct 21 09:34:04 2013 (r256839) +++ projects/camlock/sys/cam/cam_sim.h Mon Oct 21 09:51:06 2013 (r256840) @@ -110,11 +110,6 @@ struct cam_sim { struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ - int sim_doneq_flags; -#define CAM_SIM_DQ_ONQ 0x04 -#define CAM_SIM_DQ_POLLED 0x08 -#define CAM_SIM_DQ_BATCH 0x10 - struct mtx sim_doneq_mtx; }; #define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx) Modified: projects/camlock/sys/cam/cam_xpt.c ============================================================================== --- projects/camlock/sys/cam/cam_xpt.c Mon Oct 21 09:34:04 2013 (r256839) +++ projects/camlock/sys/cam/cam_xpt.c Mon Oct 21 09:51:06 2013 (r256840) @@ -258,7 +258,7 @@ static int xpt_schedule_dev(struct camq static xpt_devicefunc_t xptpassannouncefunc; static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); -static void camisr_runqueue(struct cam_sim *); +static void camisr_runqueue(void); static void xpt_done_process(struct ccb_hdr *ccb_h); static void xpt_done_td(void *); static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, @@ -3012,11 +3012,6 @@ xpt_polled_action(union ccb *start_ccb) mtx_unlock(&dev->device_mtx); - /* Don't use ISR for this SIM while polling. */ - mtx_lock(&sim->sim_doneq_mtx); - sim->sim_doneq_flags |= CAM_SIM_DQ_POLLED; - mtx_unlock(&sim->sim_doneq_mtx); - /* * Steal an opening so that no other queued requests * can get it before us while we simulate interrupts. @@ -3031,7 +3026,7 @@ xpt_polled_action(union ccb *start_ccb) CAM_SIM_LOCK(sim); (*(sim->sim_poll))(sim); CAM_SIM_UNLOCK(sim); - camisr_runqueue(sim); + camisr_runqueue(); mtx_lock(&devq->send_mtx); } dev->ccbq.devq_openings++; @@ -3044,7 +3039,7 @@ xpt_polled_action(union ccb *start_ccb) CAM_SIM_LOCK(sim); (*(sim->sim_poll))(sim); CAM_SIM_UNLOCK(sim); - camisr_runqueue(sim); + camisr_runqueue(); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; @@ -3063,11 +3058,6 @@ xpt_polled_action(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; } - /* We will use CAM ISR for this SIM again. */ - mtx_lock(&sim->sim_doneq_mtx); - sim->sim_doneq_flags &= ~CAM_SIM_DQ_POLLED; - mtx_unlock(&sim->sim_doneq_mtx); - camisr_runqueue(sim); mtx_lock(&dev->device_mtx); } @@ -5289,24 +5279,12 @@ xpt_done_td(void *arg) } static void -camisr_runqueue(struct cam_sim *sim) +camisr_runqueue(void) { struct ccb_hdr *ccb_h; struct cam_doneq *queue; int i; - /* Process per-SIM queue. */ - mtx_lock(&sim->sim_doneq_mtx); - while ((ccb_h = TAILQ_FIRST(&sim->sim_doneq)) != NULL) { - TAILQ_REMOVE(&sim->sim_doneq, ccb_h, sim_links.tqe); - mtx_unlock(&sim->sim_doneq_mtx); - ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; - xpt_done_process(ccb_h); - mtx_lock(&sim->sim_doneq_mtx); - } - sim->sim_doneq_flags &= ~CAM_SIM_DQ_ONQ; - mtx_unlock(&sim->sim_doneq_mtx); - /* Process global queues. */ for (i = 0; i < cam_num_doneqs; i++) { queue = &cam_doneqs[i];