From owner-svn-src-all@FreeBSD.ORG Fri Sep 18 20:35:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE5E106566B; Fri, 18 Sep 2009 20:35:05 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9638FC0A; Fri, 18 Sep 2009 20:35:05 +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 n8IKZ5ux000628; Fri, 18 Sep 2009 20:35:05 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8IKZ523000626; Fri, 18 Sep 2009 20:35:05 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <200909182035.n8IKZ523000626@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 18 Sep 2009 20:35:05 +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: r197318 - in stable/8/sys: . amd64/include/xen cam cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ciss dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2009 20:35:05 -0000 Author: ken Date: Fri Sep 18 20:35:05 2009 New Revision: 197318 URL: http://svn.freebsd.org/changeset/base/197318 Log: Merge change r197208 from head to stable/8: Fix some instances where CAM rescans get hung up or take a long time to complete. Also, allow xpt_rescan() to rescan a LUN instead of a full bus. Sponsored by: Copan Systems, Inc. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/cam_xpt.c 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/ciss/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Fri Sep 18 17:09:33 2009 (r197317) +++ stable/8/sys/cam/cam_xpt.c Fri Sep 18 20:35:05 2009 (r197318) @@ -794,8 +794,9 @@ xpt_scanner_thread(void *dummy) * processed. */ xpt_lock_buses(); - msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, - "ccb_scanq", 0); + if (TAILQ_EMPTY(&xsoftc.ccb_scanq)) + msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, + "ccb_scanq", 0); TAILQ_INIT(&queue); TAILQ_CONCAT(&queue, &xsoftc.ccb_scanq, sim_links.tqe); xpt_unlock_buses(); @@ -806,9 +807,12 @@ xpt_scanner_thread(void *dummy) sim = ccb->ccb_h.path->bus->sim; CAM_SIM_LOCK(sim); - ccb->ccb_h.func_code = XPT_SCAN_BUS; + if( ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD ) + ccb->ccb_h.func_code = XPT_SCAN_BUS; + else + ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = xptdone; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 5); + xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 1); cam_periph_runccb(ccb, NULL, 0, 0, NULL); xpt_free_path(ccb->ccb_h.path); xpt_free_ccb(ccb); @@ -828,6 +832,7 @@ xpt_rescan(union ccb *ccb) xpt_lock_buses(); TAILQ_FOREACH(hdr, &xsoftc.ccb_scanq, sim_links.tqe) { if (xpt_path_comp(hdr->path, ccb->ccb_h.path) == 0) { + wakeup(&xsoftc.ccb_scanq); xpt_unlock_buses(); xpt_print(ccb->ccb_h.path, "rescan already queued\n"); xpt_free_path(ccb->ccb_h.path);