From owner-freebsd-arch@FreeBSD.ORG Thu Aug 23 21:50:38 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 BF0E71065672 for ; Thu, 23 Aug 2012 21:50:38 +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 8B9F48FC12 for ; Thu, 23 Aug 2012 21:50:38 +0000 (UTC) Received: by dadr6 with SMTP id r6so618158dad.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=X4ardj4Un7wUm8+Z3exMdonqf7Q8fsKmhExRobjDbB0HbvytjaBgsYs+JPgGVxmvPH Wm9KFruzcwJBs/M1aAOz0xXBPArmAICPP2vGa2r9lkSZWvitffK7/fMwKSn9M4DzCYGi vuA8QAnl76ednWOEaA0Y0G5P1eA4QcWT3S2s8G6fx0OOqm1fqNT/NAhbyTFsB6E3mXp4 KpuTig44I8wSJ67E/EixtGpyxOUglwRTZasF5ZCh9EfC3qpzJHZZlemi87Ok6q0TO4ys K3TFav4zd7tSgMRESfi3NcFpYE6OrnZDqrfAJD+uCoutduFYw47ZIUnQeW3wr5xm0Nxo yUTg== 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: ALoCoQnf+tsffohyLcybQi/VwHvYZUU86SLIF5eA+gxV+u4LFaIsp4AK6bD0WFh3DbyMnSbzH828 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-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: Thu, 23 Aug 2012 21:50:38 -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