From nobody@FreeBSD.org  Fri Sep 12 08:19:23 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DB621065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Sep 2008 08:19:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 15B888FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Sep 2008 08:19:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m8C8JMeF048870
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Sep 2008 08:19:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m8C8JM9V048869;
	Fri, 12 Sep 2008 08:19:22 GMT
	(envelope-from nobody)
Message-Id: <200809120819.m8C8JM9V048869@www.freebsd.org>
Date: Fri, 12 Sep 2008 08:19:22 GMT
From: Matthias Apitz <guru@unixarea.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: growisofs && non aligned DMA transfer
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127316
>Category:       kern
>Synopsis:       [ata] non aligned DMA transfer errors when using growisofs from sysutils/dvd+rw-tools
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 12 08:20:00 UTC 2008
>Closed-Date:    Sat Oct 31 17:29:45 UTC 2009
>Last-Modified:  Sat Oct 31 17:30:05 UTC 2009
>Originator:     Matthias Apitz
>Release:        7.0-RELEASE
>Organization:
>Environment:
FreeBSD rebelion.Sisis.de 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I wanted to add a file to an already written DVD+RW (written a day
before on the same system) with
 
# growisofs  -M /dev/cd0 -r -T -J -joliet-long -v directory
 
This produced tons of error messages via syslog as
 
Jul 11 13:45:30 rebelion kernel: ata0: FAILURE - non aligned DMA transfer attempted
Jul 11 13:45:30 rebelion kernel: acd0: setting up DMA failed
 
and the only way to get the system back to a usable state was rebooting
it;

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: mav 
State-Changed-When: Sun Sep 6 14:24:11 UTC 2009 
State-Changed-Why:  
Patch committed to 9-CURRENT. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/127316: commit references a PR
Date: Sun,  6 Sep 2009 14:23:36 +0000 (UTC)

 Author: mav
 Date: Sun Sep  6 14:23:26 2009
 New Revision: 196893
 URL: http://svn.freebsd.org/changeset/base/196893
 
 Log:
   Remove constraint, requiring request data to fulfill controller's alignment
   requirements. It is busdma task, to manage proper alignment by loading
   data to bounce buffers.
   
   PR:		kern/127316
   Reviewed by:	current@
   Tested by:	Ryan Rogers
 
 Modified:
   head/sys/dev/ata/ata-dma.c
 
 Modified: head/sys/dev/ata/ata-dma.c
 ==============================================================================
 --- head/sys/dev/ata/ata-dma.c	Sun Sep  6 14:05:01 2009	(r196892)
 +++ head/sys/dev/ata/ata-dma.c	Sun Sep  6 14:23:26 2009	(r196893)
 @@ -272,10 +272,10 @@ ata_dmaload(struct ata_request *request,
  		      "FAILURE - zero length DMA transfer attempted\n");
  	return EIO;
      }
 -    if (((uintptr_t)(request->data) & (ch->dma.alignment - 1)) ||
 -	(request->bytecount & (ch->dma.alignment - 1))) {
 +    if (request->bytecount & (ch->dma.alignment - 1)) {
  	device_printf(request->dev,
 -		      "FAILURE - non aligned DMA transfer attempted\n");
 +		      "FAILURE - odd-sized DMA transfer attempt %d %% %d\n",
 +		      request->bytecount, ch->dma.alignment);
  	return EIO;
      }
      if (request->bytecount > ch->dma.max_iosize) {
 _______________________________________________
 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/127316: commit references a PR
Date: Fri, 25 Sep 2009 18:07:36 +0000 (UTC)

 Author: mav
 Date: Fri Sep 25 18:07:23 2009
 New Revision: 197495
 URL: http://svn.freebsd.org/changeset/base/197495
 
 Log:
   Remove constraint, requiring request data to fulfill controller's
   alignment requirements. It is busdma task, to manage proper alignment by
   loading data to bounce buffers.
   
   PR:		kern/127316
   Reviewed by:	current@
   Tested by:	Ryan Rogers
   Approved by:	re (kib)
 
 Modified:
   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)
   stable/8/sys/dev/ata/ata-dma.c
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/dev/ata/ata-dma.c
 ==============================================================================
 --- stable/8/sys/dev/ata/ata-dma.c	Fri Sep 25 18:04:55 2009	(r197494)
 +++ stable/8/sys/dev/ata/ata-dma.c	Fri Sep 25 18:07:23 2009	(r197495)
 @@ -272,10 +272,10 @@ ata_dmaload(struct ata_request *request,
  		      "FAILURE - zero length DMA transfer attempted\n");
  	return EIO;
      }
 -    if (((uintptr_t)(request->data) & (ch->dma.alignment - 1)) ||
 -	(request->bytecount & (ch->dma.alignment - 1))) {
 +    if (request->bytecount & (ch->dma.alignment - 1)) {
  	device_printf(request->dev,
 -		      "FAILURE - non aligned DMA transfer attempted\n");
 +		      "FAILURE - odd-sized DMA transfer attempt %d %% %d\n",
 +		      request->bytecount, ch->dma.alignment);
  	return EIO;
      }
      if (request->bytecount > ch->dma.max_iosize) {
 _______________________________________________
 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: patched->closed 
State-Changed-By: mav 
State-Changed-When: Sat Oct 31 17:29:17 UTC 2009 
State-Changed-Why:  
Patch merged to 7-STABLE, 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/127316: commit references a PR
Date: Sat, 31 Oct 2009 17:28:20 +0000 (UTC)

 Author: mav
 Date: Sat Oct 31 17:28:08 2009
 New Revision: 198720
 URL: http://svn.freebsd.org/changeset/base/198720
 
 Log:
   MFC rev. 196893:
   Remove constraint, requiring request data to fulfill controller's alignment
   requirements. It is busdma task, to manage proper alignment by loading
   data to bounce buffers.
   
   PR:		kern/120787, kern/127316
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/dev/ata/ata-dma.c
 
 Modified: stable/7/sys/dev/ata/ata-dma.c
 ==============================================================================
 --- stable/7/sys/dev/ata/ata-dma.c	Sat Oct 31 17:06:36 2009	(r198719)
 +++ stable/7/sys/dev/ata/ata-dma.c	Sat Oct 31 17:28:08 2009	(r198720)
 @@ -233,9 +233,9 @@ ata_dmaload(device_t dev, caddr_t data, 
  	device_printf(dev, "FAILURE - zero length DMA transfer attempted\n");
  	return EIO;
      }
 -    if (((uintptr_t)data & (ch->dma->alignment - 1)) ||
 -	(count & (ch->dma->alignment - 1))) {
 -	device_printf(dev, "FAILURE - non aligned DMA transfer attempted\n");
 +    if (count & (ch->dma->alignment - 1)) {
 +	device_printf(dev, "FAILURE - odd-sized DMA transfer attempt %d %% %d\n",
 +	    count, ch->dma->alignment);
  	return EIO;
      }
      if (count > ch->dma->max_iosize) {
 _______________________________________________
 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"
 
>Unformatted:
