Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1667484

[PATCH 05/11] serial/mpsc: switch to dma_alloc_attrs

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject [PATCH 05/11] serial/mpsc: switch to dma_alloc_attrs
Date 2017-06-16 09:30 +0200
Message-ID <tSTRE-5pn-1@gated-at.bofh.it> (permalink)
References <tSTHX-5l6-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/tty/serial/mpsc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index 1a60a2063e75..67ffecc50e42 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -754,9 +754,10 @@ static int mpsc_alloc_ring_mem(struct mpsc_port_info *pi)
 		if (!dma_set_mask(pi->port.dev, 0xffffffff)) {
 			printk(KERN_ERR "MPSC: Inadequate DMA support\n");
 			rc = -ENXIO;
-		} else if ((pi->dma_region = dma_alloc_noncoherent(pi->port.dev,
+		} else if ((pi->dma_region = dma_alloc_attrs(pi->port.dev,
 						MPSC_DMA_ALLOC_SIZE,
-						&pi->dma_region_p, GFP_KERNEL))
+						&pi->dma_region_p, GFP_KERNEL,
+						DMA_ATTR_NON_CONSISTENT))
 				== NULL) {
 			printk(KERN_ERR "MPSC: Can't alloc Desc region\n");
 			rc = -ENOMEM;
@@ -771,8 +772,9 @@ static void mpsc_free_ring_mem(struct mpsc_port_info *pi)
 	pr_debug("mpsc_free_ring_mem[%d]: Freeing ring mem\n", pi->port.line);
 
 	if (pi->dma_region) {
-		dma_free_noncoherent(pi->port.dev, MPSC_DMA_ALLOC_SIZE,
-				pi->dma_region, pi->dma_region_p);
+		dma_free_attrs(pi->port.dev, MPSC_DMA_ALLOC_SIZE,
+				pi->dma_region, pi->dma_region_p,
+				DMA_ATTR_NON_CONSISTENT);
 		pi->dma_region = NULL;
 		pi->dma_region_p = (dma_addr_t)NULL;
 	}
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

remove dma_alloc_noncoherent Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
  [PATCH 08/11] sgiseeq: switch to dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
  [PATCH 11/11] dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
  [PATCH 02/11] dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
  [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
    Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs Takashi Iwai <tiwai@suse.de> - 2017-06-16 11:00 +0200
      Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to   dma_alloc_attrs Takashi Iwai <tiwai@suse.de> - 2017-06-16 11:00 +0200
      Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to         dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 11:00 +0200
  [PATCH 10/11] i825xx: switch to switch to dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:20 +0200
  [PATCH 05/11] serial/mpsc: switch to dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:30 +0200
  [PATCH 03/11] au1100fb: remove a bogus dma_free_nonconsistent call Christoph Hellwig <hch@lst.de> - 2017-06-16 09:30 +0200
    Re: [PATCH 03/11] au1100fb: remove a bogus dma_free_nonconsistent  call Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-06-19 13:20 +0200
  [PATCH 01/11] dma-mapping: remove dmam_free_noncoherent Christoph Hellwig <hch@lst.de> - 2017-06-16 09:30 +0200
  [PATCH 06/11] sigwd93: switch to dma_alloc_attrs Christoph Hellwig <hch@lst.de> - 2017-06-16 09:30 +0200

csiph-web