From owner-freebsd-arch@FreeBSD.ORG Mon Aug 27 13:38:10 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858DB1065674 for ; Mon, 27 Aug 2012 13:38:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 346FE8FC1E for ; Mon, 27 Aug 2012 13:38:10 +0000 (UTC) Received: by dadr6 with SMTP id r6so2521837dad.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=m6bC4w5TPQYzLtEIb5FiG8XdpGghJqmiP8bQqAjVEsimdbVwZ3hljb3asMBEfItX4T irVPiZ+WbgzmEpAyXvbsQykCXmFfoDUM1IyvG91t6PWC4Mayi5hmkc1yMBetkB/aMA76 SF99MO/CLWNB7zweb7YJwmUzD3v8GogrJBWwRLBi/+dA047l9+DfIOpXdKe8pxQ6vKJP Hd7NQjvXcoPv5iPPxG25r3Bq5v7dCfNDG5LQlJgzOTBr2LIUPFRlvz8VfW9YWxtDx+K+ Mauf21xRGVYG019AqyHzbNYP7jTaXWJAydBAC2Z5wNiBHJctC/6CmwpK7nKhc0JqO18o Qb9w== 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: ALoCoQn1ygn82aXjJftRqprYWVZalB0LhTRubkxjmCt6Rt7iqx3rKaGbJiFC6SwiAYY9RIhppVke Cc: Ian Lepore , freebsd-arm@freebsd.org, Adrian Chadd , freebsd-mips@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Partial cacheline flush problems on ARM and MIPS X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture 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