From nobody@FreeBSD.org  Tue Oct  1 13:09:00 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 40C5FEFD
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Oct 2013 13:09:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 2F2F029A8
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Oct 2013 13:09:00 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r91D8xRc054853
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 1 Oct 2013 13:08:59 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r91D8xuE054852;
	Tue, 1 Oct 2013 13:08:59 GMT
	(envelope-from nobody)
Message-Id: <201310011308.r91D8xuE054852@oldred.freebsd.org>
Date: Tue, 1 Oct 2013 13:08:59 GMT
From: Svatopluk Kraus <onwahe@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] ARM busdma_machdep-v6.c
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182544
>Category:       arm
>Synopsis:       [patch] ARM busdma_machdep-v6.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-arm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 01 13:10:00 UTC 2013
>Closed-Date:    Sun May 04 03:54:21 UTC 2014
>Last-Modified:  Sun May 04 03:54:21 UTC 2014
>Originator:     Svatopluk Kraus
>Release:        current
>Organization:
>Environment:
>Description:
See my patch. 
(1) maxsize should be in bytes
(2) bad comments style corrected

>How-To-Repeat:

>Fix:
Index: sys/arm/arm/busdma_machdep-v6.c
===================================================================
--- sys/arm/arm/busdma_machdep-v6.c	(revision 255665)
+++ sys/arm/arm/busdma_machdep-v6.c	(working copy)
@@ -426,7 +426,11 @@
 	 || newtag->alignment > 1)
 		newtag->flags |= BUS_DMA_COULD_BOUNCE;
 	else
-		maxsize = 2; /* Need at most 2 bounce pages for unaligned access on cache line boundaries */
+		/* 
+		 * Need at most 2 bounce pages for unaligned access
+		 * on cache line boundaries
+	         */
+		maxsize = 2 * PAGE_SIZE;
 
 	if ((flags & BUS_DMA_ALLOCNOW) != 0) {
 		struct bounce_zone *bz;


>Release-Note:
>Audit-Trail:

From: Ian Lepore <ian@FreeBSD.org>
To: bug-followup@FreeBSD.org, onwahe@gmail.com
Cc:  
Subject: Re: arm/182544: [patch] ARM busdma_machdep-v6.c
Date: Wed, 16 Oct 2013 10:39:42 -0600

 The analysis of this problem is correct, however while investigating it
 I discovered that we also need to round maxsize up to a full page and
 add one to account for a possible extra boundary crossing, so the fix
 applied in r256637 was different than the submitted patch.
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sun May 4 03:53:36 UTC 2014 
State-Changed-Why:  
Fixed a different way in r256637.  Thanks for the patch. 

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