Bug 127316 - [ata] non aligned DMA transfer errors when using growisofs from sysutils/dvd+rw-tools
Summary: [ata] non aligned DMA transfer errors when using growisofs from sysutils/dvd+...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-12 09:20 UTC by Matthias Apitz
Modified: 2009-10-31 17:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Apitz 2008-09-12 09:20:00 UTC
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;
Comment 1 dfilter service freebsd_committer freebsd_triage 2009-09-06 15:23:36 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"
Comment 2 Alexander Motin freebsd_committer freebsd_triage 2009-09-06 15:24:11 UTC
State Changed
From-To: open->patched

Patch committed to 9-CURRENT.
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-09-25 19:07:36 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"
Comment 4 dfilter service freebsd_committer freebsd_triage 2009-10-31 17:28:20 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"
Comment 5 Alexander Motin freebsd_committer freebsd_triage 2009-10-31 17:29:17 UTC
State Changed
From-To: patched->closed

Patch merged to 7-STABLE,