From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 29 15:49:57 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8690A106566C for ; Thu, 29 Oct 2009 15:49:57 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 1E1098FC0C for ; Thu, 29 Oct 2009 15:49:56 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so923541fga.13 for ; Thu, 29 Oct 2009 08:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=WgmMKNyKSTHK+l+qX+mikB848UlBTL8kq46OdxNpW0w=; b=uDjlkASjL2Etqo3Zr25JO/pH0q/VcPY+y9ROmbqxjLbwPnceeNrJ/dqDgXOV15/qmi RXTy+eAOz/TcSqIFikEemYKStaoJscyTUytsBI2wpfjWraVHZljISbpKnMx0MmTgy6Ff BK1gXcjC8UW3ZPh9VA+EGwttLbPwhqy+HM8LE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=fkP/yjc2gQrhUpgp30G/Sc5UxY2jlvqV7EOnl+WaW12q/QHeS3Ym/QrTtWEwS3iIJA k4SxGPpDLBRoM+C41D2EH1kW+3RapvekRXWQYDtytu+lAcdi/nDnA+1N3M9khUEydEgb /zuWaRyddQnTBWqreEheuYcaf1dXMDT1rCFRM= MIME-Version: 1.0 Received: by 10.223.161.205 with SMTP id s13mr33028fax.70.1256831394451; Thu, 29 Oct 2009 08:49:54 -0700 (PDT) Date: Thu, 29 Oct 2009 10:49:54 -0500 Message-ID: <2d1264630910290849k2ca29237ubb25cc3b7313ec26@mail.gmail.com> From: Jason Harmening To: gonzo@bluezbox.com Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Thu, 29 Oct 2009 20:28:09 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: MIPS: bus_dma(9) and cache problems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2009 15:49:57 -0000 > 1. code modifies data in block and this modification ends up in > cache and is not written back to memory > 2. right after this code calls bus_dmamap_sync for this buffer > and as a result cache invalidation is performed > 3. Cache function operates on cache line size-aligned addresses > and the block in question happens to share the same cache line > with the buffer. So modification made at step (1) is lost. What sync operation are you doing? At least for PREREAD or PREWRITE, I'd expect any dirty cache lines to be flushed to RAM. If this isn't happening, then you may want to submit a bug report. BTW, if you haven't already found it the MIPS sync code for 9-CURRENT is here: http://fxr.watson.org/fxr/source/mips/mips/busdma_machdep.c#L760