From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 5 12:57:35 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0864106566C; Sun, 5 Jun 2011 12:57:35 +0000 (UTC) (envelope-from bob@immure.com) Received: from maul.immure.com (adsl-66-136-206-1.dsl.austtx.swbell.net [66.136.206.1]) by mx1.freebsd.org (Postfix) with ESMTP id 51D5C8FC08; Sun, 5 Jun 2011 12:57:34 +0000 (UTC) Received: from rancor.immure.com (rancor.immure.com [10.1.132.9]) by maul.immure.com (8.14.4/8.14.4) with ESMTP id p55Cgp0U005220; Sun, 5 Jun 2011 07:42:51 -0500 (CDT) (envelope-from bob@immure.com) Received: (from bob@localhost) by rancor.immure.com (8.14.4/8.14.4/Submit) id p55Cgn3g002820; Sun, 5 Jun 2011 07:42:49 -0500 (CDT) (envelope-from bob) Date: Sun, 5 Jun 2011 07:42:49 -0500 From: Bob Willcox To: Charlie Kester Message-ID: <20110605124249.GA98612@rancor.immure.com> References: <201102052134.p15LYRmw041695@svn.freebsd.org> <20110316135122.GB7185@rancor.immure.com> <4D814AAA.3070801@FreeBSD.org> <20110320141501.GB19338@rancor.immure.com> <4D860C9A.7020600@FreeBSD.org> <20110320163019.GA32910@rancor.immure.com> <20110320170608.GE1019@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110320170608.GE1019@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-immure-MailScanner-Information: Please contact the ISP for more information X-immure-MailScanner-ID: p55Cgp0U005220 X-immure-MailScanner: Found to be clean X-immure-MailScanner-From: bob@immure.com X-Spam-Status: No Cc: svn-src-stable@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r218347 - stable/8/sys/dev/ata/chipsets - still fails X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bob Willcox List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 12:57:35 -0000 On Sun, Mar 20, 2011 at 10:06:08AM -0700, Charlie Kester wrote: > On Sun 20 Mar 2011 at 09:30:20 PDT Bob Willcox wrote: > >On Sun, Mar 20, 2011 at 04:18:02PM +0200, Alexander Motin wrote: > >> Bob Willcox wrote: > >> > On Thu, Mar 17, 2011 at 01:41:30AM +0200, Alexander Motin wrote: > >> >> On 16.03.2011 15:51, Bob Willcox wrote: > >> >>> This change has broken SATA disk support on my Intel Atom D525 ITX system. By > >> >>> reverting this change 8.2-STABLE works again on this system. > >> >>> > >> >>> My 'uname -a' output is: > >> >>> > >> >>> FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16 08:15:43 CDT 2011 bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL amd64 > >> >>> > >> >>> When booting the system I get tons of these messages: > >> >>> > >> >>> Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE requeued due to channel reset > >> >>> Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored > >> >> As I can see, it means that channel has some active request, but it is > >> >> in IDLE state. It is strange, but I won't be surprised much if it is the > >> >> result of some locking problem in ata(4) in non-CAM mode. > >> >> > >> >>> repeated over and over, and then lots of these: > >> >>> > >> >>> Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to channel reset LBA=617964479 > >> >>> Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on this device > >> >>> Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed > >> >>> > >> >>> for different LBA values. > >> >>> > >> >>> As one might expect, I then start seeing I/O errors on the disk and programs > >> >>> failing > >> >>> > >> >>> I've attached the 'pciconf -lv' output. > >> >> Send me please full verbose log, if you can save it. I am especially > >> >> interested in place around first errors. > >> >> > >> >> You may try to build kernel with `options ATA_CAM` to see if it helps. > >> >> I've mostly tested this patch in that mode. > >> > > >> > I tried setting `options ATA_CAM` but that didn't fix the problem. I still got > >> > continuous ATA error messages spewed out while probing the ATA devices. I'm > >> > not able to capture the verbose output as the system never successfully boots > >> > and I don't have a serial console attached to the system. > >> > >> It's strange. Can you at least show errors you received in that case? I > >> suppose they should be different from the original. > > > >They were similar, though this time there was mention of CAM in them (which I > >assumed was the result of using the CAM interface). The trouble is they roll > >by quite fast and I'm unable to stop them from scrolling. > > > >If this wasn't my most critical system I'd try debugging it more, but I really > >can't afford for this machine to be out of service. I was hoping that someone > >with one of these same motherboards: > > > >http://www.intel.com/Products/Desktop/Motherboards/db-d525mw/D525MW-overview.htm > > > >in a less critical situation might have also seen the problem and been able to > >do more debugging of it than I am inclined to. > > > >Bob > > FWIW, this problem isn't confined to the D525's. I saw the same problem > on my D510MO sometime between 8.2-RC3 and -RELEASE. My mobo has the > NM10 chipset, which is also used on the D525. > > I've since reverted to RC3 and have been postponing an upgrade to > -STABLE until this issue is resolved. Like Bob, I can't afford to have > this machine disabled. > > Nor am I able to gather any logs, etc., because I don't have a serial > terminal and the problem makes any disk io unreliable. Against my better judgement, I decided to give the latest version of ata-intel.c another try on my gateway system yesterday. Unfortunately, the problem still persists. To complicate matters upon installing the new kernel for some reason my old (working) kernel was NOT saved in /boot/kernel.old. I have no idea why, and didn't notice this till after attempting to reboot the old kernel (when the new kernel failed). Several hours of frantic recovery later I finally got my system back up with a new kernel and the old version of ata-intel.c that still works (had some minor adjustments to make on it due to the removal of a symbol that it used, ATA_I82801IB_AH2). I do find it hard to believe that Charlie and I are the only ones out there with systems that fail with this newer version of the driver. I wish I could help debug it more than I've been able to, but this is the only system I have with this hardware and it's my most critical one to be up and running. Bob > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Bob Willcox "In the age of the internet attaching a famous name to bob@immure.com your personal opinion to give more weight to it is a very Austin, TX valid strategy." -- Benjamin Franklin From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 5 14:02:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FAC51065670; Sun, 5 Jun 2011 14:02:41 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-wy0-f196.google.com (mail-wy0-f196.google.com [74.125.82.196]) by mx1.freebsd.org (Postfix) with ESMTP id A42D58FC0A; Sun, 5 Jun 2011 14:02:39 +0000 (UTC) Received: by wyf28 with SMTP id 28so507808wyf.7 for ; Sun, 05 Jun 2011 07:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uLjusDGIAoMw12UKXv8CSXxLsXIkzlk8adu9Br1wygY=; b=f1NEbgu5W2C1IaaWtyyTy3cTCw/rL0egQl71R6hLlD2Lkt4ypSxGFBnw7krC00znxY qqXK3+BVTTZ0hOkUpjBrECV5dNZVGblBdp9thnp44Rt4SULo5E+JeBJMZXgQLsyw1fII 51jHx/pC5AEdvAQrCHVqvlZ69SbBSxtmddktQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=icV/Mubbe/KnUXKkgyXmEsB2dwih2/GWR9og02huJu8W0vNkw4/bhaa2RrE3s9BWAa APTb37FetXRcj0wdMGHHihQ4/mt2+dL3oyq/hsWWXBpzPeLYt2dsJqDEdTH/wgrvL3af k/yloplUuzYfhF90riJfbYiZHK9Am45NpZZSo= MIME-Version: 1.0 Received: by 10.227.201.16 with SMTP id ey16mr2299565wbb.30.1307282557091; Sun, 05 Jun 2011 07:02:37 -0700 (PDT) Received: by 10.227.209.209 with HTTP; Sun, 5 Jun 2011 07:02:37 -0700 (PDT) In-Reply-To: <201103060849.p268nitH091290@svn.freebsd.org> References: <201103060849.p268nitH091290@svn.freebsd.org> Date: Sun, 5 Jun 2011 16:02:37 +0200 Message-ID: From: Oliver Pinter To: David Schultz Content-Type: multipart/mixed; boundary=00151758b0ac6fc0e904a4f770a2 Cc: ports@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219323 - in stable/8/lib/msun: . man src X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 14:02:41 -0000 --00151758b0ac6fc0e904a4f770a2 Content-Type: text/plain; charset=ISO-8859-1 On 3/6/11, David Schultz wrote: > Author: das > Date: Sun Mar 6 08:49:44 2011 > New Revision: 219323 > URL: http://svn.freebsd.org/changeset/base/219323 > > Log: > MFC > r216210: refactor log(3) > r216211: add log2(3) and log2f(3) > > Added: > stable/8/lib/msun/src/e_log2.c > - copied unchanged from r216211, head/lib/msun/src/e_log2.c > stable/8/lib/msun/src/e_log2f.c > - copied unchanged from r216211, head/lib/msun/src/e_log2f.c > stable/8/lib/msun/src/k_log.h > - copied unchanged from r216210, head/lib/msun/src/k_log.h > stable/8/lib/msun/src/k_logf.h > - copied unchanged from r216210, head/lib/msun/src/k_logf.h > Modified: > stable/8/lib/msun/Makefile > stable/8/lib/msun/Symbol.map > stable/8/lib/msun/man/log.3 > stable/8/lib/msun/man/math.3 > stable/8/lib/msun/src/math.h > stable/8/lib/msun/src/math_private.h > Directory Properties: > stable/8/lib/msun/ (props changed) > > Modified: stable/8/lib/msun/Makefile > ============================================================================== > --- stable/8/lib/msun/Makefile Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/Makefile Sun Mar 6 08:49:44 2011 (r219323) > @@ -45,7 +45,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c > e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ > e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \ > e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \ > - e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \ > + e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \ > + e_pow.c e_powf.c e_rem_pio2.c \ > e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ > e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ > k_cos.c k_cosf.c k_rem_pio2.c k_sin.c k_sinf.c \ > @@ -164,7 +165,7 @@ MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0 > MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 > MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ > lgamma.3 tgamma.3 lgamma.3 tgammaf.3 > -MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 > logf.3 > +MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 > logf.3 log.3 log2.3 log.3 log2f.3 > MLINKS+=lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 llrintl.3 \ > lrint.3 lrintf.3 lrint.3 lrintl.3 > MLINKS+=lround.3 llround.3 lround.3 llroundf.3 lround.3 llroundl.3 \ > > Modified: stable/8/lib/msun/Symbol.map > ============================================================================== > --- stable/8/lib/msun/Symbol.map Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/Symbol.map Sun Mar 6 08:49:44 2011 (r219323) > @@ -218,3 +218,10 @@ FBSD_1.1 { > cprojf; > cprojl; > }; > + > +/* First added in 9.0-CURRENT */ > +FBSD_1.2 { > + __isnanf; > + log2; > + log2f; > +}; > > Modified: stable/8/lib/msun/man/log.3 > ============================================================================== > --- stable/8/lib/msun/man/log.3 Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/man/log.3 Sun Mar 6 08:49:44 2011 (r219323) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2008 David Schultz > +.\" Copyright (c) 2008-2010 David Schultz > .\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 17, 2008 > +.Dd December 5, 2010 > .Dt LOG 3 > .Os > .Sh NAME > @@ -33,6 +33,8 @@ > .Nm logl , > .Nm log10 , > .Nm log10f , > +.Nm log2 , > +.Nm log2f , > .Nm log1p , > .Nm log1pf > .Nd logarithm functions > @@ -49,6 +51,10 @@ > .Ft float > .Fn log10f "float x" > .Ft double > +.Fn log2 "double x" > +.Ft float > +.Fn log2f "float x" > +.Ft double > .Fn log1p "double x" > .Ft float > .Fn log1pf "float x" > @@ -65,6 +71,12 @@ The > and > .Fn log10f > functions compute the logarithm base 10 of > +.Fa x , > +while > +.Fn log2 > +and > +.Fn log2f > +compute the logarithm base 2 of > .Fa x . > .Pp > The > @@ -97,6 +109,8 @@ The > .Fn logf , > .Fn log10 , > .Fn log10f , > +.Fn log2 , > +.Fn log2f , > .Fn log1p , > and > .Fn log1pf > > Modified: stable/8/lib/msun/man/math.3 > ============================================================================== > --- stable/8/lib/msun/man/math.3 Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/man/math.3 Sun Mar 6 08:49:44 2011 (r219323) > @@ -28,7 +28,7 @@ > .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91 > .\" $FreeBSD$ > .\" > -.Dd December 16, 2007 > +.Dd December 5, 2010 > .Dt MATH 3 > .Os > .if n \{\ > @@ -185,7 +185,7 @@ lgamma log gamma function > log natural logarithm > log10 logarithm to base 10 > log1p log(1+x) > -.\" log2 base 2 logarithm > +log2 base 2 logarithm > pow exponential x**y > sin trigonometric function > sinh hyperbolic function > @@ -197,7 +197,7 @@ y1 Bessel function of the second kind of > yn Bessel function of the second kind of the order n > .El > .Pp > -Unlike the algebraic functions listed earlier, the routines > +The routines > in this section may not produce a result that is correctly rounded, > so reproducible results cannot be guaranteed across platforms. > For most of these functions, however, incorrect rounding occurs > @@ -224,18 +224,20 @@ and > values, were written for or imported into subsequent versions of FreeBSD. > .Sh BUGS > The > -.Fn log2 > -function is missing, and many functions are not available in their > +.Fn cbrt > +function and many of the transcendental functions > +are not available in their > .Vt "long double" > variants. > .Pp > Many of the routines to compute transcendental functions produce > inaccurate results in other than the default rounding mode. > .Pp > -On some architectures, trigonometric argument reduction is not > -performed accurately, resulting in errors greater than 1 > +On the i386 platform, trigonometric argument reduction is not > +performed accurately for very large arguments, resulting in errors > +greater than 1 > .Em ulp > -for large arguments to > +for such arguments to > .Fn cos , > .Fn sin , > and > > Copied: stable/8/lib/msun/src/e_log2.c (from r216211, > head/lib/msun/src/e_log2.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/e_log2.c Sun Mar 6 08:49:44 2011 (r219323, copy > of r216211, head/lib/msun/src/e_log2.c) > @@ -0,0 +1,60 @@ > + > +/* @(#)e_log10.c 1.3 95/01/18 */ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunSoft, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* log2(x) > + * Return the base 2 logarithm of x. > + */ > + > +#include "math.h" > +#include "math_private.h" > +#include "k_log.h" > + > +static const double > +two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ > +ivln2hi = 0x1.71547652000p+0, > +ivln2lo = 0x1.705fc2eefa2p-33; > + > +static const double zero = 0.0; > + > +double > +__ieee754_log2(double x) > +{ > + double f,hi,lo; > + int32_t i,k,hx; > + u_int32_t lx; > + > + EXTRACT_WORDS(hx,lx,x); > + > + k=0; > + if (hx < 0x00100000) { /* x < 2**-1022 */ > + if (((hx&0x7fffffff)|lx)==0) > + return -two54/zero; /* log(+-0)=-inf */ > + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ > + k -= 54; x *= two54; /* subnormal number, scale up x */ > + GET_HIGH_WORD(hx,x); > + } > + if (hx >= 0x7ff00000) return x+x; > + k += (hx>>20)-1023; > + hx &= 0x000fffff; > + i = (hx+0x95f64)&0x100000; > + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ > + k += (i>>20); > + f = __kernel_log(x); > + hi = x = x - 1; > + SET_LOW_WORD(hi,0); > + lo = x - hi; > + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; > +} > > Copied: stable/8/lib/msun/src/e_log2f.c (from r216211, > head/lib/msun/src/e_log2f.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/e_log2f.c Sun Mar 6 08:49:44 2011 (r219323, copy > of r216211, head/lib/msun/src/e_log2f.c) > @@ -0,0 +1,54 @@ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunPro, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include "math.h" > +#include "math_private.h" > +#include "k_logf.h" > + > +static const float > +two25 = 3.3554432000e+07, /* 0x4c000000 */ > +ivln2hi = 0x1.716p+0f, > +ivln2lo = -0x1.7135a8fa03d11p-13; > + > +static const float zero = 0.0; > + > +float > +__ieee754_log2f(float x) > +{ > + float f,hi,lo; > + int32_t i,k,hx; > + > + GET_FLOAT_WORD(hx,x); > + > + k=0; > + if (hx < 0x00800000) { /* x < 2**-126 */ > + if ((hx&0x7fffffff)==0) > + return -two25/zero; /* log(+-0)=-inf */ > + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ > + k -= 25; x *= two25; /* subnormal number, scale up x */ > + GET_FLOAT_WORD(hx,x); > + } > + if (hx >= 0x7f800000) return x+x; > + k += (hx>>23)-127; > + hx &= 0x007fffff; > + i = (hx+(0x4afb0d))&0x800000; > + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ > + k += (i>>23); > + f = __kernel_logf(x); > + x = x - 1; > + GET_FLOAT_WORD(hx,x); > + SET_FLOAT_WORD(hi,hx&0xfffff000); > + lo = x - hi; > + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; > +} > > Copied: stable/8/lib/msun/src/k_log.h (from r216210, > head/lib/msun/src/k_log.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/k_log.h Sun Mar 6 08:49:44 2011 (r219323, copy of > r216210, head/lib/msun/src/k_log.h) > @@ -0,0 +1,116 @@ > + > +/* @(#)e_log.c 1.3 95/01/18 */ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunSoft, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* __kernel_log(x) > + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. > + * > + * The following describes the overall strategy for computing > + * logarithms in base e. The argument reduction and adding the final > + * term of the polynomial are done by the caller for increased accuracy > + * when different bases are used. > + * > + * Method : > + * 1. Argument Reduction: find k and f such that > + * x = 2^k * (1+f), > + * where sqrt(2)/2 < 1+f < sqrt(2) . > + * > + * 2. Approximation of log(1+f). > + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) > + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., > + * = 2s + s*R > + * We use a special Reme algorithm on [0,0.1716] to generate > + * a polynomial of degree 14 to approximate R The maximum error > + * of this polynomial approximation is bounded by 2**-58.45. In > + * other words, > + * 2 4 6 8 10 12 14 > + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s > + * (the values of Lg1 to Lg7 are listed in the program) > + * and > + * | 2 14 | -58.45 > + * | Lg1*s +...+Lg7*s - R(z) | <= 2 > + * | | > + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. > + * In order to guarantee error in log below 1ulp, we compute log > + * by > + * log(1+f) = f - s*(f - R) (if f is not too large) > + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) > + * > + * 3. Finally, log(x) = k*ln2 + log(1+f). > + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) > + * Here ln2 is split into two floating point number: > + * ln2_hi + ln2_lo, > + * where n*ln2_hi is always exact for |n| < 2000. > + * > + * Special cases: > + * log(x) is NaN with signal if x < 0 (including -INF) ; > + * log(+INF) is +INF; log(0) is -INF with signal; > + * log(NaN) is that NaN with no signal. > + * > + * Accuracy: > + * according to an error analysis, the error is always less than > + * 1 ulp (unit in the last place). > + * > + * Constants: > + * The hexadecimal values are the intended ones for the following > + * constants. The decimal values may be used, provided that the > + * compiler will convert from decimal to binary accurately enough > + * to produce the hexadecimal values shown. > + */ > + > +static const double > +Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ > +Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ > +Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ > +Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ > +Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ > +Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ > +Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ > + > +/* > + * We always inline __kernel_log(), since doing so produces a > + * substantial performance improvement (~40% on amd64). > + */ > +static inline double > +__kernel_log(double x) > +{ > + double hfsq,f,s,z,R,w,t1,t2; > + int32_t hx,i,j; > + u_int32_t lx; > + > + EXTRACT_WORDS(hx,lx,x); > + > + f = x-1.0; > + if((0x000fffff&(2+hx))<3) { /* -2**-20 <= f < 2**-20 */ > + if(f==0.0) return 0.0; > + return f*f*(0.33333333333333333*f-0.5); > + } > + s = f/(2.0+f); > + z = s*s; > + hx &= 0x000fffff; > + i = hx-0x6147a; > + w = z*z; > + j = 0x6b851-hx; > + t1= w*(Lg2+w*(Lg4+w*Lg6)); > + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); > + i |= j; > + R = t2+t1; > + if (i>0) { > + hfsq=0.5*f*f; > + return s*(hfsq+R) - hfsq; > + } else { > + return s*(R-f); > + } > +} > > Copied: stable/8/lib/msun/src/k_logf.h (from r216210, > head/lib/msun/src/k_logf.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/k_logf.h Sun Mar 6 08:49:44 2011 (r219323, copy > of r216210, head/lib/msun/src/k_logf.h) > @@ -0,0 +1,55 @@ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunPro, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* __kernel_logf(x) > + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. > + */ > + > +static const float > +/* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ > +Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */ > +Lg2 = 0xccce13.0p-25, /* 0.40000972152 */ > +Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ > +Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ > + > +static inline float > +__kernel_logf(float x) > +{ > + float hfsq,f,s,z,R,w,t1,t2; > + int32_t ix,i,j; > + > + GET_FLOAT_WORD(ix,x); > + > + f = x-(float)1.0; > + if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ > + if(f==0.0) return 0.0; > + return f*f*((float)0.33333333333333333*f-(float)0.5); > + } > + s = f/((float)2.0+f); > + z = s*s; > + ix &= 0x007fffff; > + i = ix-(0x6147a<<3); > + w = z*z; > + j = (0x6b851<<3)-ix; > + t1= w*(Lg2+w*Lg4); > + t2= z*(Lg1+w*Lg3); > + i |= j; > + R = t2+t1; > + if(i>0) { > + hfsq=(float)0.5*f*f; > + return s*(hfsq+R) - hfsq; > + } else { > + return s*(R-f); > + } > +} > > Modified: stable/8/lib/msun/src/math.h > ============================================================================== > --- stable/8/lib/msun/src/math.h Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/src/math.h Sun Mar 6 08:49:44 2011 (r219323) > @@ -235,6 +235,7 @@ double lgamma(double); > long long llrint(double); > long long llround(double); > double log1p(double); > +double log2(double); > double logb(double); > long lrint(double); > long lround(double); > @@ -318,6 +319,7 @@ int ilogbf(float) __pure2; > float ldexpf(float, int); > float log10f(float); > float log1pf(float); > +float log2f(float); > float logf(float); > float modff(float, float *); /* fundamentally !__pure2 */ > > > Modified: stable/8/lib/msun/src/math_private.h > ============================================================================== > --- stable/8/lib/msun/src/math_private.h Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/src/math_private.h Sun Mar 6 08:49:44 2011 (r219323) > @@ -292,6 +292,7 @@ irint(double x) > #define __ieee754_acos acos > #define __ieee754_acosh acosh > #define __ieee754_log log > +#define __ieee754_log2 log2 > #define __ieee754_atanh atanh > #define __ieee754_asin asin > #define __ieee754_atan2 atan2 > @@ -330,6 +331,7 @@ irint(double x) > #define __ieee754_lgammaf_r lgammaf_r > #define __ieee754_gammaf_r gammaf_r > #define __ieee754_log10f log10f > +#define __ieee754_log2f log2f > #define __ieee754_sinhf sinhf > #define __ieee754_hypotf hypotf > #define __ieee754_j0f j0f > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > Hi all! Please MFC this commit to 7-STABLE, or apply the attached patch to graphviz... http://www.freebsd.org/cgi/query-pr.cgi?pr=157217&cat= op@pandora-d src> sysctl kern.osreldate kern.osreldate: 704101 op@pandora-d src> find . -iname "*log*" ./e_log.c ./e_log10.c ./e_log10f.c ./e_logf.c ./s_ilogb.c ./s_ilogbf.c ./s_ilogbl.c ./s_log1p.c ./s_log1pf.c ./s_logb.c ./s_logbf.c thanks, Oliver --00151758b0ac6fc0e904a4f770a2 Content-Type: text/x-diff; charset=US-ASCII; name="patch-lib-ortho-trapezoid.c.diff" Content-Disposition: attachment; filename="patch-lib-ortho-trapezoid.c.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 LS0tIC90bXAvcGF0Y2gtbGliLW9ydGhvLXRyYXBlem9pZC5jCTIwMTEtMDYtMDUgMTU6NDc6MDIu MDAwMDAwMDAwICswMjAwCisrKyAvdXNyL3BvcnRzL2dyYXBoaWNzL2dyYXBodml6L2ZpbGVzL3Bh dGNoLWxpYi1vcnRoby10cmFwZXpvaWQuYwkyMDExLTA2LTA1IDE1OjQ3OjM1LjAwMDAwMDAwMCAr MDIwMApAQCAtNSw3ICs1LDcgQEAKICAjZW5kaWYKICAKICsjaW5jbHVkZSA8c3lzL3BhcmFtLmg+ Ci0rI2lmIF9fRnJlZUJTRF92ZXJzaW9uIDw9IDcwNDEwMCB8fCAoX19GcmVlQlNEX3ZlcnNpb24g Pj0gODAwMDAwICYmIF9fRnJlZUJTRF92ZXJzaW9uIDwgODAyNTAyKSB8fCAoX19GcmVlQlNEX3Zl cnNpb24gPj0gOTAwMDAwICYmIF9fRnJlZUJTRF92ZXJzaW9uIDwgOTAwMDI3KQorKyNpZiBfX0Zy ZWVCU0RfdmVyc2lvbiA8PSA3MDQxMDEgfHwgKF9fRnJlZUJTRF92ZXJzaW9uID49IDgwMDAwMCAm JiBfX0ZyZWVCU0RfdmVyc2lvbiA8IDgwMjUwMikgfHwgKF9fRnJlZUJTRF92ZXJzaW9uID49IDkw MDAwMCAmJiBfX0ZyZWVCU0RfdmVyc2lvbiA8IDkwMDAyNykKICsjZGVmaW5lIGxvZzIoeCkgIChs b2coeCkvbG9nKDIpKQogKyNlbmRpZgogKwo= --00151758b0ac6fc0e904a4f770a2-- From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 6 05:40:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 050B81065678; Mon, 6 Jun 2011 05:40:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70F48FC13; Mon, 6 Jun 2011 05:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p565eqNj013782; Mon, 6 Jun 2011 05:40:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p565eq6l013774; Mon, 6 Jun 2011 05:40:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106060540.p565eq6l013774@svn.freebsd.org> From: Xin LI Date: Mon, 6 Jun 2011 05:40:52 +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: r222735 - stable/8/usr.bin/gzip X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 05:40:53 -0000 Author: delphij Date: Mon Jun 6 05:40:52 2011 New Revision: 222735 URL: http://svn.freebsd.org/changeset/base/222735 Log: MFC r222210, 222211, 222287: - Diff reduction against NetBSD. The most notable change is to zdiff(1) to handle more file formats including bzip2 and xz. - Match symbolic link handling behavior with GNU gzip, bzip2 and xz: When we are operating on a symbolic link pointing to an existing file, bail out by default, but go ahead if -f is specified. Modified: stable/8/usr.bin/gzip/Makefile stable/8/usr.bin/gzip/gzip.1 stable/8/usr.bin/gzip/gzip.c stable/8/usr.bin/gzip/zdiff stable/8/usr.bin/gzip/zdiff.1 stable/8/usr.bin/gzip/zuncompress.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/Makefile ============================================================================== --- stable/8/usr.bin/gzip/Makefile Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/Makefile Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2006/05/12 02:01:15 mrg Exp $ +# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ # $FreeBSD$ .include Modified: stable/8/usr.bin/gzip/gzip.1 ============================================================================== --- stable/8/usr.bin/gzip/gzip.1 Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/gzip.1 Mon Jun 6 05:40:52 2011 (r222735) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2010 +.Dd May 23, 2011 .Dt GZIP 1 .Os .Sh NAME @@ -127,9 +127,9 @@ stream, leaving files intact. This option selects decompression rather than compression. .It Fl f , -force This option turns on force mode. -This allows files with multiple links, overwriting of pre-existing -files, reading from or writing to a terminal, and when combined -with the +This allows files with multiple links, symbolic links to regular files, +overwriting of pre-existing files, reading from or writing to a terminal, +and when combined with the .Fl c option, allowing non-compressed data to pass through unchanged. .It Fl h , -help Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/gzip.c Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -31,7 +31,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ Matthew R. Green. All rights reserved."); -__RCSID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #endif /* not lint */ /* @@ -146,7 +146,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20100407"; +static const char gzip_version[] = "FreeBSD gzip 20110523"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -314,7 +314,7 @@ main(int argc, char **argv) dflag = cflag = 1; #ifdef SMALL -#define OPT_LIST "123456789cdhltV" +#define OPT_LIST "123456789cdhlV" #else #define OPT_LIST "123456789acdfhklLNnqrS:tVv" #endif @@ -918,6 +918,7 @@ gz_uncompress(int in, int out, char *pre case Z_BUF_ERROR: if (z.avail_out > 0 && !done_reading) continue; + case Z_STREAM_END: case Z_OK: break; @@ -1781,7 +1782,8 @@ handle_pathname(char *path) } retry: - if (stat(path, &sb) != 0) { + if (stat(path, &sb) != 0 || (fflag == 0 && cflag == 0 && + lstat(path, &sb) != 0)) { /* lets try .gz if we're decompressing */ if (dflag && s == NULL && errno == ENOENT) { len = strlen(path); Modified: stable/8/usr.bin/gzip/zdiff ============================================================================== --- stable/8/usr.bin/gzip/zdiff Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zdiff Mon Jun 6 05:40:52 2011 (r222735) @@ -1,10 +1,12 @@ #!/bin/sh - # -# $NetBSD: zdiff,v 1.3 2004/03/29 10:01:00 wiz Exp $ +# $NetBSD: zdiff,v 1.5 2010/04/14 20:30:28 joerg Exp $ +# # $OpenBSD: zdiff,v 1.2 2003/07/29 07:42:44 otto Exp $ # #- # Copyright (c) 2003 Todd C. Miller +# Copyright (c) 2010 Joerg Sonnenberger # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,7 +33,57 @@ case $0 in *) prog=diff ;; esac -USAGE="usage: z$prog [options] file1 [file2]" +USAGE="usage: $0 [options] file1 [file2]" + +check_suffix() { + case "$1" in + *[._-][Zz]) + setvar $2 "${1%??}" + setvar $3 "gzip -cdqf" + ;; + *[._-]bz) + setvar $2 "${1%???}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]gz) + setvar $2 "${1%???}" + setvar $3 "gzip -cdqf" + ;; + *[._-]xz) + setvar $2 "${1%???}" + setvar $3 "xz -cdqf" + ;; + *[._-]bz2) + setvar $2 "${1%????}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]lzma) + setvar $2 "${1%?????}" + setvar $3 "xz -cdqf" + ;; + *.t[ag]z) + setvar $2 "${1%??}"ar + setvar $3 "gzip -cdqf" + ;; + *.tbz) + setvar $2 "${1%??}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.tbz2) + setvar $2 "${1%???}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.t[lx]z) + setvar $2 "${1%??}"ar + setvar $3 "xz -cdqf" + ;; + *) + setvar $2 "$1" + setvar $3 "" + ;; + esac +} + # Pull out any command line flags so we can pass them to diff/cmp # XXX - assumes there is no optarg @@ -42,6 +94,9 @@ while test $# -ne 0; do shift break ;; + -) + break + ;; -*) flags="$flags $1" shift @@ -55,52 +110,28 @@ done if [ $# -eq 1 ]; then # One file given, compare compressed to uncompressed files="$1" - case "$1" in - *[._-][Zz]) - files="${1%??}" - ;; - *[._-]gz) - files="${1%???}" - ;; - *.t[ag]z) - files="${1%??}"ar - ;; - *) echo "z$prog: unknown suffix" 1>&2 - exit 1 - esac - gzip -cdfq "$1" | $prog $flags - "$files" + check_suffix "$1" files filt + if [ -z "$filt" ]; then + echo "z$prog: unknown suffix" 1>&2 + exit 1 + fi + $filt -- "$1" | $prog $flags -- - "$files" status=$? elif [ $# -eq 2 ]; then # Two files given, compare the two uncompressing as needed - case "$1" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - files=- - filt="gzip -cdfq $1" - ;; - *) - files="$1" - ;; - esac - case "$2" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - if [ "$files" = "-" ]; then - tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 - trap "rm -f $tmp" 0 1 2 3 13 15 - gzip -cdfq "$2" > $tmp - files="$files $tmp" - else - files="$files -" - filt="gzip -cdfq $2" - fi - ;; - *) - files="$files $2" - ;; - esac - if [ -n "$filt" ]; then - $filt | $prog $flags $files + check_suffix "$1" files filt + check_suffix "$2" files2 filt2 + if [ -z "$filt" -a -z "$filt2" ]; then + $prog $flags -- "$1" "$2" + elif [ -z "$filt" -a -n "$filt2" -a "$1" != "-" ]; then + $filt2 -- "$2" | $prog $flags -- "$1" - + elif [ -n "$filt" -a -z "$filt2" -a "$2" != "-" ]; then + $filt -- "$1" | $prog $flags -- - "$2" else - $prog $flags $files + tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 + trap "rm -f $tmp" 0 1 2 3 13 15 + ${filt2:-cat} -- "$2" > $tmp || exit $? + ${filt:-cat} -- "$1" | $prog $flags -- - "$tmp" fi status=$? else Modified: stable/8/usr.bin/gzip/zdiff.1 ============================================================================== --- stable/8/usr.bin/gzip/zdiff.1 Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zdiff.1 Mon Jun 6 05:40:52 2011 (r222735) @@ -1,7 +1,8 @@ -.\" $NetBSD: zdiff.1,v 1.3 2003/12/28 12:48:03 wiz Exp $ +.\" $NetBSD: zdiff.1,v 1.5 2010/04/14 19:52:05 wiz Exp $ .\" $OpenBSD: zdiff.1,v 1.2 2003/07/13 17:39:14 millert Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller +.\" Copyright (c) 2010 Joerg Sonnenberger .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd January 26, 2007 +.Dd May 23, 2011 .Dt ZDIFF 1 .Os .Sh NAME @@ -45,15 +46,6 @@ are filters that invoke or .Xr diff 1 respectively to compare compressed files. -Such files generally have a -.Dq Z -or -.Dq gz -extension (both the -.Xr compress 1 -and -.Xr gzip 1 -formats are supported). Any .Ar options that are specified are passed to @@ -70,6 +62,45 @@ When both or .Ar file2 are specified, either file may be compressed. +.Pp +Extensions handled by +.Xr gzip 1 : +.Bl -bullet -compact +.It +z, Z, +.It +gz, +.It +taz, +.It +tgz. +.El +.Pp +Extensions handled by +.Xr bzip2 1 : +.Bl -bullet -compact +.It +bz, +.It +bz2, +.It +tbz, +.It +tbz2. +.El +.Pp +Extensions handled by +.Xr xz 1 : +.Bl -bullet -compact +.It +lzma, +.It +xz, +.It +tlz, +.It +txz. +.El .Sh ENVIRONMENT .Bl -tag -width "TMPDIR" .It Ev TMPDIR @@ -88,9 +119,11 @@ Temporary file for .Nm zdiff . .El .Sh SEE ALSO +.Xr bzip2 1 , .Xr cmp 1 , -.Xr compress 1 , -.Xr diff 1 +.Xr diff 1 , +.Xr gzip 1 , +.Xr xz 1 .Sh CAVEATS .Nm zcmp and Modified: stable/8/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/8/usr.bin/gzip/zuncompress.c Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zuncompress.c Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */ +/* $NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 6 06:47:11 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9947B106566B; Mon, 6 Jun 2011 06:47:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86FF98FC13; Mon, 6 Jun 2011 06:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p566lBIL015952; Mon, 6 Jun 2011 06:47:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p566lBVC015949; Mon, 6 Jun 2011 06:47:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106060647.p566lBVC015949@svn.freebsd.org> From: Xin LI Date: Mon, 6 Jun 2011 06:47:11 +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: r222737 - stable/8/sys/dev/arcmsr X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 06:47:11 -0000 Author: delphij Date: Mon Jun 6 06:47:11 2011 New Revision: 222737 URL: http://svn.freebsd.org/changeset/base/222737 Log: MFC r220403: Update arcmsr(4) to vendor version 1.20.00.21. This release primarily improves command timeout handling. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang Modified: stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Mon Jun 6 05:48:25 2011 (r222736) +++ stable/8/sys/dev/arcmsr/arcmsr.c Mon Jun 6 06:47:11 2011 (r222737) @@ -38,35 +38,42 @@ ** History ** ** REV# DATE NAME DESCRIPTION -** 1.00.00.00 3/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO ** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 ** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, ** prevent cam_periph_error removing all LUN devices of one Target id ** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it ****************************************************************************************** * $FreeBSD$ */ +#if 0 +#define ARCMSR_DEBUG1 1 +#endif #include #include #include @@ -137,9 +144,16 @@ #define CAM_NEW_TRAN_CODE 1 #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.19 2010-11-11" +#if __FreeBSD_version > 500000 +#define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); +#else +#define arcmsr_callout_init(a) callout_init(a); +#endif + +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.21 2010-03-03" #include -#define ARCMSR_SRBS_POOL_SIZE ((sizeof(struct CommandControlBlock) * ARCMSR_MAX_FREESRB_NUM)) +#define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) +#define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) /* ************************************************************************** ************************************************************************** @@ -150,6 +164,7 @@ ************************************************************************** ************************************************************************** */ +static void arcmsr_free_srb(struct CommandControlBlock *srb); static struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb); static u_int8_t arcmsr_seek_cmd2abort(union ccb * abortccb); static int arcmsr_probe(device_t dev); @@ -177,6 +192,10 @@ static int arcmsr_resume(device_t dev); static int arcmsr_suspend(device_t dev); static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb); static void arcmsr_polling_devmap(void* arg); +static void arcmsr_srb_timeout(void* arg); +#ifdef ARCMSR_DEBUG1 +static void arcmsr_dump_data(struct AdapterControlBlock *acb); +#endif /* ************************************************************************** ************************************************************************** @@ -220,17 +239,13 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */ #endif #if __FreeBSD_version >= 501000 - #ifndef D_NEEDGIANT - #define D_NEEDGIANT 0x00400000 /* driver want Giant */ - #endif - #ifndef D_VERSION - #define D_VERSION 0x20011966 - #endif static struct cdevsw arcmsr_cdevsw={ - #if __FreeBSD_version > 502010 + #if __FreeBSD_version >= 503000 .d_version = D_VERSION, #endif + #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) .d_flags = D_NEEDGIANT, + #endif .d_open = arcmsr_open, /* open */ .d_close = arcmsr_close, /* close */ .d_ioctl = arcmsr_ioctl, /* ioctl */ @@ -671,6 +686,8 @@ static void arcmsr_srb_complete(struct C struct AdapterControlBlock *acb=srb->acb; union ccb * pccb=srb->pccb; + if(srb->srb_flags & SRB_FLAG_TIMER_START) + callout_stop(&srb->ccb_callout); if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -690,11 +707,11 @@ static void arcmsr_srb_complete(struct C pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } } - srb->startdone=ARCMSR_SRB_DONE; - srb->srb_flags=0; - acb->srbworkingQ[acb->workingsrb_doneindex]=srb; - acb->workingsrb_doneindex++; - acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + if(srb->srb_state != ARCMSR_SRB_TIMEOUT) + arcmsr_free_srb(srb); +#ifdef ARCMSR_DEBUG1 + acb->pktReturnCount++; +#endif xpt_done(pccb); return; } @@ -761,7 +778,7 @@ static void arcmsr_drain_donequeue(struc /* check if command done with no error*/ switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_C: - srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFF0));/*frame must be 32 bytes aligned*/ + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/ break; case ACB_ADAPTER_TYPE_A: case ACB_ADAPTER_TYPE_B: @@ -769,22 +786,51 @@ static void arcmsr_drain_donequeue(struc srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ break; } - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: srb='%p' isr got aborted command \n", acb->pci_unit, srb); - srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; - arcmsr_srb_complete(srb, 1); + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state == ARCMSR_SRB_TIMEOUT) { + arcmsr_free_srb(srb); + printf("arcmsr%d: srb='%p' return srb has been timeouted\n", acb->pci_unit, srb); return; } - printf("arcmsr%d: isr get an illegal srb command done" - "acb='%p' srb='%p' srbacb='%p' startdone=0x%xsrboutstandingcount=%d \n", - acb->pci_unit, acb, srb, srb->acb,srb->startdone, acb->srboutstandingcount); + printf("arcmsr%d: return srb has been completed\n" + "srb='%p' srb_state=0x%x outstanding srb count=%d \n", + acb->pci_unit, srb, srb->srb_state, acb->srboutstandingcount); return; } arcmsr_report_srb_state(acb, srb, error); return; } /* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_srb_timeout(void* arg) +{ + struct CommandControlBlock *srb = (struct CommandControlBlock *)arg; + struct AdapterControlBlock *acb; + int target, lun; + u_int8_t cmd; + + target=srb->pccb->ccb_h.target_id; + lun=srb->pccb->ccb_h.target_lun; + acb = srb->acb; + ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); + if(srb->srb_state == ARCMSR_SRB_START) + { + cmd = srb->pccb->csio.cdb_io.cdb_bytes[0]; + srb->srb_state = ARCMSR_SRB_TIMEOUT; + srb->pccb->ccb_h.status |= CAM_CMD_TIMEOUT; + arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: scsi id %d lun %d cmd=0x%x srb='%p' ccb command time out!\n", + acb->pci_unit, target, lun, cmd, srb); + } + ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); +#ifdef ARCMSR_DEBUG1 + arcmsr_dump_data(acb); +#endif +} + +/* ********************************************************************** ********************************************************************** */ @@ -855,18 +901,25 @@ static void arcmsr_iop_reset(struct Adap arcmsr_abort_allcmd(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { - srb->startdone=ARCMSR_SRB_ABORTED; + if(srb->srb_state==ARCMSR_SRB_START) { + srb->srb_state=ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: scsi id=%d lun=%d srb='%p' aborted\n" + , acb->pci_unit, srb->pccb->ccb_h.target_id + , srb->pccb->ccb_h.target_lun, srb); } } /* enable all outbound interrupt */ arcmsr_enable_allintr(acb, intmask_org); } - atomic_set_int(&acb->srboutstandingcount, 0); + acb->srboutstandingcount=0; acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount = 0; + acb->pktReturnCount = 0; +#endif return; } /* @@ -968,7 +1021,7 @@ static void arcmsr_post_srb(struct Adapt bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); atomic_add_int(&acb->srboutstandingcount, 1); - srb->startdone=ARCMSR_SRB_START; + srb->srb_state=ARCMSR_SRB_START; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { @@ -1242,13 +1295,9 @@ static void arcmsr_poll(struct cam_sim * struct AdapterControlBlock *acb; acb = (struct AdapterControlBlock *)cam_sim_softc(psim); -#if __FreeBSD_version < 700025 ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); -#endif arcmsr_interrupt(acb); -#if __FreeBSD_version < 700025 ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); -#endif return; } /* @@ -1377,13 +1426,14 @@ static void arcmsr_abort_dr_ccbs(struct for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) { srb = acb->psrb_pool[i]; - if (srb->startdone == ARCMSR_SRB_START) + if (srb->srb_state == ARCMSR_SRB_START) { if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) { - srb->startdone = ARCMSR_SRB_ABORTED; + srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: abort scsi id %d lun %d srb=%p \n", acb->pci_unit, target, lun, srb); } } } @@ -1461,7 +1511,7 @@ static void arcmsr_dr_handle(struct Adap } else {/* unit arrived */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, ARRIVING!!!\n",target,lun); + printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); arcmsr_rescan_lun(acb, target, lun); acb->devstate[target][lun] = ARECA_RAID_GOOD; } @@ -2014,14 +2064,33 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada ************************************************************************** ************************************************************************** */ +static void arcmsr_free_srb(struct CommandControlBlock *srb) +{ + struct AdapterControlBlock *acb; + int mutex; + + acb = srb->acb; + mutex = mtx_owned(&acb->qbuffer_lock); + if( mutex == 0 ) + ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); + srb->srb_state=ARCMSR_SRB_DONE; + srb->srb_flags=0; + acb->srbworkingQ[acb->workingsrb_doneindex]=srb; + acb->workingsrb_doneindex++; + acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + if( mutex == 0 ) + ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); +} +/* +************************************************************************** +************************************************************************** +*/ struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb) { struct CommandControlBlock *srb=NULL; u_int32_t workingsrb_startindex, workingsrb_doneindex; -#if __FreeBSD_version < 700025 ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); -#endif workingsrb_doneindex=acb->workingsrb_doneindex; workingsrb_startindex=acb->workingsrb_startindex; srb=acb->srbworkingQ[workingsrb_startindex]; @@ -2032,9 +2101,7 @@ struct CommandControlBlock * arcmsr_get_ } else { srb=NULL; } -#if __FreeBSD_version < 700025 ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); -#endif return(srb); } /* @@ -2250,6 +2317,9 @@ static void arcmsr_execute_srb(void *arg pccb=srb->pccb; target=pccb->ccb_h.target_id; lun=pccb->ccb_h.target_lun; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount++; +#endif if(error != 0) { if(error != EFBIG) { printf("arcmsr%d: unexpected error %x" @@ -2274,13 +2344,14 @@ static void arcmsr_execute_srb(void *arg return; } if(acb->devstate[target][lun]==ARECA_RAID_GONE) { - u_int8_t block_cmd; + u_int8_t block_cmd, cmd; - block_cmd=pccb->csio.cdb_io.cdb_bytes[0] & 0x0f; + cmd = pccb->csio.cdb_io.cdb_bytes[0]; + block_cmd= cmd & 0x0f; if(block_cmd==0x08 || block_cmd==0x0a) { printf("arcmsr%d:block 'read/write' command " - "with gone raid volume Cmd=%2x, TargetId=%d, Lun=%d \n" - , acb->pci_unit, block_cmd, target, lun); + "with gone raid volume Cmd=0x%2x, TargetId=%d, Lun=%d \n" + , acb->pci_unit, cmd, target, lun); pccb->ccb_h.status |= CAM_DEV_NOT_THERE; arcmsr_srb_complete(srb, 0); return; @@ -2302,10 +2373,13 @@ static void arcmsr_execute_srb(void *arg } pccb->ccb_h.status |= CAM_SIM_QUEUED; arcmsr_build_srb(srb, dm_segs, nseg); -/* if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz) / 1000, arcmsr_srb_timeout, srb); -*/ arcmsr_post_srb(acb, srb); + if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) + { + arcmsr_callout_init(&srb->ccb_callout); + callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + srb->srb_flags |= SRB_FLAG_TIMER_START; + } return; } /* @@ -2330,28 +2404,28 @@ static u_int8_t arcmsr_seek_cmd2abort(un *************************************************************************** */ if(acb->srboutstandingcount!=0) { + /* disable all outbound interrupt */ + intmask_org=arcmsr_disable_allintr(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { + if(srb->srb_state==ARCMSR_SRB_START) { if(srb->pccb==abortccb) { - srb->startdone=ARCMSR_SRB_ABORTED; + srb->srb_state=ARCMSR_SRB_ABORTED; printf("arcmsr%d:scsi id=%d lun=%d abort srb '%p'" "outstanding command \n" , acb->pci_unit, abortccb->ccb_h.target_id , abortccb->ccb_h.target_lun, srb); - goto abort_outstanding_cmd; + arcmsr_polling_srbdone(acb, srb); + /* enable outbound Post Queue, outbound doorbell Interrupt */ + arcmsr_enable_allintr(acb, intmask_org); + return (TRUE); } } } + /* enable outbound Post Queue, outbound doorbell Interrupt */ + arcmsr_enable_allintr(acb, intmask_org); } return(FALSE); -abort_outstanding_cmd: - /* disable all outbound interrupt */ - intmask_org=arcmsr_disable_allintr(acb); - arcmsr_polling_srbdone(acb, srb); - /* enable outbound Post Queue, outbound doorbell Interrupt */ - arcmsr_enable_allintr(acb, intmask_org); - return (TRUE); } /* **************************************************************************** @@ -2764,8 +2838,8 @@ polling_ccb_retry: (acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" "poll command abort successfully \n" , acb->pci_unit @@ -2825,8 +2899,8 @@ polling_ccb_retry: (acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" "poll command abort successfully \n" , acb->pci_unit @@ -2877,12 +2951,12 @@ polling_ccb_retry: } flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ - srb=(struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFF0));/*frame must be 32 bytes aligned*/ + srb=(struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; if (poll_srb != NULL) poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; @@ -3213,7 +3287,7 @@ static u_int32_t arcmsr_iop_confirm(stru printf( "arcmsr%d: 'set window of post command Q' timeout\n", acb->pci_unit); return FALSE; } - post_queue_phyaddr = srb_phyaddr + ARCMSR_MAX_FREESRB_NUM*sizeof(struct CommandControlBlock) + post_queue_phyaddr = srb_phyaddr + ARCMSR_SRBS_POOL_SIZE + offsetof(struct HBB_MessageUnit, post_qbuffer); CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); /* driver "set config" signature */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1], srb_phyaddr_hi32); /* normal should be zero */ @@ -3320,8 +3394,8 @@ static void arcmsr_map_free_srb(void *ar srb_tmp->cdb_shifted_phyaddr=(acb->adapter_type==ACB_ADAPTER_TYPE_C)?srb_phyaddr:(srb_phyaddr >> 5); srb_tmp->acb=acb; acb->srbworkingQ[i]=acb->psrb_pool[i]=srb_tmp; - srb_phyaddr=srb_phyaddr+sizeof(struct CommandControlBlock); - srb_tmp++; + srb_phyaddr=srb_phyaddr+SRB_SIZE; + srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; return; @@ -3407,7 +3481,7 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ BUS_SPACE_UNRESTRICTED, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ NULL, /*lockarg*/ NULL, #endif @@ -3421,7 +3495,11 @@ static u_int32_t arcmsr_initialize(devic if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, +#ifdef PAE + /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, +#else /*lowaddr*/ BUS_SPACE_MAXADDR, +#endif /*highaddr*/ BUS_SPACE_MAXADDR, /*filter*/ NULL, /*filterarg*/ NULL, @@ -3429,13 +3507,9 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ busdma_lock_mutex, - #if __FreeBSD_version >= 700025 /*lockarg*/ &acb->qbuffer_lock, - #else - /*lockarg*/ &Giant, - #endif #endif &acb->dm_segs_dmat) != 0) { @@ -3456,7 +3530,7 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ NULL, /*lockarg*/ NULL, #endif @@ -3550,7 +3624,8 @@ static u_int32_t arcmsr_initialize(devic acb->bhandle[i]=rman_get_bushandle(acb->sys_res_arcmsr[i]); } freesrb=(struct CommandControlBlock *)acb->uncacheptr; - acb->pmu=(struct MessageUnit_UNION *)&freesrb[ARCMSR_MAX_FREESRB_NUM]; +// acb->pmu=(struct MessageUnit_UNION *)&freesrb[ARCMSR_MAX_FREESRB_NUM]; + acb->pmu=(struct MessageUnit_UNION *)((unsigned long)freesrb+ARCMSR_SRBS_POOL_SIZE); phbbmu=(struct HBB_MessageUnit *)acb->pmu; phbbmu->hbb_doorbell=(struct HBB_DOORBELL *)mem_base[0]; phbbmu->hbb_rwbuffer=(struct HBB_RWBUFFER *)mem_base[1]; @@ -3711,14 +3786,11 @@ static int arcmsr_attach(device_t dev) #if __FreeBSD_version > 500005 (void)make_dev_alias(acb->ioctl_dev, "arc%d", unit); #endif -#if __FreeBSD_version > 500000 - callout_init(&acb->devmap_callout, /*mpsafe*/1); -#else - callout_init(&acb->devmap_callout); -#endif + arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); return 0; } + /* ************************************************************************ ************************************************************************ @@ -3802,16 +3874,20 @@ static int arcmsr_shutdown(device_t dev) arcmsr_abort_allcmd(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { - srb->startdone=ARCMSR_SRB_ABORTED; + if(srb->srb_state==ARCMSR_SRB_START) { + srb->srb_state=ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); } } } - atomic_set_int(&acb->srboutstandingcount, 0); + acb->srboutstandingcount=0; acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount = 0; + acb->pktReturnCount = 0; +#endif ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); return (0); } @@ -3842,4 +3918,15 @@ static int arcmsr_detach(device_t dev) return (0); } +#ifdef ARCMSR_DEBUG1 +static void arcmsr_dump_data(struct AdapterControlBlock *acb) +{ + if((acb->pktRequestCount - acb->pktReturnCount) == 0) + return; + printf("Command Request Count =0x%x\n",acb->pktRequestCount); + printf("Command Return Count =0x%x\n",acb->pktReturnCount); + printf("Command (Req-Rtn) Count =0x%x\n",(acb->pktRequestCount - acb->pktReturnCount)); + printf("Queued Command Count =0x%x\n",acb->srboutstandingcount); +} +#endif Modified: stable/8/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.h Mon Jun 6 05:48:25 2011 (r222736) +++ stable/8/sys/dev/arcmsr/arcmsr.h Mon Jun 6 06:47:11 2011 (r222737) @@ -46,7 +46,7 @@ #define ARCMSR_MAX_OUTSTANDING_CMD 256 #define ARCMSR_MAX_START_JOB 257 #define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 320 +#define ARCMSR_MAX_FREESRB_NUM 384 #define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ #define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ #define ARCMSR_MAX_ADAPTER 4 @@ -714,23 +714,13 @@ struct CommandControlBlock { u_int32_t cdb_shifted_phyaddr; /* 504-507 */ u_int32_t arc_cdb_size; /* 508-511 */ /* ======================512+32 bytes============================ */ -#if defined(__x86_64__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 520-523 524-527 */ bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ u_int16_t srb_flags; /* 536-537 */ - u_int16_t startdone; /* 538-539 */ - u_int32_t reserved2; /* 540-543 */ -#else - union ccb *pccb; /* 512-515 pointer of freebsd scsi command */ - struct AdapterControlBlock *acb; /* 516-519 */ - bus_dmamap_t dm_segs_dmamap; /* 520-523 */ - u_int16_t srb_flags; /* 524-525 */ - u_int16_t startdone; /* 526-527 */ - u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ -#endif + u_int16_t srb_state; /* 538-539 */ + struct callout ccb_callout; /* ========================================================== */ -/* struct callout ccb_callout; */ }; /* srb_flags */ #define SRB_FLAG_READ 0x0000 @@ -742,7 +732,8 @@ struct CommandControlBlock { #define SRB_FLAG_DMACONSISTENT 0x0020 #define SRB_FLAG_DMAWRITE 0x0040 #define SRB_FLAG_PKTBIND 0x0080 -/* startdone */ +#define SRB_FLAG_TIMER_START 0x0080 +/* srb_state */ #define ARCMSR_SRB_DONE 0x0000 #define ARCMSR_SRB_UNBUILD 0x0000 #define ARCMSR_SRB_TIMEOUT 0x1111 @@ -775,18 +766,18 @@ struct AdapterControlBlock { #if __FreeBSD_version < 503000 dev_t ioctl_dev; #else - struct cdev * ioctl_dev; + struct cdev *ioctl_dev; #endif int pci_unit; - struct resource * sys_res_arcmsr[2]; - struct resource * irqres; - void * ih; /* interrupt handle */ + struct resource *sys_res_arcmsr[2]; + struct resource *irqres; + void *ih; /* interrupt handle */ /* Hooks into the CAM XPT */ struct cam_sim *psim; struct cam_path *ppath; - u_int8_t * uncacheptr; + u_int8_t *uncacheptr; unsigned long vir2phy_offset; union { unsigned long phyaddr; @@ -799,14 +790,14 @@ struct AdapterControlBlock { /* Offset is used in making arc cdb physical to virtual calculations */ u_int32_t outbound_int_enable; - struct MessageUnit_UNION * pmu; /* message unit ATU inbound base address0 */ + struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ u_int8_t adapter_index; /* */ u_int8_t irq; u_int16_t acb_flags; /* */ - struct CommandControlBlock * psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ - struct CommandControlBlock * srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ + struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ + struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ int32_t workingsrb_doneindex; /* done srb array index */ int32_t workingsrb_startindex; /* start srb array index */ int32_t srboutstandingcount; @@ -835,6 +826,10 @@ struct AdapterControlBlock { char firm_version[20]; /*17,68-83*/ char device_map[20]; /*21,84-99 */ struct callout devmap_callout; +#ifdef ARCMSR_DEBUG1 + u_int32_t pktRequestCount; + u_int32_t pktReturnCount; +#endif };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 6 07:15:19 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626351065677; Mon, 6 Jun 2011 07:15:19 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 514F98FC1D; Mon, 6 Jun 2011 07:15:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p567FJTC016927; Mon, 6 Jun 2011 07:15:19 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p567FJk0016925; Mon, 6 Jun 2011 07:15:19 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106060715.p567FJk0016925@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 6 Jun 2011 07:15:19 +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: r222739 - stable/8/share/man/man7 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 07:15:19 -0000 Author: bcr (doc committer) Date: Mon Jun 6 07:15:19 2011 New Revision: 222739 URL: http://svn.freebsd.org/changeset/base/222739 Log: MFC r222492: Add a short description about NO_CHECKSUM. PR: docs/155980 Submitted by KOIE Hidetaka (koie at suri co jp) Modified: stable/8/share/man/man7/ports.7 (contents, props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Mon Jun 6 07:14:29 2011 (r222738) +++ stable/8/share/man/man7/ports.7 Mon Jun 6 07:15:19 2011 (r222739) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2011 +.Dd May 30, 2011 .Dt PORTS 7 .Os .Sh NAME @@ -479,6 +479,8 @@ Of course, these ports may not work as e what you are doing and are sure about installing a forbidden port, then .Va NO_IGNORE lets you do it. +.It Va NO_CHECKSUM +If defined, skip verifying the port's checksum. .It Va TRYBROKEN If defined, attempt to build a port even if it is marked as .Aq Va BROKEN . From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 6 07:26:07 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94BE3106564A; Mon, 6 Jun 2011 07:26:07 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797EF8FC08; Mon, 6 Jun 2011 07:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p567Q7do017335; Mon, 6 Jun 2011 07:26:07 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p567Q77j017333; Mon, 6 Jun 2011 07:26:07 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106060726.p567Q77j017333@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 6 Jun 2011 07:26:07 +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: r222740 - stable/8/usr.sbin/usbdump X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 07:26:07 -0000 Author: bcr (doc committer) Date: Mon Jun 6 07:26:07 2011 New Revision: 222740 URL: http://svn.freebsd.org/changeset/base/222740 Log: MFC r217358, 222286, 222519: r222519: Minor wording adjustments to usbdump(8). PR: docs/157317 Submitted by: Warren Block (wblock at wonkity dot com) Reviewed by: hps@ r222286: [mdoc] Fixed .Dt call. r217358: Documents OUTPUT formats. While I'm here cleans up styles and words. Reviewed by: brueffer@ Modified: stable/8/usr.sbin/usbdump/usbdump.8 Directory Properties: stable/8/usr.sbin/usbdump/ (props changed) Modified: stable/8/usr.sbin/usbdump/usbdump.8 ============================================================================== --- stable/8/usr.sbin/usbdump/usbdump.8 Mon Jun 6 07:15:19 2011 (r222739) +++ stable/8/usr.sbin/usbdump/usbdump.8 Mon Jun 6 07:26:07 2011 (r222740) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2010 -.Dt usbdump 8 +.Dd May 31, 2011 +.Dt USBDUMP 8 .Os .Sh NAME .Nm usbdump @@ -41,37 +41,92 @@ .Sh DESCRIPTION The .Nm -utility provides a way to dump USB packets on each host controller. +utility provides a way to dump USB packets on host controllers. .Pp -The following options are accepted. +The following options are accepted: .Bl -tag -width ".Fl f Ar file" .It Fl i Ar ifname -Listen on USB bus interface. +Listen on USB bus interface +.Ar ifname . .It Fl r Ar file -Read the raw packets from file. +Read the raw packets from +.Ar file . .It Fl s Ar snaplen -Snapshot bytes from each packet. +Snapshot +.Ar snaplen +bytes from each packet. .It Fl v Enable debugging messages. -When it defined multiple times the verbose level increases. +When defined multiple times the verbosity level increases. .It Fl w Ar file -Write the raw packets to file. +Write the raw packets to +.Ar file . .El .Sh EXAMPLES -Captures the USB raw packets alive on usbus2: +Capture the USB raw packets on usbus2: .Pp .Dl "usbdump -i usbus2 -s 256 -v" .Pp -Dumps the USB raw packets of usbus2 into the file without packet +Dump the USB raw packets of usbus2 into the file without packet size limit: .Pp .Dl "usbdump -i usbus2 -s 0 -w /tmp/dump_pkts" .Pp -Read the USB raw packets from the file: +Read and display the USB raw packets from previous file: .Pp .Dl "usbdump -r /tmp/dump_pkts -v" +.Sh OUTPUT FORMAT +The output format of +.Nm +is as follows: +.Pp +.Dl "