From owner-p4-projects@FreeBSD.ORG Mon Jun 26 15:34:20 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 40E2D16A402; Mon, 26 Jun 2006 15:34:20 +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 E14B216A40A for ; Mon, 26 Jun 2006 15:34:19 +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 6E3DF45464 for ; Mon, 26 Jun 2006 15:34:19 +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 k5QFYJZp079350 for ; Mon, 26 Jun 2006 15:34:19 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5QFYI1x079347 for perforce@freebsd.org; Mon, 26 Jun 2006 15:34:18 GMT (envelope-from scottl@freebsd.org) Date: Mon, 26 Jun 2006 15:34:18 GMT Message-Id: <200606261534.k5QFYI1x079347@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 100065 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, 26 Jun 2006 15:34:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=100065 Change 100065 by scottl@scottl-wv1u on 2006/06/26 15:33:26 Start going to MPSAFE callouts. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic79xx.c#6 edit .. //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic79xx_osm.c#9 edit .. //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic_osm_lib.c#5 edit .. //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic_osm_lib.h#6 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic79xx.c#6 (text+ko) ==== @@ -8092,8 +8092,8 @@ ahd_outb(ahd, SCSISEQ1, scsiseq1 & (ENSELI|ENRSELI|ENAUTOATNP)); ahd_unpause(ahd); ahd->flags &= ~AHD_RESET_POLL_ACTIVE; + aic_release_simq(ahd); ahd_unlock(ahd, &s); - aic_release_simq(ahd); ahd_list_unlock(&l); } @@ -9276,12 +9276,15 @@ ahd_timeout(struct scb *scb) { struct ahd_softc *ahd; + u_long s; ahd = scb->ahd_softc; if ((scb->flags & SCB_ACTIVE) != 0) { if ((scb->flags & SCB_TIMEDOUT) == 0) { + ahd_lock(ahd, &s); LIST_INSERT_HEAD(&ahd->timedout_scbs, scb, timedout_links); + ahd_unlock(ahd, &s); scb->flags |= SCB_TIMEDOUT; } ahd_wakeup_recovery_thread(ahd); ==== //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic79xx_osm.c#9 (text+ko) ==== @@ -222,7 +222,7 @@ if ((scb->flags & SCB_TIMEDOUT) != 0) LIST_REMOVE(scb, timedout_links); - untimeout(ahd_platform_timeout, (caddr_t)scb, ccb->ccb_h.timeout_ch); + callout_stop(&ccb->ccb_h.callout); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; ==== //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic_osm_lib.c#5 (text+ko) ==== @@ -57,8 +57,7 @@ union ccb *ccb; ccb = list_scb->io_ctx; - untimeout(aic_platform_timeout, list_scb, - ccb->ccb_h.timeout_ch); + callout_stop(&ccb->ccb_h.callout); } } } @@ -116,9 +115,6 @@ struct aic_softc *aic; u_long s; -#if __FreeBSD_version >= 500000 - mtx_lock(&Giant); -#endif aic = (struct aic_softc *)arg; aic_lock(aic, &s); for (;;) { @@ -137,9 +133,6 @@ aic->platform_data->recovery_thread = NULL; wakeup(aic->platform_data); aic_unlock(aic, &s); -#if __FreeBSD_version >= 500000 - mtx_unlock(&Giant); -#endif kthread_exit(0); } ==== //depot/projects/scottl-camlock/src/sys/dev/aic7xxx/aic_osm_lib.h#6 (text+ko) ==== @@ -187,7 +187,7 @@ /***************************** Timer Facilities *******************************/ #if __FreeBSD_version >= 500000 -#define aic_timer_init(timer) callout_init(timer, /*mpsafe*/0) +#define aic_timer_init(timer) callout_init(timer, /*mpsafe*/1) #else #define aic_timer_init callout_init #endif @@ -223,10 +223,8 @@ time = msec; time *= hz; time /= 1000; - untimeout(aic_platform_timeout, (caddr_t)scb, - scb->io_ctx->ccb_h.timeout_ch); - scb->io_ctx->ccb_h.timeout_ch = - timeout(aic_platform_timeout, scb, time); + callout_reset(&scb->io_ctx->ccb_h.callout, time, aic_platform_timeout, + scb); } static __inline void @@ -235,13 +233,7 @@ if (AIC_SCB_DATA(scb->aic_softc)->recovery_scbs == 0 && scb->io_ctx->ccb_h.timeout != CAM_TIME_INFINITY) { - uint64_t time; - - time = scb->io_ctx->ccb_h.timeout; - time *= hz; - time /= 1000; - scb->io_ctx->ccb_h.timeout_ch = - timeout(aic_platform_timeout, scb, time); + aic_scb_timer_reset(scb, scb->io_ctx->ccb_h.timeout); } }