Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] dmaengine: bcm2835: Avoid GFP_KERNEL in device_prep_slave_sg
@ 2019-04-01 18:38 Stefan Wahren
  2019-04-23  5:11 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Wahren @ 2019-04-01 18:38 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul, Florian Fainelli, Ray Jui,
	Scott Branden, Eric Anholt
  Cc: Stefan Wahren, Aaro Koskinen, Lukas Wunner,
	bcm-kernel-feedback-list, linux-arm-kernel, dmaengine,
	Martin Sperl, Florian Kauer, linux-rpi-kernel

The commit af19b7ce76ba ("mmc: bcm2835: Avoid possible races on
data requests") introduces a possible circular locking dependency,
which is triggered by swapping to the sdhost interface.

So instead of reintroduce the race condition again, we could also
avoid this situation by using GFP_NOWAIT for the allocation of the
DMA buffer descriptors.

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: af19b7ce76ba ("mmc: bcm2835: Avoid possible races on data requests")
Link: http://lists.infradead.org/pipermail/linux-rpi-kernel/2019-March/008615.html
---
 drivers/dma/bcm2835-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index ec8a291..54093ff 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -671,7 +671,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg(
 	d = bcm2835_dma_create_cb_chain(chan, direction, false,
 					info, extra,
 					frames, src, dst, 0, 0,
-					GFP_KERNEL);
+					GFP_NOWAIT);
 	if (!d)
 		return NULL;
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RFC] dmaengine: bcm2835: Avoid GFP_KERNEL in device_prep_slave_sg
  2019-04-01 18:38 [PATCH RFC] dmaengine: bcm2835: Avoid GFP_KERNEL in device_prep_slave_sg Stefan Wahren
@ 2019-04-23  5:11 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2019-04-23  5:11 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Florian Fainelli, Scott Branden, Aaro Koskinen, Ray Jui,
	Eric Anholt, Lukas Wunner, bcm-kernel-feedback-list,
	linux-arm-kernel, dmaengine, Martin Sperl, Dan Williams,
	Florian Kauer, linux-rpi-kernel

On 01-04-19, 20:38, Stefan Wahren wrote:
> The commit af19b7ce76ba ("mmc: bcm2835: Avoid possible races on
> data requests") introduces a possible circular locking dependency,
> which is triggered by swapping to the sdhost interface.
> 
> So instead of reintroduce the race condition again, we could also
> avoid this situation by using GFP_NOWAIT for the allocation of the
> DMA buffer descriptors.

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-23  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01 18:38 [PATCH RFC] dmaengine: bcm2835: Avoid GFP_KERNEL in device_prep_slave_sg Stefan Wahren
2019-04-23  5:11 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox