Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp691264imm; Wed, 25 Jul 2018 04:39:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKjCzkKgxBtVLaVh+Gs2DsZR+HQ+LrYCNhY5sxxwfn/ZUy13PVIW5FIr8YPBaarNgvkrcf X-Received: by 2002:a63:2fc6:: with SMTP id v189-v6mr20100283pgv.61.1532518771214; Wed, 25 Jul 2018 04:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532518771; cv=none; d=google.com; s=arc-20160816; b=s1PbVBKN2C/HlyFyVTZxUmV9YQHD6EuqxoNKD7bB88X4l3y7Wnui1vWF8Ay/luJbwO zFMcCdRG0qJxIg6B4YI83SN9FSdPKjt7EYfG/8A+TquNwHWP5gsSY5yB7AD8r46WMQyD 6d/j1nfAqbvbNU18+mtHq5oTSXjRGmBBBNmgncaGQLzuFyt9IokzZqSluvGJ0ChpqJNw 7IreFqUnn6riHjO0g34Z8+Opd4n9HiRHhHg3CYbnj1Fb2K0Of/Zrt3WQWS8p4ogQCmG9 mYVIAZEJhkHiJVm6ermXZKdbh41S86GqU6GQzZi3yWws1lNQEHKNiNu63lbn4m0IkE4n KQGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=g1XJc4NMMKruBuBefALJIyJ4oWcJvLNZ3oMaHkEybYA=; b=liAiYk9sUM/9ymIj0ax/iYMiSVt0+R6e5mEou2mahhQURfbNrEY8poFqYdMie4typ9 M2k5PRmme86JSJ63pTrqPXBMJTYktr1+OS6D9ZtWbYtvLlJX2n9lHEL4e3niH/D43bDC KkPz8jCTB3/CfWDuT1eBkWQeZptuMeOd6YZGUYJMwEXK3qv9F7YneXifd/oeWLXCAxgu yaG8+g9MAfhiq/y6m2kCJcWG64fhs6KLT9k0DHxjsGXAQ5k3DjekBp7mfRFcR3w5NUrI tI0B+aIKcksqaNzmDlyJIZwRI0nGITHU236H8zSZYnb+ZDcrcpTV7LTwMYrFqGyHXEfX 9QWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fMRhy6gj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25-v6si14299585pfp.108.2018.07.25.04.39.16; Wed, 25 Jul 2018 04:39:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fMRhy6gj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729041AbeGYMtk (ORCPT + 99 others); Wed, 25 Jul 2018 08:49:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39588 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729022AbeGYMtj (ORCPT ); Wed, 25 Jul 2018 08:49:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g1XJc4NMMKruBuBefALJIyJ4oWcJvLNZ3oMaHkEybYA=; b=fMRhy6gjMwQxHMPeRGkIaVAtq BujM9X4Ss07k0gaTfDL994lgNsN4YJV+0CSmWLpoa4lJymJrxXS5d+hWg8BalAJOuk7xjASgS7At4 k8LkpT7E5ysF6S/3MHw9XfskPuT1qdS/8BFz8dVqIEl2U2wYFwPzIMb1hcqD64H1AicHbyCfu4TF8 D8zpFqOtSbZchyTWVFmEqQfLKj4d6h+u3bNMGIswaq2903qW3v6iWUu9BZrAzkil2LfNNyxi+/zJ5 SAvFd0FjA8Dq0wPd+ebwCWhHZcbPJ7/XH5Tj+Xk9V/GQohzfKWL7zL0FB+Cg49CxGXyITwwDTsV6p mu2D5VaUQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiI7Z-0006pE-Nj; Wed, 25 Jul 2018 11:38:22 +0000 From: Christoph Hellwig To: Konrad Rzeszutek Wilk Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] swiotlb: respect DMA_ATTR_NO_WARN in __swiotlb_map_page Date: Wed, 25 Jul 2018 13:38:02 +0200 Message-Id: <20180725113802.18943-7-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180725113802.18943-1-hch@lst.de> References: <20180725113802.18943-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 8ca0964ebf3a..5c3db7c89e0f 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -606,8 +606,11 @@ __swiotlb_map_page(struct device *dev, phys_addr_t phys, size_t size, switch (swiotlb_force) { case SWIOTLB_NO_FORCE: - dev_warn_ratelimited(dev, - "swiotlb: force disabled for address %pa\n", &phys); + if (!(attrs & DMA_ATTR_NO_WARN)) { + dev_warn_ratelimited(dev, + "swiotlb: force disabled for address %pa\n", + &phys); + } return -EOPNOTSUPP; case SWIOTLB_NORMAL: /* can we address the memory directly? */ @@ -627,10 +630,12 @@ __swiotlb_map_page(struct device *dev, phys_addr_t phys, size_t size, /* Ensure that the address returned is DMA'ble */ *dma_addr = __phys_to_dma(dev, map_addr); if (unlikely(!dma_capable(dev, *dma_addr, size))) { - dev_err_ratelimited(dev, - "DMA: swiotlb buffer not addressable.\n"); + if (!(attrs & DMA_ATTR_NO_WARN)) { + dev_err_ratelimited(dev, + "DMA: swiotlb buffer not addressable.\n"); + } swiotlb_tbl_unmap_single(dev, map_addr, size, dir, - attrs | DMA_ATTR_SKIP_CPU_SYNC); + attrs | DMA_ATTR_SKIP_CPU_SYNC); return -EINVAL; } return 0; -- 2.18.0