From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 5 11:41:05 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E44B106564A; Fri, 5 Aug 2011 11:41:05 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id C23C78FC15; Fri, 5 Aug 2011 11:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=d5GYb5GdRRO/jd/bSG1FzglUGXQAHr2H5agpGy3BOoE=; b=qTuTzzq+z46KmrTRXO+yIa92b8JX6Qk79YYhIIRKKuxiHkMCcyrDnSeYrY7UYsLPCQXjx7CC6w0cs0xuuBewWXUstluKLwhMBZaQZdfTFzZRQ6qkwgpcgZQ6yypkMF5hiovlNKFkNr816O/f2VGk1CYQT1SVVaAMs+bk8Xx9yNvIdiqrc6b42kvQbFRMeKKWJJrY+7CWDMCGwf3aJ6sN2LnPb0moQTvIWjFJU/7qua5Ja2OUHJVJQ9toyxvEEGZFvvQk9zxJwlycc0tjld37NK8YAPNbq/YOKpEVntz9B6YE+35EtBf+0A3vBqCa3ZUWn+f92OE0QqghrMnolUOI5A==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1QpIlz-000Lt9-Dn; Fri, 05 Aug 2011 15:41:03 +0400 Date: Fri, 5 Aug 2011 15:41:01 +0400 From: Eygene Ryabinkin To: Steven Hartland Message-ID: References: <4CAD348034DD463E80C89DD5A0BDD71B@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: Sender: rea@codelabs.ru Cc: freebsd-hackers@freebsd.org, mav@freebsd.org Subject: Re: cam / ata timeout limited to 2147 due to overflow bug? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 11:41:05 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fri, Aug 05, 2011 at 10:59:43AM +0100, Steven Hartland wrote: > I've tried the patch and it a few cut and paste errors, which I've fixed, Thanks for spotting that! > and confirmed it works as expected, so thanks for that :) >=20 > There's also a load more drivers with the same issue so I've gone through > and fixed all the occurances I can find. Here's the updated patch:- > http://blog.multiplay.co.uk/dropzone/freebsd/ccb_timeout.patch I had found a couple of missed drivers, fixed overlong lines and fixed the missing 10 in the sys/dev/hptrr/hptrr_os_bsd.c. Also changed ciss to have u_int32_t timeouts instead of int ones: this should not harm anything, because all passed timeouts are explicit numbers that are not larger than 100000. And I had also renamed CAM_HDR_TIMEOUT_TO_TICKS to the base CAM_TIMEOUT_TO_TICKS, because it seems that every CAM timeout is 32-bit long. The new patch lives at http://codelabs.ru/fbsd/patches/cam/CAM-properly-convert-timeout-to-ticks= =2Ediff But there are some cases where the argument to the CAM_TIMEOUT_TO_TICKS is int and not u_int32_t. It should be mostly harmless for now, since the values do not exceed 2^32, but my current feeling about timeouts that are counted in milliseconds that there should be an in-kernel type for this stuff. Seems like 32-bit wide unsigned value is good for it: maximal value is around 46 days that should be fine for the millisecond-precision timeout. Through my grep session for the kernel sources I had seen other (t * hz / 1000) constructs, so I feel that the fix should be extended to cover these cases as well. I am interested in the other's opinions on this. Thanks again! --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iF4EAREIAAYFAk471s0ACgkQFq+eroFS7PvdvgD/Y8vcBd31rE8RQgX3HAjf76Z/ hubFqM3PkZknlM63XEIA/25zx2hjvBuzzgbC3QftshBTHZpf155idkJZgFjLFZAx =Kpxm -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp--