Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1673702pxj; Wed, 19 May 2021 11:09:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8DwukxTflwZCYT+hbzt0jR2M5kxnHrNLz8ctL/FKFfY39xKS4Non8CJoaC8DB0Nl0Dums X-Received: by 2002:a02:69ca:: with SMTP id e193mr216712jac.130.1621447772365; Wed, 19 May 2021 11:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447772; cv=none; d=google.com; s=arc-20160816; b=zInjuBVEUDM6ct3Xm1eZQeLPZEhjTfZrcs4H1BVgewOLBaC3PGx5ReUQnX8u4E5hDN +flaJW20vOMCr0x3+iXcViEwMexIcFv9DH/1TPutYOv6FUHfFI36J7ZsPlZivqtJAZQ4 xwOEZB42xKCv3bwJZLzki8vp6po8wYpSv5CnLTGVqdFvv6ymxRwz+Wk3zi5X2nN+Sz00 g4x+VK5A/dwvkJutAEvR0mTK4LMcwu2d65qAy4/tUOADLTQp2dG6Nu8//3y1+y9QFnB6 kmFS093lLraZl6FTOSKDURyw/keA70ampDq5TeO9WZX5RFr8ccWaYau4w8JVBLK3lofu 2Q2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=36QWeaEPkYSVRSJwBoy4upeKcDPfcV4ZB6g9F8RDrtY=; b=yyEe2e8jNpwx6fdaF/9la0gkDwF9HgReeX4XNtq/RT9iIsTsXY8LAN9B7VerrqCyL1 muH1oXTXQhFxaHNKQMSwS3lSlOwKyIej+Qef8wacPaf52ovmhw/yqqJB242Ff9HFQiK6 nabmeiZNq4VY5VQ5RL3nG67abMGEhZqdGIQg5aBDAfPg75uG+znXLqlPxls3FerJSkYe SJmCEkGNWwCuJjsuJBwSobKF3ucBiZ9oolOK9oereMqxWPXiE5vSegv3r0V5nJw5Wn80 2VHFXCoEw8vzzCA7VxH+uFTa8lssDg51dpx+brPNVWmX+P4v0ja/oQC7M+6mvA38USNL 5jPA== 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 p5si388022ilm.11.2021.05.19.11.09.19; Wed, 19 May 2021 11:09:32 -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 S1349455AbhERM46 (ORCPT + 99 others); Tue, 18 May 2021 08:56:58 -0400 Received: from h2.fbrelay.privateemail.com ([131.153.2.43]:60773 "EHLO h2.fbrelay.privateemail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349416AbhERM4t (ORCPT ); Tue, 18 May 2021 08:56:49 -0400 Received: from MTA-06-3.privateemail.com (mta-06.privateemail.com [68.65.122.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1.fbrelay.privateemail.com (Postfix) with ESMTPS id A97B5800BD for ; Tue, 18 May 2021 08:55:30 -0400 (EDT) Received: from MTA-06.privateemail.com (localhost [127.0.0.1]) by MTA-06.privateemail.com (Postfix) with ESMTP id 354876005B; Tue, 18 May 2021 08:55:29 -0400 (EDT) Received: from hal-station.. (unknown [10.20.151.225]) by MTA-06.privateemail.com (Postfix) with ESMTPA id 6B7516005F; Tue, 18 May 2021 08:55:28 -0400 (EDT) From: Hamza Mahfooz To: linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, Hamza Mahfooz , Dan Williams Subject: [PATCH] dma debug: report -EEXIST errors in add_dma_entry Date: Tue, 18 May 2021 08:54:43 -0400 Message-Id: <20210518125443.34148-1-someguy@effective-light.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since, overlapping mappings are not supported by the DMA API we should report an error if active_cacheline_insert returns -EEXIST. Suggested-by: Dan Williams Signed-off-by: Hamza Mahfooz --- kernel/dma/debug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 14de1271463f..dadae6255d05 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -566,11 +566,9 @@ static void add_dma_entry(struct dma_debug_entry *entry) if (rc == -ENOMEM) { pr_err("cacheline tracking ENOMEM, dma-debug disabled\n"); global_disable = true; + } else if (rc == -EEXIST) { + pr_err("cacheline tracking EEXIST, overlapping mappings aren't supported\n"); } - - /* TODO: report -EEXIST errors here as overlapping mappings are - * not supported by the DMA API - */ } static int dma_debug_create_entries(gfp_t gfp) -- 2.31.1