Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp897473pxb; Thu, 30 Sep 2021 21:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZvfoRRk01Nb7cbdWIv6O4YeivC7FRb+GGdt43Rs9JVGh7a5/BcoESOGjm8aKfDFA10+MF X-Received: by 2002:a17:906:7c86:: with SMTP id w6mr3688346ejo.215.1633062367254; Thu, 30 Sep 2021 21:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633062367; cv=none; d=google.com; s=arc-20160816; b=cEVnA+tlTcsMdsVyrm4YbpBCvb3PWV9Fba8G1K1bl9JT6+oe4AE8/HVIIieQ9hoCr9 ovw3yE97KDpfND2h8Amwuwr2MHDCB9GmrHmmpT9wnFYJYxbZo/adV3XNIubS+PIcmqy3 lCtakROjP3ffIWJcNB7W2UKgyugylkx2bMxvBSWue3YRp3zB9B3xVqeA6PaDKMhzN/LK fsU1BJeGHrHK/l+PpwRZr9OxUYWwfznGhA/E3sCQueQVb9k/9EW9AIblbkgvycajG1z8 d9/OQYJGudbRA3Z2DkYWNHsHojiAOVNyN66RGpaRHff0jtttZOk63UOPeEh3jkXtZZ/D vZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rlj13Jh5YPx4uzrL1WHX7gaj5IorC5zKss/WE1QdLcE=; b=O8k5N2zMgm+RSKpPy9ako8AqWd7A2pXynUvG2/0WlLLH55bluHA1NN5B/ALEWjCpw/ lxE1UQJZhK3nc8C9kezlj5GQ3nTFwNkK8B2iTVrc/q6r6ueMyCbr4b+2m2R3giSWqoNk Dd7lDTz3677YYPjMMjf30FSmxAEZquFJIv4SPQHY4FzRRWWiiJQ9fnaKHmfVwQy72G6J Sfd3sGQuVDW3zVV1AnoizYnnPWEQssWbqOKaImniW3WNHonimR3c5KtGG0s2Z/Wao2lN 7DP60SFjbceyGiX6+aPVqK58ZP79Q42LPIOZc+Y+0t28/kqK7+ZB+gn7hc2QA6FzmPbd +p4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id er10si5356327ejc.675.2021.09.30.21.25.42; Thu, 30 Sep 2021 21:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238774AbhJAEVr (ORCPT + 99 others); Fri, 1 Oct 2021 00:21:47 -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: linux-kernel@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.