From hmo@sep.oldach.net  Sun Jun 10 19:22:44 2012
Return-Path: <hmo@sep.oldach.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 487C1106566C;
	Sun, 10 Jun 2012 19:22:44 +0000 (UTC)
	(envelope-from hmo@sep.oldach.net)
Received: from rigel.oldach.net (rigel.oldach.net [194.8.96.250])
	by mx1.freebsd.org (Postfix) with ESMTP id BA9618FC0C;
	Sun, 10 Jun 2012 19:22:43 +0000 (UTC)
Received: from sep.oldach.net (hmo.in-vpn.de [217.197.85.210])
	by rigel.oldach.net (8.14.5/8.14.5/hmo30jul04) with ESMTP id q5AJF4Lo026290
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sun, 10 Jun 2012 21:15:04 +0200 (CEST)
	(envelope-from hmo@sep.oldach.net)
Received: from sep.oldach.net (localhost [127.0.0.1])
	by sep.oldach.net (8.14.5/8.14.5/hmo26jun05) with ESMTP id q5AJF3mV003721
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 10 Jun 2012 21:15:03 +0200 (CEST)
	(envelope-from hmo@sep.oldach.net)
Received: (from hmo@localhost)
	by sep.oldach.net (8.14.5/8.14.5/Submit/hmo26jun05) id q5AJF3ao003720;
	Sun, 10 Jun 2012 21:15:03 +0200 (CEST)
	(envelope-from hmo)
Message-Id: <201206101915.q5AJF3ao003720@sep.oldach.net>
Date: Sun, 10 Jun 2012 21:15:03 +0200 (CEST)
From: Helge Oldach <sys-dev-sym@oldach.net>
Reply-To: Helge Oldach <sys-dev-sym@oldach.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: marius@freebsd.org (Marius Strobl)
Subject: [patch] sys/dev/sym partly broken per r236061
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         168928
>Category:       kern
>Synopsis:       [patch] sys/dev/sym partly broken per r236061
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    marius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 10 19:30:10 UTC 2012
>Closed-Date:    Sun Jun 17 09:52:53 UTC 2012
>Last-Modified:  Sun Jun 17 09:52:53 UTC 2012
>Originator:     Helge Oldach
>Release:        FreeBSD 8.3-1226 i386
>Organization:
>Environment:

System: FreeBSD localhost 8.3-1226 FreeBSD 8.3-1226 #0: Sun Jun 10 18:58:50 CEST 2012 toor@localhost:/usr/obj/usr/src/sys/HMO i386

>Description:

I am running a machine with a sym53c810 based PCI board. Connected to
this board is a SCSI based Microtek scanner that all of a sudden fails
to work after a recent kernel rebuild.

After some debugging work turned out that r236061 was MFC'ed a few days
ago to src/sys/dev/sym/sym_hipd.c. I have factored down the part of this
MFC that relates to the following commit comment:

  When creating the DMA tag for user data, don't ask for more segments
  than required for handling MAXPHYS and report the resulting maximum
  I/O size to CAM instead of implicitly limiting it to DFLTPHYS.

When I revert this part of the MFC with the following patch my scanner
works again.

--- sym_hipd.c.ctm	2012-06-03 15:13:10.000000000 +0200
+++ sym_hipd.c	2012-06-10 20:44:32.000000000 +0200
@@ -1609,7 +1609,6 @@
 	u_int	features;	/* Chip features map		*/
 	u_char	myaddr;		/* SCSI id of the adapter	*/
 	u_char	maxburst;	/* log base 2 of dwords burst	*/
-	u_char	maxsegcnt;	/* Max DMA S/G segments		*/
 	u_char	maxwide;	/* Maximum transfer width	*/
 	u_char	minsync;	/* Min sync period factor (ST)	*/
 	u_char	maxsync;	/* Max sync period factor (ST)	*/
@@ -8135,7 +8134,6 @@
 			cpi->xport_specific.spi.ppr_options =
 			    SID_SPI_CLOCK_DT_ST;
 		}
-		cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY;
 		sym_xpt_done2(np, ccb, CAM_REQ_CMP);
 		break;
 	case XPT_ABORT:
