From owner-svn-src-all@FreeBSD.ORG Wed Feb 27 23:17:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D5E45B1; Wed, 27 Feb 2013 23:17:46 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DD869AE; Wed, 27 Feb 2013 23:17:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RNHkgx044103; Wed, 27 Feb 2013 23:17:46 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RNHk1m044102; Wed, 27 Feb 2013 23:17:46 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201302272317.r1RNHk1m044102@svn.freebsd.org> From: Steven Hartland Date: Wed, 27 Feb 2013 23:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247426 - head/sys/dev/mfi X-SVN-Group: head 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.14 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: Wed, 27 Feb 2013 23:17:46 -0000 Author: smh Date: Wed Feb 27 23:17:45 2013 New Revision: 247426 URL: http://svnweb.freebsd.org/changeset/base/247426 Log: Adds hw.mfi.cmd_timeout loader / sysctl tuneable which controls the default timeout used in the mfi driver. This is useful for long running commands such as secure erase. Reviewed by: John Baldwin Approved by: pjd (mentor) Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Wed Feb 27 23:02:47 2013 (r247425) +++ head/sys/dev/mfi/mfi.c Wed Feb 27 23:17:45 2013 (r247426) @@ -157,6 +157,11 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd &mfi_polled_cmd_timeout, 0, "Polled command timeout - used for firmware flash etc (in seconds)"); +static int mfi_cmd_timeout = MFI_CMD_TIMEOUT; +TUNABLE_INT("hw.mfi.cmd_timeout", &mfi_cmd_timeout); +SYSCTL_INT(_hw_mfi, OID_AUTO, cmd_timeout, CTLFLAG_RWTUN, &mfi_cmd_timeout, + 0, "Command timeout (in seconds)"); + /* Management interface */ static d_open_t mfi_open; static d_close_t mfi_close; @@ -782,7 +787,7 @@ mfi_attach(struct mfi_softc *sc) /* Start the timeout watchdog */ callout_init(&sc->mfi_watchdog_callout, CALLOUT_MPSAFE); - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, + callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz, mfi_timeout, sc); if (sc->mfi_flags & MFI_FLAGS_TBOLT) { @@ -3714,7 +3719,7 @@ mfi_dump_all(void) break; device_printf(sc->mfi_dev, "Dumping\n\n"); timedout = 0; - deadline = time_uptime - MFI_CMD_TIMEOUT; + deadline = time_uptime - mfi_cmd_timeout; mtx_lock(&sc->mfi_io_lock); TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) { if (cm->cm_timestamp <= deadline) { @@ -3745,10 +3750,11 @@ mfi_timeout(void *data) time_t deadline; int timedout = 0; - deadline = time_uptime - MFI_CMD_TIMEOUT; + deadline = time_uptime - mfi_cmd_timeout; if (sc->adpreset == 0) { if (!mfi_tbolt_reset(sc)) { - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, mfi_timeout, sc); + callout_reset(&sc->mfi_watchdog_callout, + mfi_cmd_timeout * hz, mfi_timeout, sc); return; } } @@ -3785,7 +3791,7 @@ mfi_timeout(void *data) mtx_unlock(&sc->mfi_io_lock); - callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, + callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz, mfi_timeout, sc); if (0)