From owner-svn-src-all@freebsd.org Thu Jun 25 07:22:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058E498CF36; Thu, 25 Jun 2015 07:22:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE494143F; Thu, 25 Jun 2015 07:22:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5P7Mcii096474; Thu, 25 Jun 2015 07:22:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5P7MccC096472; Thu, 25 Jun 2015 07:22:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506250722.t5P7MccC096472@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 25 Jun 2015 07:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r284799 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 25 Jun 2015 07:22:39 -0000 Author: mav Date: Thu Jun 25 07:22:37 2015 New Revision: 284799 URL: https://svnweb.freebsd.org/changeset/base/284799 Log: MFC r274675 (by jhb), r274708: Convert the refire_notify_ack timer from timeout(9) to callout(9). Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Thu Jun 25 07:11:48 2015 (r284798) +++ stable/10/sys/dev/isp/isp_freebsd.c Thu Jun 25 07:22:37 2015 (r284799) @@ -2118,10 +2118,9 @@ static void isp_refire_putback_atio(void *arg) { union ccb *ccb = arg; - ispsoftc_t *isp = XS_ISP(ccb); - ISP_LOCK(isp); + + ISP_ASSERT_LOCKED((ispsoftc_t *)XS_ISP(ccb)); isp_target_putback_atio(ccb); - ISP_UNLOCK(isp); } static void @@ -2129,13 +2128,13 @@ isp_refire_notify_ack(void *arg) { isp_tna_t *tp = arg; ispsoftc_t *isp = tp->isp; - ISP_LOCK(isp); + + ISP_ASSERT_LOCKED(isp); if (isp_notify_ack(isp, tp->not)) { - (void) timeout(isp_refire_notify_ack, tp, 5); + callout_schedule(&tp->timer, 5); } else { free(tp, M_DEVBUF); } - ISP_UNLOCK(isp); } @@ -2152,7 +2151,8 @@ isp_target_putback_atio(union ccb *ccb) if (qe == NULL) { xpt_print(ccb->ccb_h.path, "%s: Request Queue Overflow\n", __func__); - (void) timeout(isp_refire_putback_atio, ccb, 10); + callout_reset(&PISP_PCMD(ccb)->wdog, 10, + isp_refire_putback_atio, ccb); return; } memset(qe, 0, QENTRY_LEN); @@ -5991,7 +5991,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm } else { tp->not = NULL; } - (void) timeout(isp_refire_notify_ack, tp, 5); + callout_init_mtx(&tp->timer, &isp->isp_lock, 0); + callout_reset(&tp->timer, 5, + isp_refire_notify_ack, tp); } else { isp_prt(isp, ISP_LOGERR, "you lose- cannot allocate a notify refire"); } Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Thu Jun 25 07:11:48 2015 (r284798) +++ stable/10/sys/dev/isp/isp_freebsd.h Thu Jun 25 07:22:37 2015 (r284799) @@ -158,6 +158,7 @@ typedef struct isp_timed_notify_ack { void *isp; void *not; uint8_t data[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ + struct callout timer; } isp_tna_t; TAILQ_HEAD(isp_ccbq, ccb_hdr); @@ -396,8 +397,9 @@ struct isposinfo { /* * Locking macros... */ -#define ISP_LOCK(isp) mtx_lock(&isp->isp_osinfo.lock) -#define ISP_UNLOCK(isp) mtx_unlock(&isp->isp_osinfo.lock) +#define ISP_LOCK(isp) mtx_lock(&(isp)->isp_osinfo.lock) +#define ISP_UNLOCK(isp) mtx_unlock(&(isp)->isp_osinfo.lock) +#define ISP_ASSERT_LOCKED(isp) mtx_assert(&(isp)->isp_osinfo.lock, MA_OWNED) /* * Required Macros/Defines