Date: Mon, 26 Jun 2006 15:34:18 GMT From: Scott Long <scottl@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 100065 for review Message-ID: <200606261534.k5QFYI1x079347@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606261534.k5QFYI1x079347>