From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 14:06:25 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 74CFBB55; Mon, 25 Feb 2013 14:06:25 +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 4E476E81; Mon, 25 Feb 2013 14:06:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PE6PMi094824; Mon, 25 Feb 2013 14:06:25 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PE6P2K094823; Mon, 25 Feb 2013 14:06:25 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201302251406.r1PE6P2K094823@svn.freebsd.org> From: Matt Jacob Date: Mon, 25 Feb 2013 14:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247266 - head/sys/dev/sym 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: Mon, 25 Feb 2013 14:06:25 -0000 Author: mjacob Date: Mon Feb 25 14:06:24 2013 New Revision: 247266 URL: http://svnweb.freebsd.org/changeset/base/247266 Log: Don't try and negotiate sync mode if either period or offset are zero. PR: kern/163064 Partially Submitted by: Peter MFC after: 1 month Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Mon Feb 25 12:33:31 2013 (r247265) +++ head/sys/dev/sym/sym_hipd.c Mon Feb 25 14:06:24 2013 (r247266) @@ -8211,8 +8211,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. @@ -8231,21 +8236,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; + } } }