From owner-svn-src-stable@FreeBSD.ORG Tue Nov 17 21:09:47 2009 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 BB5321065676; Tue, 17 Nov 2009 21:09:47 +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 AA01F8FC13; Tue, 17 Nov 2009 21:09:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHL9l1d039041; Tue, 17 Nov 2009 21:09:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHL9lO8039036; Tue, 17 Nov 2009 21:09:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911172109.nAHL9lO8039036@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Nov 2009 21:09:47 +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: r199444 - in stable/8/sys/cam: . ata scsi 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: Tue, 17 Nov 2009 21:09:47 -0000 Author: mav Date: Tue Nov 17 21:09:47 2009 New Revision: 199444 URL: http://svn.freebsd.org/changeset/base/199444 Log: MFC r198899: - Remove CAM_PERIPH_POLLED flag. It is broken by design. Polling can't be periph flag. May be SIM, may be CCB, but now it works fine just without it. - Remove check unused for at least five years. If we will ever have non-BIO devices in CAM, this check is smallest of what we will need. - If several controllers complete requests same time, call swi_sched() only once. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam_periph.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/scsi/scsi_da.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/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Tue Nov 17 21:08:12 2009 (r199443) +++ stable/8/sys/cam/ata/ata_da.c Tue Nov 17 21:09:47 2009 (r199444) @@ -371,7 +371,6 @@ adadump(void *arg, void *virtual, vm_off } if (length > 0) { - periph->flags |= CAM_PERIPH_POLLED; xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, @@ -431,7 +430,6 @@ adadump(void *arg, void *virtual, vm_off /*timeout*/0, /*getcount_only*/0); } - periph->flags &= ~CAM_PERIPH_POLLED; cam_periph_unlock(periph); return (0); } Modified: stable/8/sys/cam/cam_periph.h ============================================================================== --- stable/8/sys/cam/cam_periph.h Tue Nov 17 21:08:12 2009 (r199443) +++ stable/8/sys/cam/cam_periph.h Tue Nov 17 21:09:47 2009 (r199444) @@ -117,7 +117,6 @@ struct cam_periph { #define CAM_PERIPH_INVALID 0x08 #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 -#define CAM_PERIPH_POLLED 0x40 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Tue Nov 17 21:08:12 2009 (r199443) +++ stable/8/sys/cam/cam_xpt.c Tue Nov 17 21:09:47 2009 (r199444) @@ -4238,6 +4238,7 @@ void xpt_done(union ccb *done_ccb) { struct cam_sim *sim; + int first; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_done\n")); if ((done_ccb->ccb_h.func_code & XPT_FC_QUEUED) != 0) { @@ -4246,25 +4247,17 @@ xpt_done(union ccb *done_ccb) * any of the "non-immediate" type of ccbs. */ sim = done_ccb->ccb_h.path->bus->sim; - switch (done_ccb->ccb_h.path->periph->type) { - case CAM_PERIPH_BIO: - 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) { - mtx_lock(&cam_simq_lock); - TAILQ_INSERT_TAIL(&cam_simq, sim, - links); - mtx_unlock(&cam_simq_lock); - sim->flags |= CAM_SIM_ON_DONEQ; - if ((done_ccb->ccb_h.path->periph->flags & - CAM_PERIPH_POLLED) == 0) - swi_sched(cambio_ih, 0); - } - break; - default: - panic("unknown periph type %d", - done_ccb->ccb_h.path->periph->type); + 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) { + mtx_lock(&cam_simq_lock); + first = TAILQ_EMPTY(&cam_simq); + TAILQ_INSERT_TAIL(&cam_simq, sim, links); + mtx_unlock(&cam_simq_lock); + sim->flags |= CAM_SIM_ON_DONEQ; + if (first) + swi_sched(cambio_ih, 0); } } } Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Nov 17 21:08:12 2009 (r199443) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Nov 17 21:09:47 2009 (r199444) @@ -859,7 +859,6 @@ dadump(void *arg, void *virtual, vm_offs } if (length > 0) { - periph->flags |= CAM_PERIPH_POLLED; xpt_setup_ccb(&csio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); csio.ccb_h.ccb_state = DA_CCB_DUMP; scsi_read_write(&csio, @@ -885,7 +884,6 @@ dadump(void *arg, void *virtual, vm_offs else printf("status == 0x%x, scsi status == 0x%x\n", csio.ccb_h.status, csio.scsi_status); - periph->flags |= CAM_PERIPH_POLLED; return(EIO); } cam_periph_unlock(periph); @@ -929,7 +927,6 @@ dadump(void *arg, void *virtual, vm_offs } } } - periph->flags &= ~CAM_PERIPH_POLLED; cam_periph_unlock(periph); return (0); }