From nobody@FreeBSD.org  Mon May 10 09:53:24 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 06E8316A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 09:53:24 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D3D0943D31
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 09:53:23 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i4AGrNNY049858
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 May 2004 09:53:23 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i4AGrNeX049857;
	Mon, 10 May 2004 09:53:23 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200405101653.i4AGrNeX049857@www.freebsd.org>
Date: Mon, 10 May 2004 09:53:23 -0700 (PDT)
From: HITOSHI Osada <qfh02545@nifty.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mpt has a bug when creating chain elements.
X-Send-Pr-Version: www-2.3

>Number:         66479
>Category:       kern
>Synopsis:       mpt has a bug when creating chain elements.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 10 10:00:39 PDT 2004
>Closed-Date:    Tue Aug 24 03:48:52 GMT 2004
>Last-Modified:  Tue Aug 24 10:50:22 GMT 2004
>Originator:     HITOSHI Osada
>Release:        5.2
>Organization:
>Environment:
>Description:
There is a bug in mpt_run_xfer().

I found this bug in NetBSD and the same bug exists in mpt_freebsd.c.
>How-To-Repeat:
Access SCSI disks via mpt.
>Fix:
--- mpt_freebsd.c~      2004-05-11 01:42:29.000000000 +0900
+++ mpt_freebsd.c       2004-05-11 01:50:06.000000000 +0900
@@ -268,11 +268,13 @@
                                ntodo = MPT_NSGL(mpt) - 1;
                                ce->NextChainOffset = (MPT_RQSL(mpt) -
                                    sizeof (SGE_SIMPLE32)) >> 2;
+                               ce->Length = MPT_NSGL(mpt)
+                                               * sizeof(SGE_SIMPLE32);
                        } else {
                                ntodo = nleft;
                                ce->NextChainOffset = 0;
+                               ce->Length = ntodo * sizeof (SGE_SIMPLE32);
                        }
-                       ce->Length = ntodo * sizeof (SGE_SIMPLE32);
                        ce->Address = req->req_pbuf +
                            ((char *)se - (char *)mpt_req);
                        ce->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dwhite 
State-Changed-When: Mon Aug 23 00:16:07 GMT 2004 
State-Changed-Why:  
marcus has determined this patch allows him to install 5.2.1 on his  
Dell Precision 360, and while I never had a problem on my PowerEdge 1750, 
it doesn't break it either.   

I'll push to get this committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66479 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dwhite 
State-Changed-When: Tue Aug 24 03:48:05 GMT 2004 
State-Changed-Why:  
This patch has been committed, and will be proposed to be merged to RELENG_5 
so marcus can install 5.3 on his machine. :-)  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66479 

From: James Raftery <james@now.ie>
To: freebsd-gnats-submit@FreeBSD.org, qfh02545@nifty.com
Cc:  
Subject: Re: kern/66479: mpt has a bug when creating chain elements.
Date: Tue, 24 Aug 2004 11:40:54 +0100

 Hi,
 
 I can confirm success too, applying the patch to RELENG_5_2 on a
 PowerEdge 400SC.
 
 
 Thanks,
 james
>Unformatted:
