From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 28 14:25:09 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E93E5F61; Thu, 28 Mar 2013 14:25:09 +0000 (UTC) (envelope-from mjacob@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 C1EBFB03; Thu, 28 Mar 2013 14:25:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2SEP9Af070833; Thu, 28 Mar 2013 14:25:09 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2SEP956070832; Thu, 28 Mar 2013 14:25:09 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201303281425.r2SEP956070832@svn.freebsd.org> From: Matt Jacob Date: Thu, 28 Mar 2013 14:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248831 - stable/9/sys/dev/sym X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 14:25:10 -0000 Author: mjacob Date: Thu Mar 28 14:25:09 2013 New Revision: 248831 URL: http://svnweb.freebsd.org/changeset/base/248831 Log: MFC 247266 Don't try and negotiate sync mode if either period or offset are zero. Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Thu Mar 28 14:14:28 2013 (r248830) +++ stable/9/sys/dev/sym/sym_hipd.c Thu Mar 28 14:25:09 2013 (r248831) @@ -8245,8 +8245,13 @@ static void sym_update_trans(hcb_p np, t * Scale against driver configuration limits. */ if (tip->width > SYM_SETUP_MAX_WIDE) tip->width = SYM_SETUP_MAX_WIDE; - if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS; - if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC; + if (tip->period && tip->offset) { + if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS; + if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC; + } else { + tip->offset = 0; + tip->period = 0; + } /* * Scale against actual controller BUS width. @@ -8265,21 +8270,23 @@ static void sym_update_trans(hcb_p np, t /* * Scale period factor and offset against controller limits. */ - if (tip->options & PPR_OPT_DT) { - if (tip->period < np->minsync_dt) - tip->period = np->minsync_dt; - if (tip->period > np->maxsync_dt) - tip->period = np->maxsync_dt; - if (tip->offset > np->maxoffs_dt) - tip->offset = np->maxoffs_dt; - } - else { - if (tip->period < np->minsync) - tip->period = np->minsync; - if (tip->period > np->maxsync) - tip->period = np->maxsync; - if (tip->offset > np->maxoffs) - tip->offset = np->maxoffs; + if (tip->offset && tip->period) { + if (tip->options & PPR_OPT_DT) { + if (tip->period < np->minsync_dt) + tip->period = np->minsync_dt; + if (tip->period > np->maxsync_dt) + tip->period = np->maxsync_dt; + if (tip->offset > np->maxoffs_dt) + tip->offset = np->maxoffs_dt; + } + else { + if (tip->period < np->minsync) + tip->period = np->minsync; + if (tip->period > np->maxsync) + tip->period = np->maxsync; + if (tip->offset > np->maxoffs) + tip->offset = np->maxoffs; + } } }