From owner-svn-src-stable@FreeBSD.ORG Fri Nov 12 11:36:13 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D002106564A; Fri, 12 Nov 2010 11:36:13 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0952A8FC16; Fri, 12 Nov 2010 11:36:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACBaCqG007125; Fri, 12 Nov 2010 11:36:12 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACBaCFQ007123; Fri, 12 Nov 2010 11:36:12 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011121136.oACBaCFQ007123@svn.freebsd.org> From: Bruce Cran Date: Fri, 12 Nov 2010 11:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215174 - stable/8/sbin/camcontrol X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 11:36:13 -0000 Author: brucec Date: Fri Nov 12 11:36:12 2010 New Revision: 215174 URL: http://svn.freebsd.org/changeset/base/215174 Log: MFC r214781, r214807: Improve rounding of standby timer. 22-29 minutes can't be encoded so must be rounded up to 30. PR: bin/151871 Modified: stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Fri Nov 12 11:22:59 2010 (r215173) +++ stable/8/sbin/camcontrol/camcontrol.c Fri Nov 12 11:36:12 2010 (r215174) @@ -4302,14 +4302,19 @@ atapm(struct cam_device *device, int arg cmd = ATA_SLEEP; t = -1; } + if (t < 0) sc = 0; else if (t <= (240 * 5)) - sc = t / 5; + sc = (t + 4) / 5; + else if (t <= (252 * 5)) + /* special encoding for 21 minutes */ + sc = 252; else if (t <= (11 * 30 * 60)) - sc = t / (30 * 60) + 241; + sc = (t - 1) / (30 * 60) + 241; else sc = 253; + cam_fill_ataio(&ccb->ataio, retry_count, NULL,