From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: [ofa-general] Re: mthca use of dma_sync_single is bogus Date: Mon, 09 Jul 2007 14:31:32 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: (Keir Fraser's message of "Mon, 09 Jul 2007 22:31:49 +0100") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: general-bounces@lists.openfabrics.org Errors-To: general-bounces@lists.openfabrics.org To: Keir Fraser Cc: Lukas Hejtmanek , xen-devel@lists.xensource.com, general@lists.openfabrics.org List-Id: xen-devel@lists.xenproject.org > One thought is that if you *do* move to dma_sync_single_range() then > lib/swiotlb.c still needs fixing. It's buggy in that > swiotlb_sync_single_range(dma_addr, offset) calls > swiotlb_sync_single(dma_addr+offset), and this will fail if the offset is > large enough that it ends up dereferencing a different slot index in > io_tlb_orig_addr. Yes, I realized the same thing (our emails crossed). > So, I should be able to get my swiotlb workaround fixes accepted upstream as > a genuine bug fix. :-) Yeah, seems so. > dma_sync_single_range() looks to me to be the right thing for you to be > using. But I'm not a DMA-API expert. yes, I'll try to get confirmation from James Bottomley and/or Dave Miller that it is the right thing to do (and also fix the documentation to match what the kernel actually implements). - R.