[PATCH 2/6] spi/spi-pl022: Use GFP_NOWAIT for allocation from tasklet

2011-08-09 Thread Viresh Kumar
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_NOWAIT to get this fixed.

Signed-off-by: Viresh Kumar viresh.ku...@st.com
---
 drivers/spi/spi-pl022.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f600d00..cbd9afe 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -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_NOWAIT);
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_NOWAIT);
if (ret)
goto err_alloc_tx_sg;
 
-- 
1.7.2.2


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 2/6] spi/spi-pl022: Use GFP_NOWAIT for allocation from tasklet

2011-08-09 Thread Jassi Brar
On Tue, Aug 9, 2011 at 4:35 PM, Viresh Kumar viresh.ku...@st.com wrote:
 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_NOWAIT to get this fixed.

 Signed-off-by: Viresh Kumar viresh.ku...@st.com
 ---
  drivers/spi/spi-pl022.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
 index f600d00..cbd9afe 100644
 --- a/drivers/spi/spi-pl022.c
 +++ b/drivers/spi/spi-pl022.c
 @@ -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_NOWAIT);
        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_NOWAIT);
        if (ret)
                goto err_alloc_tx_sg;

Since this could be called from when we actually need the transfer start,
maybe we could try harder using GFP_ATOMIC instead ?

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 2/6] spi/spi-pl022: Use GFP_NOWAIT for allocation from tasklet

2011-08-09 Thread viresh kumar
On 08/09/2011 04:56 PM, Jassi Brar wrote:
 Since this could be called from when we actually need the transfer start,
 maybe we could try harder using GFP_ATOMIC instead ?

Yes. Will do it.

-- 
viresh

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general