public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux-foundation.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] dma-direct: respect DMA_ATTR_NO_WARN
Date: Mon,  1 Oct 2018 13:12:57 -0700	[thread overview]
Message-ID: <20181001201257.366-3-hch@lst.de> (raw)
In-Reply-To: <20181001201257.366-1-hch@lst.de>

Respect the DMA_ATTR_NO_WARN flags for allocations in dma-direct.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 kernel/dma/direct.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 170bd322a94a..ba6f5956a291 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -107,6 +107,9 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size,
 	u64 phys_mask;
 	void *ret;
 
+	if (attrs & DMA_ATTR_NO_WARN)
+		gfp |= __GFP_NOWARN;
+
 	/* we always manually zero the memory once we are done: */
 	gfp &= ~__GFP_ZERO;
 	gfp |= __dma_direct_optimal_gfp_mask(dev, dev->coherent_dma_mask,
-- 
2.19.0


  parent reply	other threads:[~2018-10-01 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 20:12 fix up nowarn confusion in the dma mapping layer Christoph Hellwig
2018-10-01 20:12 ` [PATCH 1/2] dma-mapping: translate __GFP_NOFAIL to DMA_ATTR_NO_WARN Christoph Hellwig
2018-10-01 20:12 ` Christoph Hellwig [this message]
2018-10-08  7:03 ` fix up nowarn confusion in the dma mapping layer Christoph Hellwig
2018-10-09 12:55   ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001201257.366-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox