Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1879895pxb; Fri, 10 Sep 2021 16:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy50RJ9vfHmNAyeiupmGWxSF77eLNnk71pqZsyz5ZJQDFPCgnz7wNzYHsZV42pnlMjykEeZ X-Received: by 2002:a05:6e02:e42:: with SMTP id l2mr137776ilk.285.1631318117265; Fri, 10 Sep 2021 16:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631318117; cv=none; d=google.com; s=arc-20160816; b=T3DEypJBVwuj8Qrxkk3NUJcxkI81wof7eJfi7UgN33v+b6ucF3CE/WjzGymeyV6pEc WFUqypceBYQO1noIqi88m1ZJMpo63hOJwAGBIFd5ETy6O7s4HRGjIDTZHj0wqz7ulY1O pgu00tGiUeMQ7lJOvG2O19eZBWehnvgXAhZrU+zhlRbrYm8faVk1/hZRdQv5gkGphltK NICa+6bzdWq3dm187XLpoj2PbzTOSnqC0hhBPUldev5bTeSQeYA9dgKFI9H2k8Zn8G2n HScl/kdN7Qy7d0FVk5Oi+udrj1bep5P+IT6np/J0NaPtrbWo/n+hL2GUGbytUT62CNPg 13LA== 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=KnmXNg6HdIz/nbMuGBZoT4IIC0Qd0guSw/TBL4pDUYY=; b=dppfTKSnU88PqhBkdnuI3DhgIujSOsNL1vvv+CYxCUmHch4zPD1nEUM5ldwQ5ulQz9 H3ag/gVdGGw24Oft2C3kYJPj4QqoV4k2k420G95F5bAJNnd30S9hmwH+GKztiNTKXKHx sLvy05/dSIJvBhQn+LPOTZMvzzgzgDbDRk5iL/iHQudd8Juy84kN5ZRepbbYCFMjRpRB qGQcUMw/hnPhdEctNzB6JiSRuEuvkJXDFnIHxSfGH7WU5ypB98RKD2x15KVTraNIItKT ibhGvYX/y59paOXvYwSpuLHvKi3C8s3lm5Pplu98lFLjFsPlX+1RGrZm+NcJJiXMPY0V h31w== 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 x22si90719iow.31.2021.09.10.16.55.06; Fri, 10 Sep 2021 16:55:17 -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 S233946AbhIJXzk (ORCPT + 99 others); Fri, 10 Sep 2021 19:55:40 -0400 Received: from h4.fbrelay.privateemail.com ([131.153.2.45]:47383 "EHLO h4.fbrelay.privateemail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232897AbhIJXzj (ORCPT ); Fri, 10 Sep 2021 19:55:39 -0400 Received: from MTA-15-3.privateemail.com (MTA-15-1.privateemail.com [198.54.118.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h3.fbrelay.privateemail.com (Postfix) with ESMTPS id 945EE829C2 for ; Fri, 10 Sep 2021 19:54:26 -0400 (EDT) Received: from mta-15.privateemail.com (localhost [127.0.0.1]) by mta-15.privateemail.com (Postfix) with ESMTP id 2C61B18000B2; Fri, 10 Sep 2021 19:54:25 -0400 (EDT) Received: from hal-station.. (unknown [10.20.151.209]) by mta-15.privateemail.com (Postfix) with ESMTPA id 4FAAF18000A3; Fri, 10 Sep 2021 19:54:24 -0400 (EDT) From: Hamza Mahfooz To: linux-kernel@vger.kernel.org Cc: Hamza Mahfooz , Jeremy Linton , Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org Subject: [PATCH v2] dma-debug: prevent an error message from causing runtime problems Date: Fri, 10 Sep 2021 19:53:37 -0400 Message-Id: <20210910235337.13172-1-someguy@effective-light.com> X-Mailer: git-send-email 2.33.0 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 For some drivers, that use the DMA API. This error message can be reached several millions of times per second, causing spam to the kernel's printk buffer and bringing the CPU usage up to 100% (so, it should be rate limited). However, since there is at least one driver that is in the mainline and suffers from the error condition, it is more useful to err_printk() here instead of just rate limiting the error message (in hopes that it will make it easier for other drivers that suffer from this issue to be spotted). Link: https://lkml.kernel.org/r/fd67fbac-64bf-f0ea-01e1-5938ccfab9d0@arm.com Reported-by: Jeremy Linton Signed-off-by: Hamza Mahfooz --- v2: use err_printk() and make some clarifications in the commit message. --- kernel/dma/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 6c90c69e5311..718a7f455df6 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -567,7 +567,8 @@ static void add_dma_entry(struct dma_debug_entry *entry) 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"); + err_printk(entry->dev, entry, "cacheline tracking EEXIST, " + "overlapping mappings aren't supported\n"); } } -- 2.33.0