From owner-p4-projects@FreeBSD.ORG Mon May 15 22:55:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2BF5016B2D2; Mon, 15 May 2006 22:55:56 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 650CC16AED7 for ; Mon, 15 May 2006 22:55:55 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F040C43D6E for ; Mon, 15 May 2006 22:55:54 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4FMtfrP049618 for ; Mon, 15 May 2006 22:55:41 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4FMtfqb049613 for perforce@freebsd.org; Mon, 15 May 2006 22:55:41 GMT (envelope-from scottl@freebsd.org) Date: Mon, 15 May 2006 22:55:41 GMT Message-Id: <200605152255.k4FMtfqb049613@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 97216 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2006 22:55:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=97216 Change 97216 by scottl@scottl-x64 on 2006/05/15 22:55:24 Switch from a callout_handle to a callout for the device object. Re-mark the mutex assertion for a couple of functions that are affected. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#24 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#24 (text+ko) ==== @@ -156,7 +156,7 @@ #define CAM_TAG_DELAY_COUNT 5 u_int32_t tag_saved_openings; u_int32_t refcount; - struct callout_handle c_handle; + struct callout callout; }; /* @@ -3531,17 +3531,15 @@ * is sufficient for releasing the queue. */ start_ccb->ccb_h.flags &= ~CAM_DEV_QFREEZE; - untimeout(xpt_release_devq_timeout, - dev, dev->c_handle); + callout_stop(&dev->callout); } else { start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; } - dev->c_handle = - timeout(xpt_release_devq_timeout, - dev, - (crs->release_timeout * hz) / 1000); + callout_reset(&dev->callout, + (crs->release_timeout * hz) / 1000, + xpt_release_devq_timeout, dev); dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING; @@ -4836,7 +4834,7 @@ void xpt_release_devq(struct cam_path *path, u_int count, int run_queue) { - GIANT_REQUIRED; + mtx_assert(path->bus->sim->mtx, MA_OWNED); xpt_release_devq_device(path->device, count, run_queue); } @@ -4867,8 +4865,7 @@ * to release this queue. */ if ((dev->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) { - untimeout(xpt_release_devq_timeout, dev, - dev->c_handle); + callout_stop(&dev->callout); dev->flags &= ~CAM_DEV_REL_TIMEOUT_PENDING; } @@ -4896,7 +4893,7 @@ int s; struct camq *sendq; - GIANT_REQUIRED; + mtx_assert(sim->mtx, MA_OWNED); sendq = &(sim->devq->send_queue); s = splcam(); @@ -5170,7 +5167,10 @@ device->tag_delay_count = 0; device->tag_saved_openings = 0; device->refcount = 1; - callout_handle_init(&device->c_handle); + if (bus->sim->flags & CAM_SIM_MPSAFE) + callout_init_mtx(&device->callout, bus->sim->mtx, 0); + else + callout_init_mtx(&device->callout, &Giant, 0); /* * Hold a reference to our parent target so it @@ -5224,8 +5224,7 @@ panic("Removing device while still queued for ccbs"); if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) - untimeout(xpt_release_devq_timeout, device, - device->c_handle); + callout_stop(&device->callout); TAILQ_REMOVE(&target->ed_entries, device,links); target->generation++;