From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D665DC433EF for ; Fri, 1 Oct 2021 04:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A90A561A40 for ; Fri, 1 Oct 2021 04:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239646AbhJAEVs (ORCPT ); Fri, 1 Oct 2021 00:21:48 -0400 Received: from verein.lst.de ([213.95.11.211]:33575 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230351AbhJAEVq (ORCPT ); Fri, 1 Oct 2021 00:21:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C70FC67373; Fri, 1 Oct 2021 06:19:59 +0200 (CEST) Date: Fri, 1 Oct 2021 06:19:59 +0200 From: Christoph Hellwig To: Ioana Ciornei Cc: Jeremy Linton , Hamza Mahfooz , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , "iommu@lists.linux-foundation.org" , Dan Williams , "netdev@vger.kernel.org" Subject: Re: DPAA2 triggers, [PATCH] dma debug: report -EEXIST errors in add_dma_entry Message-ID: <20211001041959.GA17448@lst.de> References: <20210518125443.34148-1-someguy@effective-light.com> <20210914154504.z6vqxuh3byqwgfzx@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210914154504.z6vqxuh3byqwgfzx@skbuf> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Sep 14, 2021 at 03:45:06PM +0000, Ioana Ciornei wrote: > [ 245.927020] fsl_dpaa2_eth dpni.3: scather-gather idx 0 P=20a7320000 N=20a7320 D=20a7320000 L=30 DMA_BIDIRECTIONAL dma map error check not applicableˇ > [ 245.927048] fsl_dpaa2_eth dpni.3: scather-gather idx 1 P=20a7320030 N=20a7320 D=20a7320030 L=5a8 DMA_BIDIRECTIONAL dma map error check not applicable > [ 245.927062] DMA-API: cacheline tracking EEXIST, overlapping mappings aren't supported > > The first line is the dump of the dma_debug_entry which is already present > in the radix tree and the second one is the entry which just triggered > the EEXIST. > > As we can see, they are not actually overlapping, at least from my > understanding. The first one starts at 0x20a7320000 with a size 0x30 > and the second one at 0x20a7320030. They overlap the cache lines. Which means if you use this driver on a system that is not dma coherent you will corrupt data.