From owner-freebsd-mips@FreeBSD.ORG Mon Aug 27 13:38:10 2012 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F47106566C for ; Mon, 27 Aug 2012 13:38:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9DB8FC1C for ; Mon, 27 Aug 2012 13:38:10 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so7583091pbb.13 for ; Mon, 27 Aug 2012 06:38:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:x-priority :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=sDQvljch4pOy5n8q84V4CzIi45qexsJyPkD23yBHMLw=; b=dhf3PLnMuVY95I3/vvCKcBhIMJQCBn5YQ/ynElC5v49Ll2lUsJJB1yXpiygy+eJhEo /a9+OWXPcvnzmDuhQOHsYGaL+u9SBamAeGemUlmoXYC0GOMFHemN3SYp7vL0AwxqIf5w +0kKqpLGJPZrsVws13OqExgA0LtWacgQ1DStsYD7OzlVHMEmeo3TsCYOMSUaeSnzHWA0 OYpbh9QmNy/kodI0FOsc0hTgNSKDPap2Vy53g3Ww/2OmNJUMS+Z+UD06DFZs5Zq/7Heh P+EIlysiK084jZ3CkmZOrTQSBl4AQTWyC1xen7zBtpYYTOxNZn750UJzmeXRck7Zupr/ fRYA== Received: by 10.66.74.37 with SMTP id q5mr30255409pav.29.1346074689751; Mon, 27 Aug 2012 06:38:09 -0700 (PDT) Received: from [10.0.0.63] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id pj10sm14721644pbb.46.2012.08.27.06.38.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Aug 2012 06:38:09 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh X-Priority: 3 (Normal) In-Reply-To: Date: Mon, 27 Aug 2012 07:38:06 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <6D83AF9D-577B-4C83-84B7-C4E3B32695FC@bsdimp.com> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQkhuRqjyhLYt/lHdgBMXtY4AqULZyIlGBnzAiiljq2/VRXdassevCGo2qSC03fJkM7X1Hyf Cc: freebsd-arm@freebsd.org, freebsd-mips@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Partial cacheline flush problems on ARM and MIPS X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:38:10 -0000 On Aug 27, 2012, at 12:06 AM, Hans Petter Selasky wrote: > Hi, > Correct. >=20 > > We also need some rules about working with buffers obtained from > > bus_dmamem_alloc() and external buffers passed to bus_dmamap_load(). = I > > think the rule should be that a buffer obtained from = bus_dmamem_alloc(), > > or more formally any region of memory mapped by a bus_dmamap_load(), = is > > a single logical object which can only be accessed by one entity at = a > > time. That means that there cannot be two concurrent DMA operations > > happening in different regions of the same buffer, nor can DMA and = CPU > > access be happening concurrently even if in different parts of the > > buffer. =20 >=20 > Is this something which we can fix using a simple = __align(USB_DMA_ALIGN) on elements in C-structures which are allowed to = be DMA loaded. No. I don't think so. the reason is that you can't define USB_DMA_ALGIN = to be a constant on MIPS, at least, or I think ARM because that's = determined at run time. > Also: Why is busdma not complaining when loading a non-valid buffer = pointer? Speed and code simplicity. Warner