Skip to content

Commit

Permalink
spi/spi-pl022: Use GFP_ATOMIC for allocation from tasklet
Browse files Browse the repository at this point in the history
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: Viresh Kumar <viresh.kumar@st.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Viresh Kumar authored and Grant Likely committed Sep 21, 2011
1 parent f1e45f8 commit 538a18d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-pl022.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,11 +1019,11 @@ static int configure_dma(struct pl022 *pl022)
pages = (pl022->cur_transfer->len >> PAGE_SHIFT) + 1;
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)
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)
goto err_alloc_tx_sg;

Expand Down

0 comments on commit 538a18d

Please sign in to comment.