linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <Ludovic.Desroches@microchip.com>, <dan.j.williams@intel.com>,
	<vkoul@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<Tudor.Ambarus@microchip.com>
Subject: [PATCH 05/10] dmaengine: at_hdmac: Switch atomic allocations to GFP_NOWAIT
Date: Thu, 23 Jan 2020 14:03:09 +0000	[thread overview]
Message-ID: <20200123140237.125799-5-tudor.ambarus@microchip.com> (raw)
In-Reply-To: <20200123140237.125799-1-tudor.ambarus@microchip.com>

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Avoids sleeping without depleting the emergency pool.
The rationale being that in most cases a dma device is either
offloading an operation that will automatically fallback to
software when the descriptor allocation fails, or we can simply poll
and wait for the dma device to release some in use descriptors.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/dma/at_hdmac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 44d998bc894b..8e8e04bd1b28 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -147,7 +147,7 @@ static struct at_desc *atc_desc_get(struct at_dma_chan *atchan)
 
 	/* no more descriptor available in initial pool: create one more */
 	if (!ret)
-		ret = atc_alloc_descriptor(&atchan->chan_common, GFP_ATOMIC);
+		ret = atc_alloc_descriptor(&atchan->chan_common, GFP_NOWAIT);
 
 	return ret;
 }
@@ -931,7 +931,7 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
 		return NULL;
 	}
 
-	vaddr = dma_pool_alloc(atdma->memset_pool, GFP_ATOMIC, &paddr);
+	vaddr = dma_pool_alloc(atdma->memset_pool, GFP_NOWAIT, &paddr);
 	if (!vaddr) {
 		dev_err(chan2dev(chan), "%s: couldn't allocate buffer\n",
 			__func__);
@@ -989,7 +989,7 @@ atc_prep_dma_memset_sg(struct dma_chan *chan,
 		return NULL;
 	}
 
-	vaddr = dma_pool_alloc(atdma->memset_pool, GFP_ATOMIC, &paddr);
+	vaddr = dma_pool_alloc(atdma->memset_pool, GFP_NOWAIT, &paddr);
 	if (!vaddr) {
 		dev_err(chan2dev(chan), "%s: couldn't allocate buffer\n",
 			__func__);
-- 
2.23.0

  parent reply	other threads:[~2020-01-23 14:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 14:03 [PATCH 01/10] dmaengine: at_hdmac: Substitute kzalloc with kmalloc Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 02/10] dmaengine: at_hdmac: Drop locking in at_hdmac_alloc_chan_resources() Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 03/10] dmaengine: at_hdmac: Return err in case the chan is not free at alloc res time Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 04/10] dmaengine: at_hdmac: Drop description for a not defined parameter Tudor.Ambarus
2020-01-23 14:03 ` Tudor.Ambarus [this message]
2020-01-23 14:03 ` [PATCH 06/10] dmaengine: at_hdmac: Fix deadlocks Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 07/10] dmaengine: at_xdmac: Drop always true check Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 08/10] dmaengine: at_xdmac: Drop locking in at_xdmac_alloc_chan_resources() Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 09/10] dmaengine: at_xdmac: GFP_KERNEL for user that can sleep Tudor.Ambarus
2020-01-23 14:03 ` [PATCH 10/10] dmaengine: at_xdmac: Fix locking in tasklet Tudor.Ambarus
2020-02-03  8:24 ` [PATCH 01/10] dmaengine: at_hdmac: Substitute kzalloc with kmalloc Ludovic Desroches
2020-02-25  5:58 ` Vinod Koul

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=20200123140237.125799-5-tudor.ambarus@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).