Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 538a18dc authored by Viresh Kumar's avatar Viresh Kumar Committed by Grant Likely
Browse files

spi/spi-pl022: Use GFP_ATOMIC for allocation from tasklet



tasklets don't allow invocation to sleeping routines. In configure_dma()
routine, sg_alloc_table() was called with GFP_KERNEL flag and so this causes
crash when called from tasklet.

Replace GFP_KERNEL with GFP_ATOMIC to get this fixed.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent f1e45f86
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1019,11 +1019,11 @@ static int configure_dma(struct pl022 *pl022)
	pages = (pl022->cur_transfer->len >> PAGE_SHIFT) + 1;
	pages = (pl022->cur_transfer->len >> PAGE_SHIFT) + 1;
	dev_dbg(&pl022->adev->dev, "using %d pages for transfer\n", pages);
	dev_dbg(&pl022->adev->dev, "using %d pages for transfer\n", pages);


	ret = sg_alloc_table(&pl022->sgt_rx, pages, GFP_KERNEL);
	ret = sg_alloc_table(&pl022->sgt_rx, pages, GFP_ATOMIC);
	if (ret)
	if (ret)
		goto err_alloc_rx_sg;
		goto err_alloc_rx_sg;


	ret = sg_alloc_table(&pl022->sgt_tx, pages, GFP_KERNEL);
	ret = sg_alloc_table(&pl022->sgt_tx, pages, GFP_ATOMIC);
	if (ret)
	if (ret)
		goto err_alloc_tx_sg;
		goto err_alloc_tx_sg;