From owner-freebsd-arm@FreeBSD.ORG Thu Aug 23 21:50:39 2012 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07F2E1065674 for ; Thu, 23 Aug 2012 21:50:39 +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 C2CE58FC15 for ; Thu, 23 Aug 2012 21:50:38 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so2300537pbb.13 for ; Thu, 23 Aug 2012 14:50:38 -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:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=WSYlzD3T5FYG0E17Iqr7sZ9KknY3rYR8v2QRn3PxG8E=; b=iQUXtFwBUMAgz8F7SyvZGbHoirdNf5Pqpr/DMRbGIQVyHm2uDljFrcnop4CYMv2dk8 lPJ7zKQRZJRPNrt+4gtx7Tm6srzJsELYnBK/HszXBaSDyfrXFq/LXSTq4u9g0EGgJXK2 MY6X8syJun5b4aff1KZ7ZhvGP4Jfk2RnjB/QTwsgqm3PccV2S+cagv35IEZwYmw/+POs L1SYSUbm60Ptg1UCPTjy6Y70teiNygZylHvHpcwB7lbdlcgbR2Y8vSq91y2JW81lkq9B 7vNHmGz4vcOnReXUy3HL/sQPqlRcYOh6l9F66GQ0KfaHjx91Kf68OOssXPUgBzzfeSSU biaA== Received: by 10.66.80.193 with SMTP id t1mr6152901pax.69.1345758638309; Thu, 23 Aug 2012 14:50:38 -0700 (PDT) Received: from [10.30.101.53] ([209.117.142.2]) by mx.google.com with ESMTPS id gf3sm6757324pbc.74.2012.08.23.14.50.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 14:50:37 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1345757300.27688.535.camel@revolution.hippie.lan> Date: Thu, 23 Aug 2012 15:50:35 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3A08EB08-2BBF-4B0F-97F2-A3264754C4B7@bsdimp.com> References: <1345757300.27688.535.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQnADOSUgHV+GIjW9GnMjmnflvrgMTYHCqfB9By6Fq6t3/loVP2BgOccRDZqZhw12ycYWNuH 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-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 21:50:39 -0000 On Aug 23, 2012, at 3:28 PM, Ian Lepore wrote: > A recent innocuous change to the USB driver code caused intermittant > errors in the umass(4) driver on ARM and MIPS platforms, and this I think the proper solution is to segregate DMA and non-DMA parts of = structures so that you don't have both sharing a cache line. I also wonder why we don't allocate the DMA memory for these structures = separately from the non-DMA parts. This would eliminate the = USB_CACHE_BYTES kludge (which is CPU dependent, not arch dependent) and = move the knowledge of this junk into busdma layer where it belongs. = =46rom my understanding of the issue, this would completely eliminate = the problem forever! Sharing a cacheline between something that is DMA aware and something = that is just begging for trouble. We're doing more work than we need = to to support this dubious feature and we'd be miles ahead if we could = not share at all. Warner