@@ -8539,11 +8537,9 @@
 	/*
 	 *  Allocate a tag for the DMA of user data.
 	 */
-	np->maxsegcnt = MIN(SYM_CONF_MAX_SG,
-	    (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1);
 	if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY,
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
-	    BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY,
+	    BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY,
 	    BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) {
 		device_printf(dev, "failed to create DMA tag.\n");
 		goto attach_failed;

It apparently seems that the segmenting logic mentioned in the commit
message is broken. Unfortunately I don't understand enough of the logic
to make a more educated bug report.

However I am a bit puzzled by the MIN() clause which seems to deal with
strange numbers. It is numerically identical to:

	np->maxsegcnt = MIN(33,
	    (131072 / 16777216) + 1);

It seems to me that the result will always be 1, as all constants are
static. As MAXPHYS can be defined in the kernel config file, only for
unreasonably huge MAXPHYS definitions it can grow beyond 1. Is this
really intended?

>How-To-Repeat:

>Fix:

The patch above reverts the DMA tag segmenting logic effectively, but it
also drops it entirely.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->marius 
Responsible-Changed-By: marius 
Responsible-Changed-When: Sun Jun 10 20:26:10 UTC 2012 
Responsible-Changed-Why:  
grab 

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

From: Marius Strobl <marius@alchemy.franken.de>
To: Helge Oldach <sys-dev-sym@oldach.net>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/168928: [patch] sys/dev/sym partly broken per r236061
Date: Sun, 10 Jun 2012 22:25:47 +0200

 --MGYHOYXEY6WxJCY8
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Sun, Jun 10, 2012 at 09:15:03PM +0200, Helge Oldach wrote:
 > 
 > However I am a bit puzzled by the MIN() clause which seems to deal with
 > strange numbers. It is numerically identical to:
 > 
 > 	np->maxsegcnt = MIN(33,
 > 	    (131072 / 16777216) + 1);
 > 
 > It seems to me that the result will always be 1, as all constants are
 > static. As MAXPHYS can be defined in the kernel config file, only for
 > unreasonably huge MAXPHYS definitions it can grow beyond 1. Is this
 > really intended?
 
 Err, yes, that's a thinko. Could you please test how things behave
 with the attached patch?
 
 Marius
 
 
 --MGYHOYXEY6WxJCY8
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="sym_maxio_fix.diff"
 
 Index: sym_hipd.c
 ===================================================================
 --- sym_hipd.c	(revision 236488)
 +++ sym_hipd.c	(working copy)
 @@ -8135,7 +8135,7 @@ static void sym_action2(struct cam_sim *sim, union
  			cpi->xport_specific.spi.ppr_options =
  			    SID_SPI_CLOCK_DT_ST;
  		}
 -		cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY;
 +		cpi->maxio = np->maxsegcnt * PAGE_SIZE;
  		sym_xpt_done2(np, ccb, CAM_REQ_CMP);
  		break;
  	case XPT_ABORT:
 @@ -8536,8 +8536,7 @@ sym_pci_attach(device_t dev)
  	/*
  	 *  Allocate a tag for the DMA of user data.
  	 */
 -	np->maxsegcnt = MIN(SYM_CONF_MAX_SG,
 -	    (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1);
 +	np->maxsegcnt = MIN(SYM_CONF_MAX_SG, (MAXPHYS / PAGE_SIZE) + 1);
  	if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY,
  	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
  	    BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY,
 
 --MGYHOYXEY6WxJCY8--

From: sys-dev-sym@oldach.net (Helge Oldach)
To: marius@alchemy.franken.de (Marius Strobl)
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/168928: [patch] sys/dev/sym partly broken per r236061
Date: Mon, 11 Jun 2012 04:58:50 +0200 (CEST)

 Marius Strobl wrote on Sun, 10 Jun 2012 22:25:47 +0200 (CEST):
 > On Sun, Jun 10, 2012 at 09:15:03PM +0200, Helge Oldach wrote:
 > > 
 > > However I am a bit puzzled by the MIN() clause which seems to deal with
 > > strange numbers. It is numerically identical to:
 > > 
 > > 	np->maxsegcnt = MIN(33,
 > > 	    (131072 / 16777216) + 1);
 > > 
 > > It seems to me that the result will always be 1, as all constants are
 > > static. As MAXPHYS can be defined in the kernel config file, only for
 > > unreasonably huge MAXPHYS definitions it can grow beyond 1. Is this
 > > really intended?
 > 
 > Err, yes, that's a thinko. Could you please test how things behave
 > with the attached patch?
 
 That fixes it for me. Thanks.
 
 However, I still wonder about the rationale, as np->maxsegcnt
 effectively is assigned a kernel build time constant. Why make make it a
 variable at all? Is this different in 9.x or 10.x?
 
 Kind regards
 Helge

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/168928: commit references a PR
Date: Thu, 14 Jun 2012 20:49:37 +0000 (UTC)

 Author: marius
 Date: Thu Jun 14 20:49:22 2012
 New Revision: 237101
 URL: http://svn.freebsd.org/changeset/base/237101
 
 Log:
   Fix a braino in r236469; the number of DMA tags required for handling
   MAXPHYS should be based on PAGE_SIZE rather than SYM_CONF_DMA_BOUNDARY.
   While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum
   number of DMA tags so sym(4) itself doesn't size memory beyond what's
   required for handling MAXPHYS.
   
   PR:		168928
   MFC after:	3 days
 
 Modified:
   head/sys/dev/sym/sym_conf.h
   head/sys/dev/sym/sym_hipd.c
 
 Modified: head/sys/dev/sym/sym_conf.h
 ==============================================================================
 --- head/sys/dev/sym/sym_conf.h	Thu Jun 14 20:44:56 2012	(r237100)
 +++ head/sys/dev/sym/sym_conf.h	Thu Jun 14 20:49:22 2012	(r237101)
 @@ -90,11 +90,12 @@
  #define SYM_CONF_DMA_BOUNDARY	(1UL << 24)
  
  /*
 - *  Max number of scatter/gather entries for en IO.
 + *  Max number of scatter/gather entries for an I/O.
   *  Each entry costs 8 bytes in the internal CCB data structure.
 - *  For now 65 should suffice given the BSD O/Ses capabilities.
 + *  We use at most 33 segments but also no more than required for handling
 + *  MAXPHYS.
   */
 -#define SYM_CONF_MAX_SG		(33)
 +#define	SYM_CONF_MAX_SG		(MIN(33, (MAXPHYS / PAGE_SIZE) + 1))
  
  /*
   *  Max number of targets.
 
 Modified: head/sys/dev/sym/sym_hipd.c
 ==============================================================================
 --- head/sys/dev/sym/sym_hipd.c	Thu Jun 14 20:44:56 2012	(r237100)
 +++ head/sys/dev/sym/sym_hipd.c	Thu Jun 14 20:49:22 2012	(r237101)
 @@ -1609,7 +1609,6 @@ struct sym_hcb {
  	u_int	features;	/* Chip features map		*/
  	u_char	myaddr;		/* SCSI id of the adapter	*/
  	u_char	maxburst;	/* log base 2 of dwords burst	*/
 -	u_char	maxsegcnt;	/* Max DMA S/G segments		*/
  	u_char	maxwide;	/* Maximum transfer width	*/
  	u_char	minsync;	/* Min sync period factor (ST)	*/
  	u_char	maxsync;	/* Max sync period factor (ST)	*/
 @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim *
  			cpi->xport_specific.spi.ppr_options =
  			    SID_SPI_CLOCK_DT_ST;
  		}
 -		cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY;
 +		cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE;
  		sym_xpt_done2(np, ccb, CAM_REQ_CMP);
  		break;
  	case XPT_ABORT:
 @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev)
  	/*
  	 *  Allocate a tag for the DMA of user data.
  	 */
 -	np->maxsegcnt = MIN(SYM_CONF_MAX_SG,
 -	    (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1);
  	if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY,
  	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 -	    BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY,
 +	    BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY,
  	    BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) {
  		device_printf(dev, "failed to create DMA tag.\n");
  		goto attach_failed;
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/168928: commit references a PR
Date: Sun, 17 Jun 2012 09:43:16 +0000 (UTC)

 Author: marius
 Date: Sun Jun 17 09:42:56 2012
 New Revision: 237186
 URL: http://svn.freebsd.org/changeset/base/237186
 
 Log:
   MFC: r237101
   
   Fix a braino in r236469 (MFC'ed to stable/9 in r236468); the number of
   DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather
   than SYM_CONF_DMA_BOUNDARY.
   While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum
   number of DMA tags so sym(4) itself doesn't size memory beyond what's
   required for handling MAXPHYS.
   
   PR:		168928
 
 Modified:
   stable/9/sys/dev/sym/sym_conf.h
   stable/9/sys/dev/sym/sym_hipd.c
 Directory Properties:
   stable/9/sys/   (props changed)
   stable/9/sys/amd64/include/xen/   (props changed)
   stable/9/sys/boot/   (props changed)
   stable/9/sys/boot/i386/efi/   (props changed)
   stable/9/sys/boot/ia64/efi/   (props changed)
   stable/9/sys/boot/ia64/ski/   (props changed)
   stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
   stable/9/sys/boot/powerpc/ofw/   (props changed)
   stable/9/sys/cddl/contrib/opensolaris/   (props changed)
   stable/9/sys/conf/   (props changed)
   stable/9/sys/contrib/dev/acpica/   (props changed)
   stable/9/sys/contrib/octeon-sdk/   (props changed)
   stable/9/sys/contrib/pf/   (props changed)
   stable/9/sys/contrib/x86emu/   (props changed)
   stable/9/sys/dev/   (props changed)
   stable/9/sys/dev/e1000/   (props changed)
   stable/9/sys/dev/ixgbe/   (props changed)
   stable/9/sys/fs/   (props changed)
   stable/9/sys/fs/ntfs/   (props changed)
   stable/9/sys/modules/   (props changed)
 
 Modified: stable/9/sys/dev/sym/sym_conf.h
 ==============================================================================
 --- stable/9/sys/dev/sym/sym_conf.h	Sun Jun 17 07:14:58 2012	(r237185)
 +++ stable/9/sys/dev/sym/sym_conf.h	Sun Jun 17 09:42:56 2012	(r237186)
 @@ -90,11 +90,12 @@
  #define SYM_CONF_DMA_BOUNDARY	(1UL << 24)
  
  /*
 - *  Max number of scatter/gather entries for en IO.
 + *  Max number of scatter/gather entries for an I/O.
   *  Each entry costs 8 bytes in the internal CCB data structure.
 - *  For now 65 should suffice given the BSD O/Ses capabilities.
 + *  We use at most 33 segments but also no more than required for handling
 + *  MAXPHYS.
   */
 -#define SYM_CONF_MAX_SG		(33)
 +#define	SYM_CONF_MAX_SG		(MIN(33, (MAXPHYS / PAGE_SIZE) + 1))
  
  /*
   *  Max number of targets.
 
 Modified: stable/9/sys/dev/sym/sym_hipd.c
 ==============================================================================
 --- stable/9/sys/dev/sym/sym_hipd.c	Sun Jun 17 07:14:58 2012	(r237185)
 +++ stable/9/sys/dev/sym/sym_hipd.c	Sun Jun 17 09:42:56 2012	(r237186)
 @@ -1609,7 +1609,6 @@ struct sym_hcb {
  	u_int	features;	/* Chip features map		*/
  	u_char	myaddr;		/* SCSI id of the adapter	*/
  	u_char	maxburst;	/* log base 2 of dwords burst	*/
 -	u_char	maxsegcnt;	/* Max DMA S/G segments		*/
  	u_char	maxwide;	/* Maximum transfer width	*/
  	u_char	minsync;	/* Min sync period factor (ST)	*/
  	u_char	maxsync;	/* Max sync period factor (ST)	*/
 @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim *
  			cpi->xport_specific.spi.ppr_options =
  			    SID_SPI_CLOCK_DT_ST;
  		}
 -		cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY;
 +		cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE;
  		sym_xpt_done2(np, ccb, CAM_REQ_CMP);
  		break;
  	case XPT_ABORT:
 @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev)
  	/*
  	 *  Allocate a tag for the DMA of user data.
  	 */
 -	np->maxsegcnt = MIN(SYM_CONF_MAX_SG,
 -	    (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1);
  	if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY,
  	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 -	    BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY,
 +	    BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY,
  	    BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) {
  		device_printf(dev, "failed to create DMA tag.\n");
  		goto attach_failed;
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/168928: commit references a PR
Date: Sun, 17 Jun 2012 09:43:20 +0000 (UTC)

 Author: marius
 Date: Sun Jun 17 09:43:04 2012
 New Revision: 237187
 URL: http://svn.freebsd.org/changeset/base/237187
 
 Log:
   MFC: r237101
   
   Fix a braino in r236469 (MFC'ed to stable/8 in r236469); the number of
   DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather
   than SYM_CONF_DMA_BOUNDARY.
   While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum
   number of DMA tags so sym(4) itself doesn't size memory beyond what's
   required for handling MAXPHYS.
   
   PR:		168928
 
 Modified:
   stable/8/sys/dev/sym/sym_conf.h
   stable/8/sys/dev/sym/sym_hipd.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/boot/   (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)
   stable/8/sys/dev/e1000/   (props changed)
 
 Modified: stable/8/sys/dev/sym/sym_conf.h
 ==============================================================================
 --- stable/8/sys/dev/sym/sym_conf.h	Sun Jun 17 09:42:56 2012	(r237186)
 +++ stable/8/sys/dev/sym/sym_conf.h	Sun Jun 17 09:43:04 2012	(r237187)
 @@ -90,11 +90,12 @@
  #define SYM_CONF_DMA_BOUNDARY	(1UL << 24)
  
  /*
 - *  Max number of scatter/gather entries for en IO.
 + *  Max number of scatter/gather entries for an I/O.
   *  Each entry costs 8 bytes in the internal CCB data structure.
 - *  For now 65 should suffice given the BSD O/Ses capabilities.
 + *  We use at most 33 segments but also no more than required for handling
 + *  MAXPHYS.
   */
 -#define SYM_CONF_MAX_SG		(33)
 +#define	SYM_CONF_MAX_SG		(MIN(33, (MAXPHYS / PAGE_SIZE) + 1))
  
  /*
   *  Max number of targets.
 
 Modified: stable/8/sys/dev/sym/sym_hipd.c
 ==============================================================================
 --- stable/8/sys/dev/sym/sym_hipd.c	Sun Jun 17 09:42:56 2012	(r237186)
 +++ stable/8/sys/dev/sym/sym_hipd.c	Sun Jun 17 09:43:04 2012	(r237187)
 @@ -1609,7 +1609,6 @@ struct sym_hcb {
  	u_int	features;	/* Chip features map		*/
  	u_char	myaddr;		/* SCSI id of the adapter	*/
  	u_char	maxburst;	/* log base 2 of dwords burst	*/
 -	u_char	maxsegcnt;	/* Max DMA S/G segments		*/
  	u_char	maxwide;	/* Maximum transfer width	*/
  	u_char	minsync;	/* Min sync period factor (ST)	*/
  	u_char	maxsync;	/* Max sync period factor (ST)	*/
 @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim *
  			cpi->xport_specific.spi.ppr_options =
  			    SID_SPI_CLOCK_DT_ST;
  		}
 -		cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY;
 +		cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE;
  		sym_xpt_done2(np, ccb, CAM_REQ_CMP);
  		break;
  	case XPT_ABORT:
 @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev)
  	/*
  	 *  Allocate a tag for the DMA of user data.
  	 */
 -	np->maxsegcnt = MIN(SYM_CONF_MAX_SG,
 -	    (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1);
  	if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY,
  	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 -	    BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY,
 +	    BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY,
  	    BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) {
  		device_printf(dev, "failed to create DMA tag.\n");
  		goto attach_failed;
 _______________________________________________
 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"
 
State-Changed-From-To: open->closed 
State-Changed-By: marius 
State-Changed-When: Sun Jun 17 09:52:26 UTC 2012 
State-Changed-Why:  
Close; thanks for reporting! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168928 
>Unformatted:
