From owner-svn-src-stable@FreeBSD.ORG Mon Jan 2 17:38:07 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 756801065670; Mon, 2 Jan 2012 17:38:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4936E8FC0C; Mon, 2 Jan 2012 17:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02Hc7V4077807; Mon, 2 Jan 2012 17:38:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02Hc75F077804; Mon, 2 Jan 2012 17:38:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201021738.q02Hc75F077804@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jan 2012 17:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229298 - in stable/8/sys: cam conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 17:38:07 -0000 Author: mav Date: Mon Jan 2 17:38:06 2012 New Revision: 229298 URL: http://svn.freebsd.org/changeset/base/229298 Log: MFC r227637: Introduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode. It blocks CAM SWI usage on requests completion, unneeded because of polling and denied during kernel dumping because of blocked scheduler. Before r198899 there was periph flag CAM_PERIPH_POLLED, but that was wrong, because there is whole SIM is polled or handled by SWI, not a single periph. Modified: stable/8/sys/cam/cam_sim.h stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/conf/ldscript.mips.octeon1.32 (props changed) stable/8/sys/conf/ldscript.mips.octeon1.64 (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/cam_sim.h ============================================================================== --- stable/8/sys/cam/cam_sim.h Mon Jan 2 17:36:14 2012 (r229297) +++ stable/8/sys/cam/cam_sim.h Mon Jan 2 17:38:06 2012 (r229298) @@ -104,7 +104,8 @@ struct cam_sim { u_int32_t flags; #define CAM_SIM_REL_TIMEOUT_PENDING 0x01 #define CAM_SIM_MPSAFE 0x02 -#define CAM_SIM_ON_DONEQ 0x04 +#define CAM_SIM_ON_DONEQ 0x04 +#define CAM_SIM_POLLED 0x08 struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Mon Jan 2 17:36:14 2012 (r229297) +++ stable/8/sys/cam/cam_xpt.c Mon Jan 2 17:38:06 2012 (r229298) @@ -2903,6 +2903,9 @@ xpt_polled_action(union ccb *start_ccb) mtx_assert(sim->mtx, MA_OWNED); + /* Don't use ISR for this SIM while polling. */ + sim->flags |= CAM_SIM_POLLED; + /* * Steal an opening so that no other queued requests * can get it before us while we simulate interrupts. @@ -2942,6 +2945,9 @@ xpt_polled_action(union ccb *start_ccb) } else { start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; } + + /* We will use CAM ISR for this SIM again. */ + sim->flags &= ~CAM_SIM_POLLED; } /* @@ -4103,7 +4109,7 @@ xpt_done(union ccb *done_ccb) TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - if ((sim->flags & CAM_SIM_ON_DONEQ) == 0) { + if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) { mtx_lock(&cam_simq_lock); first = TAILQ_EMPTY(&cam_simq); TAILQ_INSERT_TAIL(&cam_simq, sim, links);