Date: Fri, 18 Sep 2009 20:35:05 +0000 (UTC) From: "Kenneth D. Merry" <ken@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org 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 Message-ID: <200909182035.n8IKZ523000626@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909182035.n8IKZ523000626>